I give their decision a week before they revert and come up with an alternative.
I give their decision a week before they revert and come up with an alternative.
Also they aren't withdrawing pip from being available for python 2. You just use the older version of pip. Programs that need pips newer features won't install on python 2 anyway. Because it's really going away very quickly now.
This is a good example of what I was talking about. Python 2.x isn’t “going away very quickly now.”
(AIR isn't an interesting solution for a big chunk of apps, but there's lots where moving out of the browser is fine)
Perl 7 finally is going to break this compatibility, at least according to the current plan, but the "porting" still is supposed to be trivial, in most cases just adding a pragma or two. 27 years after Perl 5 was released...
But the Python communities I've interacted with seem to care deeply about the ecosystem, updated libraries, new features. Web apps, data science, etc. Is my experience here warped? Are there people here seeing Python get used for the kind of stuff that might live as long as Cobol without moving forward with the language?
A tool is a tool. When I bought a new drill I used it to put together the playhouse for my kids rather than tearing down my fence just so I could put it back together.
More likely, enterprise vendors like Red Hat will maintain Python 2 + pip for a long time.
The upstream project has no reason to do so and made the right decision to stop supporting legacy stuff.
There is also a straightforward way of "compiling" your code - install all your dependencies into a virtualenv, tar up that virtualenv, and untar it to the same path on the next system. I've seen this system used to work around pip and Python upgrade complexities that already exist, even within Python 2 alone, and it works fine. Then you're insulated from both changes to pip and changes to the actual packages you're trying to install from pip.
Edit to answer your question because someone downvoted me and now HN is preventing me from replying: I don't think you'll need to do anything special. The common case, honestly, is that you already have some version of pip shipped with your system (e.g., you're using Python and pip from your OS) - just keep using that version, because by definition it's a Python 2-compatible pip. The official Python 2 binaries bundle a version of pip which is also by definition Python 2-compatible.
If you need to upgrade pip for some reason, you might need to specify a version constraint on it, e.g.
pip install -U 'pip<21'
But you also might not, because there's a way for packages to declare what Python versions they're compatible with, and so pip can take that into account when deciding what to resolve. (The trouble is that very old versions of pip, such as those bundled with LTS-age OSes, don't know how to do that, so they're going to try to upgrade to the newest possible version of pip. Less-old versions of pip running on Python 2 should, I believe, not upgrade to an incompatible version.)I get expecting that everyone will do this on their own, I just don’t think it will happen that way.
In addition, paid extended support for Python 2.7 already exists from 3rd party vendors (I know of ActivePython) - Python 2 EOL just means you don't get free updates and supports.
For those cases you will want to make sure you have a local mirror.
pip and the legacy easy_install both access the "simple" list for a package when determining download options. This is a basic HTML page with links to all public versions of a package. Here's pip's: https://pypi.org/simple/pip/
These links contain Python version specifier information, which pip can use to select an appropriate version. For pip 21.0, that specifier is ">=3.6", so any modern pip will know it can't be used on a Python prior to 3.6. It will therefore fall back to the nearest version that provides a compatible specifier.
Looks like this was implemented starting in Pip 9.0 (at the end of 2016). From experience (my product is written in Python), there are plenty of enterprise installs that still use much older versions of pip than this. Those will grab pip 21.0 or newer (I just confirmed with a copy of pip 8).
I know for us, that'll be important to document. We still support Python 2.7 in part due to slow-moving enterprise installs, and I'm sure we're not alone in that. So geofft's example for forcing installs to <21 is exactly what a not-insignificant number of people will ultimately need to do.
But I don't think that they will. Who is going to make them?
If they go down, it will be a really major headache.
It's theoretically possible that the API used could change in a way that old versions of pip can't handle, but a) the API is super simple and there isn't a strong reason to do this and b) doing that would break the ability of old versions of pip to upgrade themselves - that is, for released versions of Python with bundled pip to work - so they're very unlikely to break the existing interface, even if they add a new one.
Still, since PyPI is a free service with no support contracts, and especially because packages hosted on PyPI are uploaded by the individual volunteer authors who have the ability to delete old versions of their own packages, businesses who depend on Python 2 would be well-advised to download/mirror what they need locally to ensure continuity of business.
No, they won't.
> The error here is you think the people doing this even have programmers to port to 3.x or admins with the wherewithal to make sure an older version of pip is used.
What wherewithal does that take? PyPI will just provide the last version of pip that supports Python 2. It takes no extra effort to not install a Python 3 version of pip on Python 2.
> Nobody wants to keep Python 2.x in use or force the Pip maintainers to keep 2.x support.
I'm sure there are people who do want to do the former. And they can, but it has no bearing on the latter.
Because the bundled pip with Python 2 is py2 compatible, and upgrading it from pyPI will get the last version that supports py2.
If you are using distro packages, no distro that packages py2 is going to package anything but a py2-compatible pip tied to it.
All this means is that there will be no new versions of pip for py2.
Distros providing pip2 as part of their LTS will probably backport such changes.
1. Trivial or easy. Probably started using best 2/3 compatibility practices easily on, or the nature of the code lends itself to 2to3.
2. Not able to switch without effort, but able to be slowly ported to 2/3 with six and the like.
3. Hopelessly intractable. Either too much bad practices in string handling, or tied to a legacy system. No way to port it without risking subtle bugs. Usually this is due to playing fast and loose with string types, even though we have known better since well before python 3.