-
Notifications
You must be signed in to change notification settings - Fork 224
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
Adopt NEP29 - drop support for Python 3.6 and NumPy 1.16 #690
Comments
As per the comment in #665 (comment), we should strictly follow semantic versioning. As we definitely will add new features in the next few weeks/months, the next release will be v0.3.0, and we can drop the Python 3.6 support now. In v0.4.0, we will bump the minimum required GMT version to 6.2.0. |
@seisman that depends also on how much work it is to maintain 3.6 support. For 3.5, it was a bit annoying since a lot of |
We recently had a sudden failure for Windows + Python 3.6 (see #693 and some debugging efforts in #694). I guess something wrong with the conda-forge's Windows builds, but it only happens to Python 3.6. It would be difficult to track down the cause. That's one of the reasons I'd like to drop Python 3.6 support soon. |
A bit of a tangent, but is there a chance we could setup PyGMT to be no-arch (https://www.anaconda.com/blog/condas-new-noarch-packages) like
|
It looks promising.
Dropping Python 3.6 (or any other old Python versions) means that we don't have to run CI jobs for old Python versions, and we can use some new Python features which are only available in new Python versions. So we still need to adopt NEP29 or less aggressive. |
Ok, PR for noarch Python conda packages is at conda-forge/pygmt-feedstock#13 (generated by conda-forge bot), it looks pretty slick! |
That's reason enough for me 🙂 And +1 to the noarch thing. Makes the conda-forge builds a lot faster. |
Ok, the noarch conda-forge PyGMT v0.2.1 package is up, and this should work on Python 3.6-3.9 (theoretically on 3.10 too but I haven't tested). I think we can drop Python 3.6 from our CI (the less aggressive option) now, and decide whether or not we should adopt NEP29 closer to PyGMT v0.3.0's release in a month or two (the aggressive option, i.e. Python 3.6 would just not work at all). |
I agree!
How does it work? If we bump the minimum required Python version to 3.7 in setup.py and the conda-forge recipe. What will happen if a Python 3.6 user installs pygmt? |
I tried to install pygmt under Python 3.5:
The command installs pygmt v0.2.1 successfully (with some warnings/errors with netcdf4). But when I >>> import pygmt
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/Users/seisman/.anaconda/envs/pygmtold/lib/python3.5/site-packages/pygmt/__init__.py", line 123
print(f" version: {__version__}")
^
SyntaxError: invalid syntax As for
|
The For the |
That makes sense. I once thought these lines define the minimum supported Python version. Lines 31 to 34 in 7e7da78
Then I'm in favor of the less aggressive option. We only test Python 3.7-3.9, but allow users run pygmt in old Python versions, although there is no guarantee that pygmt will work as expected. |
Can we close the issue? |
Should have mentioned this earlier. NEP29 implementation also requires that we set a minimum There's a new PyPI package called |
But we're not testing old numpy versions, so how can we know if PyGMT works with numpy 1.15? |
First question is: Do we want to adopt NEP29? If so, then there's a few things we'll need to do.
One way is to split our CI into two:
This is inspired by Optionally, we could drop the middle (Python 3.8 + NumPy 1.17) check to save on resources, and have a 'bleeding' edge CI check (Python 3.10+ NumPy 1.20 + GMT Latest) so we're aware of any upstream changes. Again, we don't have to adopt NEP29 straightaway, but it's worth having a think about it. |
Is it too much burden for us? |
Ok, some time has passed, and we should now be supporting Python 3.7+ and Numpy 1.17+ only as per NEP29.
I think we should do this. It should be relatively straightforward to set the desired numpy version to install after #1033. Currently we have 9 builds in total (3 Python versions x 3 Operating Systems). If we drop the middle Python version, that would save even more CI resources (always feel bad about using up so many CPU cycles!). Specifically we will only need to test (as of March 2021):
I'll work on this NEP29 adoption in the next few hours, should get this sorted for the next PyGMT v0.4.0 release |
Originally posted at #644 (comment), but updated slightly
Just bringing up the topic of whether we should follow NEP 29 — Recommend Python and Numpy version support as a community policy standard as noted before in #340 (comment). This would mean dropping support for Python 3.6.
In practice, we'll need to follow in the footsteps of our dependent packages:
Some options we can take are:
It will be quite hard to support four minor versions of Python (3.6, 3.7, 3.8, 3.9), especially for the
conda
packages where there is a separate build for each one (unless we can work out how to get a 'noarch' build). We could still allowpip install pygmt
Python 3.6 (with no support guarantees, i.e. no CI checks), but it will become a maintenance burden when our dependency packages (numpy, pandas, xarray) move on.There's no rush to do all this, since Python 3.9 is just released, and there are some libraries still to catch up. Even matplotlib (who has more maintainers) is dropping Python 3.6 for their v3.4 (see matplotlib/matplotlib#17662) so it's worth thinking about following NEP 29 for PyGMT v0.3.0.
Originally posted by @weiji14 in #644 (comment)
Are you willing to help implement and maintain this feature? Yes
The text was updated successfully, but these errors were encountered: