Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PEP 440: Note case where pkg_resources subsequently changed to match the PEP #881

Closed
ncoghlan opened this issue Jan 20, 2019 · 6 comments · Fixed by #2422
Closed

PEP 440: Note case where pkg_resources subsequently changed to match the PEP #881

ncoghlan opened this issue Jan 20, 2019 · 6 comments · Fixed by #2422

Comments

@ncoghlan
Copy link
Contributor

According to https://mail.python.org/archives/list/[email protected]/message/OXN53BWJYSMFK535OWUJR5MAXEIBWRBX/, some time since https://www.python.org/dev/peps/pep-0440/#summary-of-differences-from-pkg-resources-parse-version was written, pkg_resource.parse_version started ordering local version numbers the same way that PEP 440 does.

@jaraco Do you have any idea when that might have changed? https://setuptools.readthedocs.io/en/latest/history.html doesn't call it out explicitly anywhere, so I'm wondering if it might have happened inadvertently while converging on a shared supported library.

@ncoghlan ncoghlan changed the title PEP 440: Note where pkg_resources subsequently changes to match the PEP PEP 440: Note case where pkg_resources subsequently changed to match the PEP Jan 20, 2019
@jaraco
Copy link
Member

jaraco commented Apr 8, 2019

Using bisect, I found the relevant commit is pypa/setuptools@9382fa0.

setuptools master $ git bisect start --term-new=fixed --term-old=unfixed                                                                                                       
setuptools master $ git bisect fixed master                                                                                                                                    
setuptools master $ git bisect unfixed 5.0                                                                                                                                     
Bisecting: 1803 revisions left to test after this (roughly 11 steps)
[0fc24e1a277513a303d845b38ac71f854fbc8f65] Merge pull request #637 from stepshal/comparison
setuptools master $ git bisect run python3.5 -c 'import pkg_resources; assert pkg_resources.parse_version("1.0.0+dev") <= pkg_resources.parse_version("1.0.0")'                
running python3.5 -c import pkg_resources; assert pkg_resources.parse_version("1.0.0+dev") <= pkg_resources.parse_version("1.0.0")
Traceback (most recent call last):
  File "<string>", line 1, in <module>
AssertionError
Bisecting: 902 revisions left to test after this (roughly 10 steps)
[5e00a02ea1f7473c952d4d359891db4f53ac1778] Disable warning of LegacyVersion in parsed_version. This functionality should be called explicitly at whatever times are appropriate for the warning. Fixes #307.
running python3.5 -c import pkg_resources; assert pkg_resources.parse_version("1.0.0+dev") <= pkg_resources.parse_version("1.0.0")
Traceback (most recent call last):
  File "<string>", line 1, in <module>
AssertionError
Bisecting: 450 revisions left to test after this (roughly 9 steps)
[de1af740bc79592faac63b3c0c8d50383b373dd4] Extract common operation of dedent and left strip
running python3.5 -c import pkg_resources; assert pkg_resources.parse_version("1.0.0+dev") <= pkg_resources.parse_version("1.0.0")
Traceback (most recent call last):
  File "<string>", line 1, in <module>
AssertionError
Bisecting: 225 revisions left to test after this (roughly 8 steps)
[d195bc900beccb22c8de243416c40564ea28402f] Remove unused import
running python3.5 -c import pkg_resources; assert pkg_resources.parse_version("1.0.0+dev") <= pkg_resources.parse_version("1.0.0")
Bisecting: 112 revisions left to test after this (roughly 7 steps)
[20ac482786bc7622f67df8ab13810fde9fd850ac] Merge pull request #20 from dstufft/dont-warn-empty
running python3.5 -c import pkg_resources; assert pkg_resources.parse_version("1.0.0+dev") <= pkg_resources.parse_version("1.0.0")
Traceback (most recent call last):
  File "<string>", line 1, in <module>
AssertionError
Bisecting: 56 revisions left to test after this (roughly 6 steps)
[dd32e04bc63ac7bd9f70b9684b76bdb283b6111d] Bumped to 7.0 in preparation for next release.
running python3.5 -c import pkg_resources; assert pkg_resources.parse_version("1.0.0+dev") <= pkg_resources.parse_version("1.0.0")
Bisecting: 28 revisions left to test after this (roughly 5 steps)
[4ae526d52609fe2a7515d87e4c0d047a826411a7] Always use the vendored copy of packaging
running python3.5 -c import pkg_resources; assert pkg_resources.parse_version("1.0.0+dev") <= pkg_resources.parse_version("1.0.0")
Traceback (most recent call last):
  File "<string>", line 1, in <module>
AssertionError
Bisecting: 13 revisions left to test after this (roughly 4 steps)
[affa001a6767efee24b4d6bc1a2f04eb7aeea65b] Merge
running python3.5 -c import pkg_resources; assert pkg_resources.parse_version("1.0.0+dev") <= pkg_resources.parse_version("1.0.0")
Bisecting: 6 revisions left to test after this (roughly 3 steps)
[7d9c21a893431798ba77edd62b5490ff4ce47ecf] Prefer packaging library if available.
running python3.5 -c import pkg_resources; assert pkg_resources.parse_version("1.0.0+dev") <= pkg_resources.parse_version("1.0.0")
Traceback (most recent call last):
  File "<string>", line 1, in <module>
AssertionError
Bisecting: 3 revisions left to test after this (roughly 2 steps)
[c5d53df96d27f54f40ae4df974a74e1536f45ae1] Merge github pull request #13 (dstufft/setuptools:use-packaging).
running python3.5 -c import pkg_resources; assert pkg_resources.parse_version("1.0.0+dev") <= pkg_resources.parse_version("1.0.0")
Traceback (most recent call last):
  File "<string>", line 1, in <module>
AssertionError
Bisecting: 0 revisions left to test after this (roughly 1 step)
[9382fa0c05e533400613e1c7c0a777cabb463390] Implement PEP 440 by using the packaging library
running python3.5 -c import pkg_resources; assert pkg_resources.parse_version("1.0.0+dev") <= pkg_resources.parse_version("1.0.0")
Traceback (most recent call last):
  File "<string>", line 1, in <module>
AssertionError
Bisecting: 0 revisions left to test after this (roughly 0 steps)
[84c9006110e53c84296a05741edb7b9edd305f12] Add a vendored copy of packaging
running python3.5 -c import pkg_resources; assert pkg_resources.parse_version("1.0.0+dev") <= pkg_resources.parse_version("1.0.0")
9382fa0c05e533400613e1c7c0a777cabb463390 is the first fixed commit
commit 9382fa0c05e533400613e1c7c0a777cabb463390
Author: Donald Stufft <[email protected]>
Date:   Thu Sep 4 21:04:06 2014 -0400

    Implement PEP 440 by using the packaging library

:100644 100644 a6e27372d6af1d051b79447bc2272106e1f4efed e458d76c33d3005aa395af5409572b42209bb63f M      CHANGES.txt
:040000 040000 8e303f14da2aaef6b712d6d2d04a08747ff8aca2 d19044d021fb9104d0466f867ff26be63217bdc2 M      docs
:100644 100644 517298c90dbf2bb39b59a3e5cf01927a78e18818 b59ec52364771234ce4aca765a54be28ef72aaee M      pkg_resources.py
:040000 040000 cd6c875b6898b3055266ab32db69f9b5358a9473 fa17935a9e6a59198a000194dac497a54b5f721f M      setuptools
bisect run success

@jaraco
Copy link
Member

jaraco commented Apr 8, 2019

So Setuptools 6.0 was the version.

@ncoghlan
Copy link
Contributor Author

ncoghlan commented Apr 8, 2019

Thanks!

@AA-Turner
Copy link
Member

@ncoghlan is there any action to be taken here? I'll close the issue if not.

A

@CAM-Gerlach
Copy link
Member

If there's an update needed, perhaps it should be on the PyPA specifications page instead

@ncoghlan
Copy link
Contributor Author

This only affects the part of the PEP that compares it to the way pkg_resource.parse_version used to work, so there isn't any impact on the spec itself, just on the background info.

I posted a PR to add a note about it, which will close this issue when merged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants