diff --git a/.github/workflows/ci_tests.yaml b/.github/workflows/ci_tests.yaml index 375a0a77904..b843210d0bd 100644 --- a/.github/workflows/ci_tests.yaml +++ b/.github/workflows/ci_tests.yaml @@ -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' 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/codecov-action@v1.2.2 with: file: ./coverage.xml # optional - env_vars: OS,PYTHON + env_vars: OS,PYTHON,NUMPY fail_ci_if_error: false diff --git a/MAINTENANCE.md b/MAINTENANCE.md index 9ccd9f4779b..d634044916f 100644 --- a/MAINTENANCE.md +++ b/MAINTENANCE.md @@ -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. + + ## Making a Release We try to automate the release process as much as possible. diff --git a/README.rst b/README.rst index 7cf54a3bab0..253a367b873 100644 --- a/README.rst +++ b/README.rst @@ -229,14 +229,15 @@ Documentation for other versions * `v0.1.0 `__ * `v0.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 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 -======= ========== ========= +======= ========== ========= ========= diff --git a/doc/install.rst b/doc/install.rst index 83587515034..b3a000b1143 100644 --- a/doc/install.rst +++ b/doc/install.rst @@ -46,8 +46,7 @@ Start by looking at the tutorials on our sidebar, good luck! Which Python? ------------- -PyGMT is tested to run on **Python 3.7 or greater**. Older Python versions may -work, but there is no guarantee that PyGMT will behave as expected. +PyGMT is tested to run on **Python 3.7 or greater**. We recommend using the `Anaconda `__ Python distribution to ensure you have all dependencies installed and the @@ -79,19 +78,17 @@ We recommend following the instructions further on to install GMT 6. Dependencies ------------ -PyGMT requires the following libraries: +PyGMT requires the following libraries to be installed: -* `numpy `__ -* `pandas `__ -* `xarray `__ -* `netCDF4 `__ -* `packaging `__ +* `numpy `__ (>= 1.17) +* `pandas `__ +* `xarray `__ +* `netCDF4 `__ +* `packaging `__ The following are optional (but recommended) dependencies: -* `IPython `__: For embedding the figures in Jupyter - notebooks. - +* `IPython `__: For embedding the figures in Jupyter notebooks. Installing GMT and other dependencies ------------------------------------- diff --git a/environment.yml b/environment.yml index 7c6b91a86d5..6942d6897f0 100644 --- a/environment.yml +++ b/environment.yml @@ -6,7 +6,7 @@ dependencies: # Required dependencies - pip - gmt=6.1.1 - - numpy + - numpy>=1.17 - pandas - xarray - netCDF4 diff --git a/requirements.txt b/requirements.txt index ffdf6724f8e..8f5a7863bf8 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,5 +1,5 @@ # Required packages -numpy +numpy>=1.17 pandas xarray netCDF4 diff --git a/setup.py b/setup.py index 45685e36ada..aacf552047a 100644 --- a/setup.py +++ b/setup.py @@ -30,10 +30,11 @@ "Programming Language :: Python :: 3.7", "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", - "License :: OSI Approved :: {}".format(LICENSE), + f"License :: OSI Approved :: {LICENSE}", ] PLATFORMS = "Any" -INSTALL_REQUIRES = ["numpy", "pandas", "xarray", "netCDF4", "packaging"] +PYTHON_REQUIRES = ">=3.7" +INSTALL_REQUIRES = ["numpy>=1.17", "pandas", "xarray", "netCDF4", "packaging"] # Configuration for setuptools-scm SETUP_REQUIRES = ["setuptools_scm"] USE_SCM_VERSION = {"local_scheme": "node-and-date", "fallback_version": "unknown"} @@ -57,6 +58,7 @@ package_data=PACKAGE_DATA, classifiers=CLASSIFIERS, keywords=KEYWORDS, + python_requires=PYTHON_REQUIRES, install_requires=INSTALL_REQUIRES, setup_requires=SETUP_REQUIRES, )