-
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
NEP29: Set minimum required versions to NumPy 1.17+ and Python 3.7+ #1074
Changes from all commits
78c3d2a
9e641c2
fcb6bad
5919ef8
06b0022
1205006
2d293bb
dd8863d
a8355b5
69823ba
20d83c2
5239c7a
5e903af
ed32c5b
2510e56
7ee4b77
5db0bfc
376b41d
52fdcb7
1016331
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -25,12 +25,12 @@ on: | |
|
||
jobs: | ||
test: | ||
name: ${{ matrix.os }} - Python ${{ matrix.python-version }} | ||
name: ${{ matrix.os }} - Python ${{ matrix.python-version }} / NumPy ${{ matrix.numpy-version }} | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
python-version: [3.7, 3.8, 3.9] | ||
python-version: [3.7, 3.9] | ||
os: [ubuntu-latest, macOS-latest, windows-latest] | ||
# Is it a draft Pull Request (true or false)? | ||
isDraft: | ||
|
@@ -41,20 +41,24 @@ jobs: | |
isDraft: true | ||
- os: windows-latest | ||
isDraft: true | ||
- os: ubuntu-latest | ||
python-version: 3.7 | ||
isDraft: true | ||
- os: ubuntu-latest | ||
python-version: 3.8 | ||
isDraft: true | ||
# - os: ubuntu-latest | ||
# python-version: 3.7 | ||
# isDraft: true | ||
# Pair Python 3.7 with NumPy 1.17 and Python 3.9 with NumPy 1.20 | ||
include: | ||
- python-version: 3.7 | ||
numpy-version: '1.17' | ||
- python-version: 3.9 | ||
numpy-version: '1.20' | ||
Comment on lines
+47
to
+52
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The NumPy versions are paired with Python versions here using 'environment variables' according to https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions#using-environment-variables-in-a-matrix. |
||
defaults: | ||
run: | ||
shell: bash -l {0} | ||
|
||
# environmental variables used in coverage | ||
# Environment variables used by codecov | ||
env: | ||
OS: ${{ matrix.os }} | ||
PYTHON: ${{ matrix.python-version }} | ||
NUMPY: ${{ matrix.numpy-version }} | ||
|
||
steps: | ||
# Cancel previous runs that are not completed | ||
|
@@ -82,7 +86,8 @@ jobs: | |
# Install GMT and other required dependencies from conda-forge | ||
- name: Install dependencies | ||
run: | | ||
conda install gmt=6.1.1 numpy pandas xarray netCDF4 packaging \ | ||
conda install gmt=6.1.1 numpy=${{ matrix.numpy-version }} \ | ||
pandas xarray netCDF4 packaging \ | ||
codecov coverage[toml] dvc ipython make \ | ||
pytest-cov pytest-mpl pytest>=6.0 \ | ||
sphinx-gallery | ||
|
@@ -138,5 +143,5 @@ jobs: | |
uses: codecov/[email protected] | ||
with: | ||
file: ./coverage.xml # optional | ||
env_vars: OS,PYTHON | ||
env_vars: OS,PYTHON,NUMPY | ||
fail_ci_if_error: false |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,6 +12,7 @@ If you want to make a contribution to the project, see the | |
* [Reviewing and Merging Pull Requests](#reviewing-and-merging-pull-requests) | ||
* [Continuous Integration](#continuous-integration) | ||
* [Continuous Documentation](#continuous-documentation) | ||
* [Dependencies Policy](#dependencies-policy) | ||
* [Making a Release](#making-a-release) | ||
- [Updating the Changelog](#updating-the-changelog) | ||
- [Check the README Syntax](#check-the-readme-syntax) | ||
|
@@ -77,8 +78,9 @@ There are 9 configuration files located in `.github/workflows`: | |
|
||
This is run on every commit to the *master* and Pull Request branches. | ||
It is also scheduled to run daily on the *master* branch. | ||
In draft Pull Requests, only one job (Linux + Python latest) | ||
is triggered to save on Continuous Integration resources. | ||
In draft Pull Requests, only two jobs on Linux (minimum NEP29 Python/NumPy versions | ||
and latest Python/NumPy versions) are triggered to save on Continuous Integration | ||
resources. | ||
|
||
3. `ci_docs.yml` (Build documentation on Linux/macOS/Windows) | ||
|
||
|
@@ -135,6 +137,22 @@ The actual script `package.json` is used by Vercel to install the necessary pack | |
build the documentation, copy the files to a 'public' folder and deploy that to the web, | ||
see https://vercel.com/docs/build-step. | ||
|
||
|
||
## Dependencies Policy | ||
|
||
PyGMT has adopted [NEP29](https://numpy.org/neps/nep-0029-deprecation_policy) | ||
alongside the rest of the Scientific Python ecosystem, and therefore supports: | ||
|
||
* All minor versions of Python released 42 months prior to the project, | ||
and at minimum the two latest minor versions. | ||
* All minor versions of NumPy released in the 24 months prior to the project, | ||
and at minimum the last three minor versions. | ||
|
||
In `setup.py`, the `python_requires` variable should be set to the minimum | ||
supported version of Python. Minimum Python and NumPy version support should be | ||
adjusted upward on every major and minor release, but never on a patch release. | ||
Comment on lines
+151
to
+153
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I didn't add the line "All supported minor versions of Python should be in the test matrix and have binary artifacts built for the release." as in https://numpy.org/neps/nep-0029-deprecation_policy#implementation because:
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Sounds good to me. |
||
|
||
|
||
## Making a Release | ||
|
||
We try to automate the release process as much as possible. | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -229,14 +229,15 @@ Documentation for other versions | |
* `v0.1.0 <https://www.pygmt.org/v0.1.0>`__ | ||
* `v0.0.1a0 <https://www.pygmt.org/0.0.1a0>`__ | ||
|
||
Compatibility with Python and GMT versions | ||
------------------------------------------ | ||
Compatibility with GMT and Python/NumPy versions | ||
------------------------------------------------ | ||
|
||
======= ========== ========= | ||
PyGMT GMT Python | ||
======= ========== ========= | ||
======= ========== ========= ========= | ||
PyGMT GMT Python NumPy | ||
======= ========== ========= ========= | ||
0.4.x >=6.2.0 >=3.7 >=1.17.0 | ||
Comment on lines
+232
to
+238
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is it a good idea to add this here now, or should we do it during the v0.4.0 release process instead? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We should add it when we release v0.4.0, but I'm afraid we may forget it during the release process. I think it's fine to add this here. |
||
0.3.x >=6.1.1 >=3.7 | ||
0.2.1 >=6.1.1 >=3.6 | ||
0.2.0 >=6.1.1 3.6 - 3.8 | ||
0.1.x >=6.0.0 3.6 - 3.8 | ||
======= ========== ========= | ||
======= ========== ========= ========= |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
# Required packages | ||
numpy | ||
numpy>=1.17 | ||
pandas | ||
xarray | ||
netCDF4 | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For some reason, these lines can't be uncommented so that only one workflow (Ubuntu - Py3.9) runs. It fails with
Error when evaluating 'runs-on' for job 'test'. (Line: 29, Col: 14): Unexpected value ''
(see e.g. https://github.com/GenericMappingTools/pygmt/actions/runs/663292971), though that Line 29 appears totally unrelated.Might have something to do with the 'include:' lines below? But maybe that's ok, we could just run 2 Linux tests (Python 3.7/NumPy 1.17 and Python 3.9/NumPy 1.20) in draft mode (i.e. +1 extra test compared to #906).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tried to solve the problem but failed. Two Linux jobs are OK to me.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah it's a tricky problem 😅 I'll leave it as it is and revise the MAINTENANCE.md docs to mention that two jobs are run instead of just one. Edit: done at 2510e56