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

Drop run-time version constraints for modern Pip #211

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

edmorley
Copy link
Contributor

@edmorley edmorley commented Apr 14, 2024

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: #88 (comment)

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 edmorley force-pushed the drop-version-constraints branch 2 times, most recently from f710fdb to 91fca47 Compare April 14, 2024 20:43
@edmorley
Copy link
Contributor Author

@pradyunsg I don't suppose you'd have a spare moment to review? I'd like to open a PR to resolve #200, but it will conflict this this PR, so it would be great to get this PR merged before I do that if possible :-)

@edmorley
Copy link
Contributor Author

Gentle two month nudge for review :-)

@pradyunsg
Copy link
Member

I see this now @edmorley! 🙈

To be honest, I'm unlikely to have free cycles to take a closer look and land this anytime soon (I wanna let #213 get through before coming back around to this, and I go on vacation starting this weekend... which means this will slip past my visual range soon-enough!).

I did take a cursory look now and it LGTM based on that -- but I'd like to take a proper look before landing this. Alternatively, someone else with the commit bit is welcome to land this!

@edmorley
Copy link
Contributor Author

@pradyunsg Totally understand, no worries! I don't suppose we could merge this separate typo fix PR in the meantime (so I can then rebase this PR on top of main after it merges):
#212

@edmorley edmorley force-pushed the drop-version-constraints branch 3 times, most recently from c6be8a0 to 64d90fd Compare June 26, 2024 08:07
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:
pypa#88 (comment)

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
Copy link
Contributor Author

I've rebased on main after the recent PR merges.

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 this pull request may close these issues.

None yet

2 participants