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 4 times, most recently from 64d90fd to ea6890a Compare June 27, 2024 12:51
@edmorley
Copy link
Contributor Author

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

@pradyunsg pradyunsg changed the title Drop run-time version constraints for modern Pip Drop run-time version constraints for modern pip Jul 29, 2024
@edmorley edmorley force-pushed the drop-version-constraints branch 2 times, most recently from e01592c to a2eb69d Compare August 26, 2024 19:08
@edmorley
Copy link
Contributor Author

I've rebased this on main after the recent merge.

@edmorley
Copy link
Contributor Author

edmorley commented Sep 7, 2024

I don't suppose someone has a moment to review? :-)

@edmorley
Copy link
Contributor Author

Rebased again.

Could someone review? :-)

(This PR has been open for 6 months)

@pradyunsg
Copy link
Member

@sbidoul Any concerns with landing this? If you don't have any concerns related to 24.3, let's land this now?

@sbidoul
Copy link
Member

sbidoul commented Oct 28, 2024

@pradyunsg I can't say I looked in details to understand all the implications of this, but if it looks good to you and if @edmorley is around to help in case of problem with the next pip release (which could be soon depending on the conclusion of pypa/pip#13053), then feel free to merge ;)

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.
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.

3 participants