News for hackers. Stuff that matters.
Re:Pip has dropped support for Python 2 by dmitryminkovsky on Saturday January 23, 2021 @11:05PM (#25889102)
I don't understand: why can't people just use the last version of Pip that supports Python 2?
Re:Pip has dropped support for Python 2 by zzzeek on Saturday January 23, 2021 @11:35PM (#25889293)
They can, the people here acting like pip is banned from python 2 don't seem to understand much about python or software.
Re:Pip has dropped support for Python 2 by ianhanschen on Sunday January 24, 2021 @12:02AM (#25889442)
edit: wrongness
Re:Pip has dropped support for Python 2 by dragonwriter on Sunday January 24, 2021 @12:07AM (#25889470)
> New deployments will break once pip is updated.

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.

Re:Pip has dropped support for Python 2 by ianhanschen on Sunday January 24, 2021 @12:16AM (#25889508)
Why won’t new deployments break? If they are using ‘pip’ to install 2.x libraries, my understanding is it will now fail.
Re:Pip has dropped support for Python 2 by dragonwriter on Sunday January 24, 2021 @12:51AM (#25889672)
> Why won’t new deployments break?

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.

Re:Pip has dropped support for Python 2 by _flux on Sunday January 24, 2021 @01:54AM (#25889928)
But then at some point a breaking change in the backing service could be introduced, thus breaking pip2.

Distros providing pip2 as part of their LTS will probably backport such changes.

Re:Pip has dropped support for Python 2 by dragonwriter on Sunday January 24, 2021 @10:36AM (#25892846)
Well, yes, it's possible some future change to pyPI could break pip, but that would also break all versions of pip before the change, so there'd have to be a large transition window (because pyPI is how you update pip, too, so if you break existing clients, no one can get the upgrade to the version that supports the backend changes), so that's not going to be sudden and without warning.
Re:Pip has dropped support for Python 2 by ianhanschen on Sunday January 24, 2021 @01:51AM (#25889922)
Thanks!
Re:Pip has dropped support for Python 2 by Izkata on Sunday January 24, 2021 @04:31AM (#25890636)
Hell, several of our projects are stuck on pip 9 because our requirements files have dependency conflicts that 10+ choke on, but 9 installs the right combination of.
Re:Pip has dropped support for Python 2 by Wowfunhappy on Saturday January 23, 2021 @11:07PM (#25889113)
I guess the question is whether the servers will stay up. I was assuming they would not.

If they go down, it will be a really major headache.

Re:Pip has dropped support for Python 2 by dmitryminkovsky on Saturday January 23, 2021 @11:11PM (#25889143)
My understanding is that Pip uses PyPI so, yeah, if PyPI changes their APIs/URLs, this last version of Pip that supports Python 2 will stop working and then deployments will start breaking.
Re:Pip has dropped support for Python 2 by zzzeek on Saturday January 23, 2021 @11:36PM (#25889307)
You can point pip to whatever URL you want, and APIs use versioning.
Re:Pip has dropped support for Python 2 by geofft on Saturday January 23, 2021 @11:38PM (#25889319)
There isn't a separate set of servers. The same servers (https://pypi.org) are used for all Python versions, and they keep old versions of packages around. If everything works as it should (which, to be fair, it might not :) ), pip running on Python 2 ought to find the latest Python 2-compatible version of packages, including the latest Python 2-compatible version if itself if you ask it to upgrade itself.

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.

Re:Pip has dropped support for Python 2 by bobsmooth on Sunday January 24, 2021 @01:13AM (#25889780)
Better question, why can't people update their scripts to python 3? Is it that much of a chore? Genuine question, I've only ever used 3.
Re:Pip has dropped support for Python 2 by kortex on Sunday January 24, 2021 @12:23PM (#25893762)
I've found 3 broad classes of code bases when migrating:

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.