[Freeipa-devel] [freeipa PR#254][comment] Replace LooseVersion with pkg_resources.parse_version
URL: https://github.com/freeipa/freeipa/pull/254 Title: #254: Replace LooseVersion with pkg_resources.parse_version martbab commented: """ Yes that's why we resorted to a direct CFFI call to RPM libs during server version check in upgrade. We simply could not win aside from re-implementing parsing of Z-stream versions etc. from scratch. """ See the full comment at https://github.com/freeipa/freeipa/pull/254#issuecomment-261500197 -- Manage your subscription for the Freeipa-devel mailing list: https://www.redhat.com/mailman/listinfo/freeipa-devel Contribute to FreeIPA: http://www.freeipa.org/page/Contribute/Code
[Freeipa-devel] [freeipa PR#254][comment] Replace LooseVersion with pkg_resources.parse_version
URL: https://github.com/freeipa/freeipa/pull/254 Title: #254: Replace LooseVersion with pkg_resources.parse_version tiran commented: """ sigh, you are right, parse_version does not handle one version comparison as we expect: ```4.2.0-15.el7 < 4.2.0-15.el7_2.3``` ``` from __future__ import print_function import operator import pkg_resources version_strings = [ ("3.0.0-1.el6", "3.0.0-2.el6", operator.lt), ("3.0.0-1.el6_8", "3.0.0-1.el6_8.1", operator.lt), ("3.0.0-42.el6", "3.0.0-1.el6", operator.gt), ("3.0.0-1.el6", "3.0.0-42.el6", operator.lt), ("3.0.0-42.el6", "3.3.3-1.fc20", operator.lt), ("4.2.0-15.el7", "4.2.0-15.el7_2.3", operator.lt), ("4.2.0-15.el7_2", "4.2.0-15.el7_2.3", operator.lt), ("4.2.0-15.el7_2.3", "4.2.0-15.el7_2.3", operator.eq), ("4.2.0-15.el7_2.3", "4.2.0-15.el7_2.2", operator.gt), ("4.2.0-1.fc23", "4.2.1-1.fc23", operator.lt), ("4.2.3-alpha1.fc23", "4.2.3-2.fc23", operator.lt), ("4.3.90.201601080923GIT55aeea7-0.fc23", "4.3.0-1.fc23", operator.gt) ] for v1, v2, op in version_strings: v1 = pkg_resources.parse_version(v1) v2 = pkg_resources.parse_version(v2) if not op(v1, v2): print("failure: ", v1, op.__name__, v2) ``` ``` $ python v.py failure: 4.2.0-15.el7 lt 4.2.0-15.el7_2.3 ``` """ See the full comment at https://github.com/freeipa/freeipa/pull/254#issuecomment-261491515 -- Manage your subscription for the Freeipa-devel mailing list: https://www.redhat.com/mailman/listinfo/freeipa-devel Contribute to FreeIPA: http://www.freeipa.org/page/Contribute/Code
[Freeipa-devel] [freeipa PR#254][comment] Replace LooseVersion with pkg_resources.parse_version
URL: https://github.com/freeipa/freeipa/pull/254 Title: #254: Replace LooseVersion with pkg_resources.parse_version martbab commented: """ I have a sneaky suspicion that the parse_version couldn't cope correctly with some of the downstream versioning schemes like RHEL z-stream releases and such. That should be OK with API version, but client/server versions can pose a problem. There is are some examples in the ipatests/test_ipaserver/test_version_comparison.py I made when solving a bug that was caused by incorrect version comparison. Can you check if parse_version can handle them correctly? """ See the full comment at https://github.com/freeipa/freeipa/pull/254#issuecomment-261479903 -- Manage your subscription for the Freeipa-devel mailing list: https://www.redhat.com/mailman/listinfo/freeipa-devel Contribute to FreeIPA: http://www.freeipa.org/page/Contribute/Code
[Freeipa-devel] [freeipa PR#254][comment] Replace LooseVersion with pkg_resources.parse_version
URL: https://github.com/freeipa/freeipa/pull/254 Title: #254: Replace LooseVersion with pkg_resources.parse_version tiran commented: """ The PR is related to integration improvements and pip-installable effort, https://fedorahosted.org/freeipa/ticket/6468. """ See the full comment at https://github.com/freeipa/freeipa/pull/254#issuecomment-261476303 -- Manage your subscription for the Freeipa-devel mailing list: https://www.redhat.com/mailman/listinfo/freeipa-devel Contribute to FreeIPA: http://www.freeipa.org/page/Contribute/Code