Skip to content

Commit

Permalink
Add support for Python=3.11 (#3173)
Browse files Browse the repository at this point in the history
Co-authored-by: Bouwe Andela <b.andela@esciencecenter.nl>
  • Loading branch information
2 people authored and Javier Vegas-Regidor committed Jan 14, 2024
1 parent 5ea1f0f commit e3b5877
Show file tree
Hide file tree
Showing 13 changed files with 54 additions and 49 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/create-condalock-file.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
with:
auto-update-conda: true
activate-environment: esmvaltool-fromlock
python-version: "3.10"
python-version: "3.11"
miniforge-version: "latest"
miniforge-variant: Mambaforge
use-mamba: true
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/install-from-conda.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ["3.9", "3.10"]
python-version: ["3.9", "3.10", "3.11"]
name: Linux Python ${{ matrix.python-version }}
steps:
- uses: conda-incubator/setup-miniconda@v2
Expand Down Expand Up @@ -55,7 +55,7 @@ jobs:
# runs-on: "macos-latest"
# strategy:
# matrix:
# python-version: ["3.9", "3.10"]
# python-version: ["3.9", "3.10", "3.11"]
# fail-fast: false
# name: OSX Python ${{ matrix.python-version }}
# steps:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/install-from-condalock-file.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
runs-on: "ubuntu-latest"
strategy:
matrix:
python-version: ["3.9", "3.10"]
python-version: ["3.9", "3.10", "3.11"]
fail-fast: false
name: Linux Python ${{ matrix.python-version }}
steps:
Expand Down Expand Up @@ -73,7 +73,7 @@ jobs:
# runs-on: "macos-latest"
# strategy:
# matrix:
# python-version: ["3.9", "3.10"]
# python-version: ["3.9", "3.10", "3.11"]
# fail-fast: false
# name: OSX Python ${{ matrix.python-version }}
# steps:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/install-from-source.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
runs-on: "ubuntu-latest"
strategy:
matrix:
python-version: ["3.9", "3.10"]
python-version: ["3.9", "3.10", "3.11"]
fail-fast: false
name: Linux Python ${{ matrix.python-version }}
steps:
Expand Down Expand Up @@ -58,7 +58,7 @@ jobs:
# runs-on: "macos-latest"
# strategy:
# matrix:
# python-version: ["3.9", "3.10"]
# python-version: ["3.9", "3.10", "3.11"]
# fail-fast: false
# name: OSX Python ${{ matrix.python-version }}
# steps:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/pypi-build-and-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@ jobs:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Set up Python 3.10
- name: Set up Python 3.11
uses: actions/setup-python@v1
with:
python-version: "3.10"
python-version: "3.11"
- name: Install pep517
run: >-
python -m
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/run-tests-monitor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ["3.9", "3.10"]
python-version: ["3.9", "3.10", "3.11"]
name: Linux Python ${{ matrix.python-version }}
steps:
- uses: actions/checkout@v3
Expand Down Expand Up @@ -67,7 +67,7 @@ jobs:
runs-on: "macos-latest"
strategy:
matrix:
python-version: ["3.9", "3.10"]
python-version: ["3.9", "3.10", "3.11"]
fail-fast: false
name: OSX Python ${{ matrix.python-version }}
steps:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test-development.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ["3.9", "3.10"]
python-version: ["3.9", "3.10", "3.11"]
name: Linux Python ${{ matrix.python-version }}
steps:
- uses: actions/checkout@v3
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ["3.9", "3.10"]
python-version: ["3.9", "3.10", "3.11"]
name: Linux Python ${{ matrix.python-version }}
steps:
- uses: actions/checkout@v3
Expand Down Expand Up @@ -59,7 +59,7 @@ jobs:
runs-on: "macos-latest"
strategy:
matrix:
python-version: ["3.9", "3.10"]
python-version: ["3.9", "3.10", "3.11"]
fail-fast: false
name: OSX Python ${{ matrix.python-version }}
steps:
Expand Down
2 changes: 1 addition & 1 deletion doc/sphinx/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@

# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
html_theme = 'sphinx_rtd_theme'
html_theme = 'pydata_sphinx_theme'

# Theme options are theme-specific and customize the look and feel of a theme
# further. For a list of options available for each theme, see the
Expand Down
4 changes: 2 additions & 2 deletions doc/sphinx/source/quickstart/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -710,9 +710,9 @@ for example by running

.. code-block:: bash
mamba create -n esmvaltool esmvaltool 'python=3.10'
mamba create -n esmvaltool esmvaltool 'python=3.11'
you ask for Python 3.10 specifically and that makes it much easier for mamba to
you ask for Python 3.11 specifically and that makes it much easier for mamba to
solve the environment, because now it can ignore any packages that were built
for other Python versions. Note that, since the esmvaltool package is built
with Python>=3.9, asking for an older Python version, e.g. `python=3.7`, in
Expand Down
29 changes: 15 additions & 14 deletions environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,30 +9,31 @@ channels:
- nodefaults

dependencies:
- pip!=21.3
- python>=3.9
- pip !=21.3
- python >=3.9
- aiohttp
- cartopy
- cdo>=1.9.7
- cdo >=1.9.7
- cdsapi
- cf-units
- cftime
- cmocean
- cython
- dask
- distributed
- ecmwf-api-client
- eofs
- esmpy
- esmvalcore 2.8.*
- fiona
- fire
- gdal
- iris>=3.1.0
- iris-esmf-regrid
- iris >=3.6.0
- iris-esmf-regrid >=0.7.0
- jinja2
- joblib
- lime
- mapgenerator>=1.0.5
- mapgenerator >=1.0.5
- matplotlib-base
- natsort
- nc-time-axis
Expand All @@ -47,7 +48,7 @@ dependencies:
- psy-maps
- psy-reg
- psy-simple
- pyproj>=2.1
- pyproj >=2.1
- python-cdo
- python-dateutil
- pyyaml
Expand All @@ -59,10 +60,10 @@ dependencies:
- scipy
- seaborn
- seawater
- shapely <2.0.0 # github.com/ESMValGroup/ESMValTool/issues/2965
- xarray>=0.12.0
- xesmf>=0.7.1
- xgboost>1.6.1 # github.com/ESMValGroup/ESMValTool/issues/2779
- shapely
- xarray >=0.12.0
- xesmf >=0.7.1
- xgboost >1.6.1 # github.com/ESMValGroup/ESMValTool/issues/2779
- xlsxwriter
- zarr
# Python packages needed for testing
Expand All @@ -75,10 +76,10 @@ dependencies:
- pytest-mock
- pytest-xdist
# Python packages needed for building docs
- autodocsumm>=0.2.2
- autodocsumm >=0.2.2
- nbsphinx
- sphinx>=6.1.3
- sphinx_rtd_theme
- sphinx >=6.1.3
- pydata-sphinx-theme
# Python packages needed for development
- codespell
- docformatter
Expand Down
25 changes: 13 additions & 12 deletions environment_osx.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,30 +9,31 @@ channels:
- nodefaults

dependencies:
- pip!=21.3
- python>=3.9
- pip !=21.3
- python >=3.9
- aiohttp
- cartopy
- cdo>=1.9.7
- cdo >=1.9.7
- cdsapi
- cf-units
- cftime
- cmocean
- cython
- dask
- distributed
- ecmwf-api-client
- eofs
- esmpy
- esmvalcore 2.8.*
- fiona
- fire
- gdal
- iris>=3.1.0
- iris-esmf-regrid
- iris >=3.6.0
- iris-esmf-regrid >=0.7.0
- jinja2
- joblib
- lime
- mapgenerator>=1.0.5
- mapgenerator >=1.0.5
- matplotlib-base
- natsort
- nc-time-axis
Expand Down Expand Up @@ -60,9 +61,9 @@ dependencies:
- seaborn
- seawater
- shapely
- xarray>=0.12.0
- xesmf>=0.7.1
- xgboost>1.6.1 # github.com/ESMValGroup/ESMValTool/issues/2779
- xarray >=0.12.0
- xesmf >=0.7.1
- xgboost >1.6.1 # github.com/ESMValGroup/ESMValTool/issues/2779
- xlsxwriter
- zarr
# Python packages needed for testing
Expand All @@ -75,10 +76,10 @@ dependencies:
- pytest-mock
- pytest-xdist
# Python packages needed for building docs
- autodocsumm>=0.2.2
- autodocsumm >=0.2.2
- nbsphinx
- sphinx>=6.1.3
- sphinx_rtd_theme
- sphinx >=6.1.3
- pydata-sphinx-theme
# Python packages needed for development
- codespell
- docformatter
Expand Down
15 changes: 9 additions & 6 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,12 @@
'cftime',
'cmocean',
'dask',
'distributed',
'ecmwf-api-client',
'eofs',
'ESMPy',
'esmvalcore',
'esmf-regrid',
'esmf-regrid>=0.7.0',
'fiona',
'GDAL',
'jinja2',
Expand All @@ -47,7 +48,7 @@
'packaging',
'openpyxl',
'pandas',
'pyproj',
'pyproj>=2.1',
'pyyaml',
'progressbar2',
'psyplot',
Expand All @@ -59,11 +60,11 @@
'scikit-image',
'scikit-learn',
'scipy',
'scitools-iris',
'scitools-iris>=3.6.0',
'seaborn',
'seawater',
'shapely<2.0.0', # github.com/ESMValGroup/ESMValTool/issues/2965
'xarray',
'shapely',
'xarray>=0.12.0',
'xesmf>=0.7.1',
'xgboost>1.6.1', # github.com/ESMValGroup/ESMValTool/issues/2779
'xlsxwriter',
Expand All @@ -86,7 +87,7 @@
'autodocsumm>=0.2.2',
'nbsphinx',
'sphinx>=6.1.3',
'sphinx_rtd_theme',
'pydata-sphinx-theme',
],
# Development dependencies
# Use pip install -e .[develop] to install in development mode
Expand All @@ -105,6 +106,7 @@

def discover_python_files(paths, ignore):
"""Discover Python files."""

def _ignore(path):
"""Return True if `path` should be ignored, False otherwise."""
return any(re.match(pattern, path) for pattern in ignore)
Expand Down Expand Up @@ -214,6 +216,7 @@ def read_description(filename):
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.9',
'Programming Language :: Python :: 3.10',
'Programming Language :: Python :: 3.11',
'Topic :: Scientific/Engineering',
'Topic :: Scientific/Engineering :: Atmospheric Science',
'Topic :: Scientific/Engineering :: GIS',
Expand Down

0 comments on commit e3b5877

Please sign in to comment.