diff --git a/python-rpm-generators.spec b/python-rpm-generators.spec index ec09342..80d64d5 100644 --- a/python-rpm-generators.spec +++ b/python-rpm-generators.spec @@ -49,6 +49,9 @@ install -Dpm0755 -t %{buildroot}%{_rpmconfigdir} *.py %changelog * Tue Jul 21 2020 Miro HronĨok - 11-10 - pythondistdeps: Split Python Extras names after the rightmost plus sign +- pythondistdeps: Handle edge cases of version comparisons more closely to + upstream, despite irrationality + See: https://github.com/pypa/packaging/issues/320 * Fri Jul 10 2020 Tomas Orsava - 11-9 - pythondistdeps: Implement provides/requires for extras packages diff --git a/pythondistdeps.py b/pythondistdeps.py index 7b5a0c2..1ca576b 100755 --- a/pythondistdeps.py +++ b/pythondistdeps.py @@ -115,12 +115,12 @@ def convert_ordered(name, operator, version_id): # with ordered comparisons version_id = version_id[:-2] version = RpmVersion(version_id) - if '>' == operator: - # distutils does not behave this way, but this is - # their recommendation - # https://mail.python.org/archives/list/distutils-sig@python.org/thread/NWEQVTCX5CR2RKW2LT4H77PJTEINSX7P/ + if operator == '>': + # distutils will allow a prefix match with '>' operator = '>=' - version.increment() + if operator == '<=': + # distutils will not allow a prefix match with '<=' + operator = '<' else: version = RpmVersion(version_id) return '{} {} {}'.format(name, operator, version)