-
-
Notifications
You must be signed in to change notification settings - Fork 31.9k
[WIP] bpo-42856: Add --with-wheel-pkg-dir=PATH configure option #24151
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
Add --with-wheel-pkg-dir=PATH option to ./configure. If specified, the :mod:`ensurepip` module also looks for wheel packages in this directory, and picks the most recent versions in ensurepip._bundled and the specified directory. Some Linux distribution packaging policies recommand against bundling dependencies. For example, Fedora installs wheel packages in the /usr/share/python-wheels/ directory and don't install the ensurepip._bundled package.
This PR finds wheel packages from multiple directories and picks the most recent version. I'm not sure if it's the best idea: let's discuss that in https://bugs.python.org/issue42856 My current implementation has a regression: it doesn't allow to put ensurepip module in a ZIP archive, it removes the Maybe I should leave the current code unchanged, and only use the directory if it's available. |
# Extract '20.2.3' from '20.2.3-py2.py3-none-any.whl' | ||
version = [] | ||
part = part.split('-', 1)[0] | ||
for part in part.split('.'): | ||
try: | ||
number = int(part) | ||
except ValueError: | ||
break | ||
version.append(number) | ||
if not version: | ||
# failed to parse the version: ignore the package | ||
continue |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This fails to parse rc/beta versions or post versions.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
https://www.python.org/dev/peps/pep-0632/ deprecates distutils.version, so I prefer to avoid it. I am not aware of any alternative in the stdlib: the PEP suggests to use the 3rd party packaging module.
I don't think that we use beta or rc version in ensurepip._bundled version. Is it the case in Fedora?
On Fedora, ensurepip._bundled is not installed, so it doesn't matter in practice :-)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, this only looks into ensurepip._bundled? OK
I wrote PR #24210 which is simpler and more reliable. I close this PR. |
Add --with-wheel-pkg-dir=PATH option to ./configure. If specified,
the :mod:
ensurepip
module also looks for wheel packages in thisdirectory, and picks the most recent versions in ensurepip._bundled
and the specified directory.
Some Linux distribution packaging policies recommand against bundling
dependencies. For example, Fedora installs wheel packages in the
/usr/share/python-wheels/ directory and don't install the
ensurepip._bundled package.
https://bugs.python.org/issue42856