Skip to content

Commit ebcc327

Browse files
fix: modified integration tests to match the new version standardization and fixed small bug with version regex.
Signed-off-by: Abhinav Pradeep <[email protected]>
1 parent e1ac713 commit ebcc327

File tree

3 files changed

+8
-4
lines changed

3 files changed

+8
-4
lines changed

src/macaron/build_spec_generator/common_spec/pypi_spec.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -331,6 +331,10 @@ def parse_generator_version(self, literal_version_specification: str) -> str:
331331
'1.2.3'
332332
>>> spec.parse_generator_version("1.2.3")
333333
'1.2.3'
334+
>>> spec.parse_generator_version("10.2.3")
335+
'10.2.3'
336+
>>> spec.parse_generator_version("(10.2.3)")
337+
'10.2.3'
334338
>>> spec.parse_generator_version("a.b.c")
335339
''
336340
>>> spec.parse_generator_version("1..2.3")
@@ -340,9 +344,9 @@ def parse_generator_version(self, literal_version_specification: str) -> str:
340344
"""
341345
# Two patterns p1 and p2 rather than just one
342346
# (p1)|(p2) as the latter complicates the group to return
343-
pattern_plain = re.compile(r"^(\d(\.(\d)+)*)$")
347+
pattern_plain = re.compile(r"^(\d+(\.(\d)+)*)$")
344348
plain_match = pattern_plain.match(literal_version_specification)
345-
pattern_parenthesis = re.compile(r"^\((\d(\.(\d)+)*)\)$")
349+
pattern_parenthesis = re.compile(r"^\((\d+(\.(\d)+)*)\)$")
346350
parenthesis_match = pattern_parenthesis.match(literal_version_specification)
347351
if plain_match:
348352
return plain_match.group(1)

tests/integration/cases/pypi_cachetools/expected_default.buildspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
]
2424
],
2525
"build_requires": {
26-
"setuptools": "==(80.9.0)",
26+
"setuptools": "==80.9.0",
2727
"wheel": ""
2828
},
2929
"build_backends": [

tests/integration/cases/pypi_toga/expected_default.buildspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
]
2424
],
2525
"build_requires": {
26-
"setuptools": "==(80.3.1)",
26+
"setuptools": "==80.3.1",
2727
"setuptools_dynamic_dependencies": "==1.0.0",
2828
"setuptools_scm": "==8.3.1"
2929
},

0 commit comments

Comments
 (0)