-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Monkeypatch distutils.filelist.findall for Python 3.4.6 #971
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
Conversation
Since the latest version of python 3.4.x series is 3.4.6 and it does not include an fixed version of "distutils.filelist.findall", this commit makes sure the patch is also applied. For sake of comparison, this link highlights the "still broken" implementation associated with v3.4.6: https://github.com/python/cpython/blob/v3.4.6/Lib/distutils/filelist.py#L245-L273 And this link highlights the correct version found in Python 3.5.3: https://github.com/python/cpython/blob/v3.5.3/Lib/distutils/filelist.py#L245-L273 Finally, simply using ``sys.version_info <= (3, 4, 6)`` would not work because ``sys.version_info`` returns a tuple like ``(3, 4, 6, 'final', 0)`` which is in fact greater than the other one: ``` >>> (3, 4, 6, 'final', 0) <= (3, 4, 6) False >>> (3, 4, 6, 'final', 0) <= (3, 4, 7) True >>> (3, 4, 6, 'final', 0) <= (3, 4, 6) False >>> (3, 4, 6) <= (3, 4, 6, 'final', 0) True >>> (3, 4, 6) < (3, 4, 6, 'final', 0) True ``` It may be reasonable to revisit the monkey patch check to use ``sys.version_info[:3]`` instead.
Since:
(1) CircleCI automatically adds a symlink from /home/ubuntu/pyradiomics/venv
to /home/ubuntu/virtualenvs/venv-system, (indeed it detects it is a
python project)
(2) the symlink is indeed invalid when "seen" from within the docker
container building the project (because it mount the current folder
into the dockcross/manylinux-x64 image),
(3) distutils available in python 3.4.6 has an issue causing sdist to fail
when it find an invalid symlink (http://bugs.python.org/issue12885)
Setuptools is also failing to monkey patch for that version of python.
A patch has been submitted upstream: pypa/setuptools#971
To workaround the issue, we simply remove the symbolic link and avoid the
problem completely.
…ptools issue
Since:
(1) CircleCI automatically adds a symlink from /home/ubuntu/pyradiomics/venv
to /home/ubuntu/virtualenvs/venv-system, (indeed it detects it is a
python project)
(2) the symlink is indeed invalid when "seen" from within the docker
container building the project (because it mount the current folder
into the dockcross/manylinux-x64 image),
(3) distutils available in python 3.4.6 has an issue causing sdist to fail
when it find an invalid symlink (http://bugs.python.org/issue12885)
Setuptools is also failing to monkey patch for that version of python.
A patch has been submitted upstream: pypa/setuptools#971
To workaround the issue, we simply remove the symbolic link and avoid the
problem completely.
|
Aha. That issue probably arose because I originally intended for the changes to be present in 3.4.6, but then backed them out when I realized I'd violated the configuration management policy. The right fix is just to make that a |
|
Thanks for fix the issue 👍 Out of curiosity, is there any files where you acknowledge contributors ? |
|
Not a file. I hate duplicating metadata in source. Contributions are apparent from the commit graph and tracker (here). |
|
Makes sense. (Having spent quite some time to track this down ... I was then hoping to fix my PR and make it to the contributor graph 😄 . Next time.) |
|
Indeed, and I usually pull in the changes and overwrite them (as necessary). This change seemed small and trivial, hence the route I took. For sure next time! |
Since the latest version of python 3.4.x series is 3.4.6 and it
does not include an fixed version of "distutils.filelist.findall",
this commit makes sure the patch is also applied.
For sake of comparison, this link highlights the "still broken"
implementation associated with v3.4.6:
https://github.com/python/cpython/blob/v3.4.6/Lib/distutils/filelist.py#L245-L273
And this link highlights the correct version found in Python 3.5.3:
https://github.com/python/cpython/blob/v3.5.3/Lib/distutils/filelist.py#L245-L273
Finally, simply using
sys.version_info <= (3, 4, 6)would not work becausesys.version_inforeturns a tuple like(3, 4, 6, 'final', 0)which is infact greater than the other one:
It may be reasonable to revisit the monkey patch check to use
sys.version_info[:3]instead.