Skip to content

Commit 9f54443

Browse files
philippjhhenryiii
andauthored
fix: use correct settings key to remove parts of the version in regex metadata plugin (#887)
Hello together. I've been trying to use the `remove` settings key for the `regex` metadata plugin and noticed, that it has been non-functional for me. To me, it looks like the plugin acquires the wrong value from the settings dictionary (`result` instead of `remove`). This PR intends to change this to what I believe is correct. --------- Co-authored-by: Henry Schreiner <[email protected]>
1 parent 26526bd commit 9f54443

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/scikit_build_core/metadata/regex.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ def dynamic_metadata(
4646
)
4747
result = settings.get("result", "{value}")
4848
assert isinstance(result, str)
49-
remove = settings.get("result", "")
49+
remove = settings.get("remove", "")
5050

5151
with Path(input_filename).open(encoding="utf-8") as f:
5252
match = re.search(regex, f.read(), re.MULTILINE)

tests/test_dynamic_metadata.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -346,4 +346,4 @@ def test_regex_remove(
346346
},
347347
)
348348

349-
assert version == "1.2.3dev1" if dev else "1.2.3"
349+
assert version == ("1.2.3dev1" if dev else "1.2.3")

0 commit comments

Comments
 (0)