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

Declare Python 3.7+ support #212

Merged
merged 6 commits into from
Feb 10, 2022
Merged

Conversation

adamjstewart
Copy link
Collaborator

Since #137, rtree no longer supports Python 2. However, this isn't documented anywhere. This PR explicitly documents that Python 3 is required.

Note: if we add type hints as proposed in #170 the minimum version will likely increase to Python 3.5+.

@hobu
Copy link
Member

hobu commented Feb 5, 2022

Since #137, rtree no longer supports Python 2. However, this isn't documented anywhere. This PR explicitly documents that Python 3 is required.

Note: if we add type hints as proposed in #170 the minimum version will likely increase to Python 3.5+.

I would think 3.6+ would have to be fine at this point.

@adamjstewart
Copy link
Collaborator Author

Up to you. It can either be 1) the minimum Python version that provides all the language features you use, or 2) the minimum Python version that you actually test, or 3) somewhere in-between. Same for libspatialindex. 3.6 is also EOL now, and many libraries like numpy only support 3.8+.

@mwtoews
Copy link
Member

mwtoews commented Feb 6, 2022

My preferred minimum is also py36, which is under some support by (e.g.) Ubuntu 18.04 for at least another year.

@hobu
Copy link
Member

hobu commented Feb 6, 2022

Let's point the docs at https://numpy.org/neps/nep-0029-deprecation_policy.html for our Python deprecation policy.

Rtree releases are about at most once-per year.

@adamjstewart
Copy link
Collaborator Author

I actually personally disagree with numpy's Python deprecation policy (3.8+). My own project sticks to PyTorch's Python support timeline (3.6+) but if I didn't have to worry about dependencies I would either support all versions of Python that I can test in CI or stick to the Python EOL timeline (3.7+). I think numpy deprecates too early even though they don't need new Python language features.

So my personal recommendation would be 3+ if you aren't using any new language features, 3.5+ if you're planning on adding type hints, or 3.7+ if you don't want to support EOL Python.

@hobu
Copy link
Member

hobu commented Feb 6, 2022

Let's go 3.5+ then. If you are willing to make a PR that adds type hints, people would find them very useful.

@adamjstewart
Copy link
Collaborator Author

adamjstewart commented Feb 6, 2022

I am very interested in adding type hints but it might be on a case by case basis. For functions with good docstrings that document parameter and return type it will be really easy. For undocumented functions whose purpose I don't understand I won't be of much help. Not sure when I'll have time to get to this but hopefully in the near future.

@adamjstewart
Copy link
Collaborator Author

Okay, I set the minimum supported Python version to 3.5. I also increased the number of Python versions that are tested in CI and that wheels are generated for. Let me know if you want me to undo that last change.

@adamjstewart adamjstewart changed the title Declare Python 3-only support Declare Python 3.5+ support Feb 6, 2022
@adamjstewart
Copy link
Collaborator Author

It looks like the Windows tests are failing for older versions of Python. Is this a known issue or can we solve it or should I skip these failing tests?

@hobu
Copy link
Member

hobu commented Feb 7, 2022

I don't think it is worth trying to keep 3.5 around. I'm not sure what the specific issue is, but presumably it is in how ctypes resolves DLLs.

@adamjstewart
Copy link
Collaborator Author

It looks like the issue also hits Python 3.6. Should we bump to 3.7+ for all platforms or only for Windows?

@hobu
Copy link
Member

hobu commented Feb 7, 2022

Should we bump to 3.7+ for all platforms

This would be preferable for me. In our next release in a year, no one is going to care about 3.5 or 3.6 if they even care right now.

@adamjstewart adamjstewart changed the title Declare Python 3.5+ support Declare Python 3.7+ support Feb 7, 2022
@adamjstewart
Copy link
Collaborator Author

Windows tests are happy again. Not sure why docs tests are failing. I'm explicitly installing Python 3.10 but later steps are still using Python 3.6.

@adamjstewart
Copy link
Collaborator Author

In TorchGeo, we use ReadTheDocs CI instead of GitHub Actions to ensure that the docs build without any warnings/errors. This also has the benefit that you can directly view the docs that would result from a PR being merged. That's also an option here, although I would love to get to the bottom of why these tests are failing.

@hobu
Copy link
Member

hobu commented Feb 8, 2022

The issue with the docs is the docker container we use osgeo/proj-docs has Python 3.6. RTD would be fine with me.

@mwtoews
Copy link
Member

mwtoews commented Feb 8, 2022

See OSGeo/PROJ#3043 to get Python 3.8 in the container

@adamjstewart
Copy link
Collaborator Author

@mwtoews so once that PR is merged, the container will use Python 3.8? I'll still probably get started on switching the CI to RtD while waiting for that, it's a good idea anyway.

@mwtoews
Copy link
Member

mwtoews commented Feb 8, 2022

Some manual steps are required for the docker image to be updated. I don't have any direct control in this process. Nevertheless, RTD is a great option!

@hobu
Copy link
Member

hobu commented Feb 9, 2022

osgeo/proj-docs docker container has been updated. bouncing this to try to trigger a rebuild.

@hobu hobu closed this Feb 9, 2022
@hobu hobu reopened this Feb 9, 2022
@adamjstewart
Copy link
Collaborator Author

Looks like the tests are passing now, thanks @mwtoews!

Copy link
Member

@mwtoews mwtoews left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

@hobu hobu merged commit 97936ea into Toblerity:master Feb 10, 2022
@hobu hobu added this to the 1.0.0 milestone Feb 10, 2022
@adamjstewart adamjstewart deleted the docs/python3 branch February 10, 2022 16:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants