get-pip icon indicating copy to clipboard operation
get-pip copied to clipboard

Drop run-time version constraints for modern pip

Open edmorley opened this issue 10 months ago • 7 comments

Modern Pip (v9.0.0+) supports Requires-Python and so automatically takes the current Python version into account, when determining the latest version of packages that can be installed.

As such, for modern Pip we don't need to specify version range constraints for the pip/setuptools/wheel versions passed to the pip install at get-pip.py run-time.

This is the first step towards being able to remove SCRIPT_CONSTRAINTS and rely purely on Requires-Python metadata, per: https://github.com/pypa/get-pip/issues/88#issuecomment-798966926

I've intentionally left the "figure out what Pip version to embed in the template" part of template generation alone for now to keep the PR smaller, and have only changed the run-time pip install parts.

I had to add a new pre-9.py template file (created as a copy of pre-10.py), since it's only pip<9 that needs the various version constraint references in the template (and otherwise anything else that used pre-10.py, such as Python 2.6, would have had redundant version constraints). The new pre-9.py template is only used for Python 3.2.

edmorley avatar Apr 14 '24 20:04 edmorley