pypa / get-pip

Helper scripts to install pip, in a Python installation that doesn't have it.
https://bootstrap.pypa.io/pip/
MIT License
738 stars 293 forks source link

Drop run-time version constraints for modern pip #211

Open edmorley opened 5 months ago

edmorley commented 5 months ago

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 commented 4 months ago

@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 commented 3 months ago

Gentle two month nudge for review :-)

pradyunsg commented 2 months ago

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 commented 2 months ago

@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): https://github.com/pypa/get-pip/pull/212

edmorley commented 2 months ago

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

edmorley commented 2 weeks ago

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

edmorley commented 1 week ago

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