Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Drop support for legacy Python 2 #1237

Closed
wants to merge 6 commits into from
Closed

Drop support for legacy Python 2 #1237

wants to merge 6 commits into from

Conversation

hugovk
Copy link
Contributor

@hugovk hugovk commented Dec 5, 2018

Rationale

Fix #1186.

Implications

People using Python 2 will not be able to use the most recent release of cartopy.

The Python 2 EOL is coming up on 2020-01-01 and many other projects have pledged to drop support on or before that date: http://python3statement.org

Here's the pip installs for cartopy from PyPI for last month, showing Python 2 use is fairly low:

category percent downloads
3.6 43.75% 4,011
2.7 22.87% 2,097
3.5 12.95% 1,187
null 11.19% 1,026
3.7 8.42% 772
3.4 0.69% 63
3.8 0.09% 8
2.6 0.03% 3
3.3 0.01% 1
Total 9,168

Source: pypistats python_minor --last-month cartopy

The addition of python_requires means, with modern pip and setuptools, users will get the last cartopy which did support Python 2.

@SciTools-assistant SciTools-assistant added the Blocked: CLA needed See https://scitools.org.uk. Submit the form at: https://scitools.org.uk/cla/v4/form label Dec 5, 2018
docs/source/sphinxext/plot_directive.py Show resolved Hide resolved
docs/source/sphinxext/plot_directive.py Outdated Show resolved Hide resolved
lib/cartopy/crs.py Outdated Show resolved Hide resolved
lib/cartopy/feature/__init__.py Show resolved Hide resolved
lib/cartopy/io/shapereader.py Outdated Show resolved Hide resolved
lib/cartopy/io/shapereader.py Outdated Show resolved Hide resolved
@pelson
Copy link
Member

pelson commented Dec 5, 2018

This is awesome! We can't merge this until after v0.18 is released though, and I'm really concerned that this PR will go very stale in that time. Hopefully you were able to run this through 2to3 or something and it was all autogenerated?

Do you want to keep this open (in the knowledge it is likely to go stale), or shall we close and re-open once we have cut v0.18? The latter is my preference, but I'm open to either approaches.

@hugovk
Copy link
Contributor Author

hugovk commented Dec 5, 2018

Most of the changes (in the second and third commits) were made using a tool (pyupgrade), so it'll be easy to redo this after 0.18 is out.

I'd probably prefer to keep it open so it's visible and not forgotten, but don't have a strong preference. Do whichever fits you feel is best for this project :)

@pelson
Copy link
Member

pelson commented Dec 6, 2018

In which case I will go ahead and close this. We have the issue to track the problem, and it links directly to this PR so we can easily enough find this again.

Thanks again for doing this - it was useful to see the kinds of things we are going to be able to remove once py2 is dropped, not to mention all of the features we can start to benefit from.

@QuLogic
Copy link
Member

QuLogic commented Apr 27, 2020

Hey, so I forgot about this PR and put in #1516 and #1517, but they do not cover everything that's here. If you want to re-run the tools and put together a new PR, feel free to do so.

@hugovk
Copy link
Contributor Author

hugovk commented Apr 28, 2020

Heh, will do, thanks!

@hugovk
Copy link
Contributor Author

hugovk commented Apr 28, 2020

Please see PR #1540.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Blocked: CLA needed See https://scitools.org.uk. Submit the form at: https://scitools.org.uk/cla/v4/form Component: installation SemVer: minor Type: Enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Dropping legacy python support
5 participants