[Rpm-maint] [rpm-software-management/rpm] scripts/pythondistdeps: Improved python version and operator handling. (#1015)

Gordon Messmer notifications at github.com
Wed Jan 22 15:17:17 UTC 2020


gordonmessmer commented on this pull request.



> +        version_id = version_id[:-2]
+        version = RpmVersion(version_id)
+        lower_version = RpmVersion(version_id).increment()
+    else:
+        version = RpmVersion(version_id)
+        lower_version = version
+    return '(%s < %s or %s > %s)' % (
+        name, version, name, lower_version)
+
+def convert_ordered(name, operator, version_id):
+    if version_id.endswith('.*'):
+        version_id = version_id[:-2]
+        version = RpmVersion(version_id)
+        if '>' == operator:
+            operator = '>='
+            version.increment()

This is in the case that the version ends with `.*`.  Assuming that you mean `> 2.5.*`, yes, that would be converted to `>= 2.6`.  I want to look at the spec again, because I no longer remember on what I based that conversion and it seems wrong.  pip seems happy with 1.0.0 matching 1>1.0.*`

```
$ pip install 'cairocffi > 1.0.*,< 1.0.1'
Collecting cairocffi<1.0.1,>1.0.*
  Downloading https://files.pythonhosted.org/packages/8e/05/143647cb9c228122264a70f82543bbc9cc499b4078c242a24b6b546e2050/cairocffi-1.0.0-py3-none-any.whl
```

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/pull/1015#discussion_r369621121
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rpm.org/pipermail/rpm-maint/attachments/20200122/c084172e/attachment.html>


More information about the Rpm-maint mailing list