-
-
Notifications
You must be signed in to change notification settings - Fork 22
Should we drop Python 2.7 support? #147
Comments
We should drop 2.7 and 3.5 IMO. 3.5 usage is dwindling even now. |
So I think the main reason to consider supporting py2 is not in your list, and that's to ease adoption for projects that will be stuck supporting py2 indefinitely. I'm not convinced this is a good reason either, but let's at least think about it. I'm thinking of projects like pip, botocore, docker-py, etc. These are major, extremely widely used projects that currently use urllib3. They would like to have async support. But they're not even considering dropping py2 support yet, because, you know, enterprise. So it might be significantly easier for them to adopt hip if they can use it on py2 as well, and maybe that's the difference between them adding async support in our lifetimes, or not. If the bargain was that botocore will get native trio/asyncio support if and only if we keep supporting py2 in hip, then I would say let's hold our nose and support py2. Also, if the bargain was that hip supporting py2 -> more folks switch away from urllib3 -> we get to stop supporting legacy urllib3 sooner, that might also be worth it. I'm not sure that's actually how it will work though :-). Some reasons it might be wrong:
|
Thanks! I think we can continue as we've done before, and keep Python 2.7 unless it costs us too much. For example, it might make things to hard when testing on multiple backends. |
Here's a thought from me: can we drop Python <2.7.9? I'm actually considering doing this for upstream urllib3 as well because it's both insecure (because it depends on pyOpenSSL which is a pile of hacks and doesn't work on macOS), very EOL, and it means we can depend on a proper SSLContext being available so we don't have to have all the work-arounds and test three separate TLS backends (it'd be only two instead 🎉). It's a good amount of work to make ref: psf/requests#5267 |
Yes, sure, let's do that! I'd be happy to work on a patch for urllib3 first and then merge it from there. |
Would require coordination with Requests / Pip / Boto before we could ship it, especially if we remove |
I already noticed that having a |
@agronholm is it because of the nonlocal keyword? We can use a I don't know if we should keep Python 2 or not as there are good arguments either way, but I think the decision should be taken more globally |
That was the immediate issue, yes. I know we can work around these problems, but the question is: why should we? They WILL be causing bigger problems down the road, and this is time I would personally rather spend writing new features instead. |
When this project was conceived in mid-2017, it was obvious that we needed to support Python 2.7, because:
However, it's now clear that this project won't be urllib3 v2, and we're going to offer a completely different API. We won't offer a stable version soon, and nobody should be starting new Python 2.7 projects.
What is Python 2.7 support costing us? Surprisingly, not much, because it's already here, so it's not a lot of effort to keep the support. Here are possible benefits of dropping Python 2.7:
run_secretly_sync_async_fn
instead for sync supportMy personal conclusion: I think it makes sense to remove Python 2.7 support (and App Engine!) at the same time we stop merging changes directly from urllib3, which should happen real soon now (TM).
The text was updated successfully, but these errors were encountered: