Pip 19.0 is now available!

There is a regression happening for some projects along with workarounds to resolve it, it’s currently being discussed what the right short and long term fixes are. That discussion is trying to determine ways to ensure we catch those regressions before a release in the future.

This is probably best suited to the thread specifically on Python 2 support in Python’s packaging ecosystem, however to respond to a bit of this.

Generally speaking, modern versions of pip will not let you upgrade to a version of a package that does not claim support for the version of Python you’re trying to install into. This is an opt-in feature on the package author’s side, but pip itself does use this feature. The practical impact of this means that even if you try to upgrade to a version of pip that does not support your version of Python, pip itself won’t allow it (unless you’re on a sufficiently old version of pip). This means the upgrade warning for pip itself is, at worst, a misleading nuisance. I’ve gone ahead and opened pypa/pip#6211 which covers making sure that the prompt to upgrade pip only fires if the newer version of pip actually supports the current version of Python being ran.

With regards to the warning about 2.7 itself, that’s a bit in the air currently. We have some people arguing that pip should be aggressive in dropping support for 2.7 as quickly as possible, while others have argued that pip should remain conservative. That discussion is ongoing in the previously linked thread but the warning added to pip 19 represents a sort of middle ground for both of those factions. It doesn’t drop support for 2.7 (yet), but it indicates to people that dropping support for 2.7 is on the horizon for pip, we just don’t know exactly when yet. I wrote that message, so it’s entirely possible the wording is poor and could use improvement. Certainly there is the case of PyPy which has no plans to end-of-life their version of 2.7 where this message is being emitted and causing confusion (see pypa/pip#6207).

Note that in both of these cases, you can personally disable the warning. The first way is to use --disable-pip-version-check (which like all pip options can be specified on the CLI, as an environment variable, or through several config files) which will prevent pip from checking if there is a newer version of itself. The version warning uses the Python warning module, and can be disabled using an environment variable like PYTHONWARNINGS=ignore:Please.upgrade::pip._internal.cli.base_command. That’s not really a great experience for disabling that message, largely because historically we’ve not considered dropping support for versions of Python until they were well on their way to dead so it never really came up as an issue before. There is pypa/pip#6119 about unifying the way our warnings are emitted and providing a generic way to silence specific warnings (ala flake8 style IDs).

It’s incredibly unlikely that 2.7 stops working as you’ve described. For the client side of the equation (pip, setuptools, etc) you’ll be stuck on whatever the last version of those tools to support 2.7 was, but as the end user you have complete control over those. The only part you don’t really have complete control over is PyPI itself, which will effectively never drop support for 2.7, because PyPI doesn’t treat 2.7 any differently than 3.7, it’s all just opaque files with some metadata attached to it as far as PyPI is concerned. You can still upload Python 2.4 supporting libraries to PyPI and, assuming your toolchain supports it, it’ll still work completely fine.

Just for kicks, I installed the absolute oldest version of pip that was still on PyPI (from 2008!) and it worked just fine on 2.7, with only needing to change the URL it accessed (because we switched URLs during the migration to Warehouse). I don’t see any reason why in 2029 pip 19 wouldn’t still continue to work with PyPI just fine.