Skip to content

Commit d02eac5

Browse files
committed
Trimmed trailing .0 from requires_python versions for cleaner output
1 parent e35a916 commit d02eac5

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

  • get-min-py/src/get_min_py

get-min-py/src/get_min_py/api.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,9 @@ def get_min_py(pkg_names: Union[str, List[str]]) -> Union[Optional[str], List[Op
2424
if op == '>': # return minor-bumped
2525
major, minor = version.split('.')[:2]
2626
results.append(f'{major}.{int(minor) + 1}')
27-
else: # >=|==|~=
28-
results.append(version) # as-is
27+
else: # >=|==|~= no bump
28+
if version.endswith('.0') : version = version[:-2]
29+
results.append(version)
2930
continue # to next pkg
3031

3132
# Check classifiers

0 commit comments

Comments
 (0)