Skip to content

Commit dcb20e9

Browse files
jhammankeewis
andauthored
bump minimum versions, drop py38 (#7461)
* bump minimum versions, drop py38 * bump mypy action * bump pyupgrade * update whats new * audit version checks * remove GenericAlias * fix a few broken tests * stop requiring warning for invalid netcdf * remove extra requires * bump pandas * cleanup one more pytest skip * Apply suggestions from code review Co-authored-by: Justus Magin <keewis@users.noreply.github.com> * Update requirements.txt Co-authored-by: Justus Magin <keewis@users.noreply.github.com> Co-authored-by: Justus Magin <keewis@users.noreply.github.com>
1 parent f128f24 commit dcb20e9

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

68 files changed

+257
-559
lines changed

.github/workflows/ci-additional.yaml

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -134,18 +134,16 @@ jobs:
134134
name: codecov-umbrella
135135
fail_ci_if_error: false
136136

137-
mypy38:
138-
name: Mypy 3.8
137+
mypy39:
138+
name: Mypy 3.9
139139
runs-on: "ubuntu-latest"
140140
needs: detect-ci-trigger
141-
# temporarily skipping due to https://github.com/pydata/xarray/issues/6551
142-
if: needs.detect-ci-trigger.outputs.triggered == 'false'
143141
defaults:
144142
run:
145143
shell: bash -l {0}
146144
env:
147145
CONDA_ENV_FILE: ci/requirements/environment.yml
148-
PYTHON_VERSION: "3.8"
146+
PYTHON_VERSION: "3.9"
149147

150148
steps:
151149
- uses: actions/checkout@v3
@@ -185,7 +183,7 @@ jobs:
185183
uses: codecov/codecov-action@v3.1.1
186184
with:
187185
file: mypy_report/cobertura.xml
188-
flags: mypy38
186+
flags: mypy39
189187
env_vars: PYTHON_VERSION
190188
name: codecov-umbrella
191189
fail_ci_if_error: false

.github/workflows/ci.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,15 +42,15 @@ jobs:
4242
matrix:
4343
os: ["ubuntu-latest", "macos-latest", "windows-latest"]
4444
# Bookend python versions
45-
python-version: ["3.8", "3.10", "3.11"]
45+
python-version: ["3.9", "3.10", "3.11"]
4646
env: [""]
4747
include:
4848
# Minimum python version:
4949
- env: "bare-minimum"
50-
python-version: "3.8"
50+
python-version: "3.9"
5151
os: ubuntu-latest
5252
- env: "min-all-deps"
53-
python-version: "3.8"
53+
python-version: "3.9"
5454
os: ubuntu-latest
5555
# Latest python version:
5656
- env: "all-but-dask"

.github/workflows/pypi-release.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
- uses: actions/setup-python@v4
1919
name: Install Python
2020
with:
21-
python-version: 3.8
21+
python-version: "3.11"
2222

2323
- name: Install dependencies
2424
run: |
@@ -53,7 +53,7 @@ jobs:
5353
- uses: actions/setup-python@v4
5454
name: Install Python
5555
with:
56-
python-version: 3.8
56+
python-version: "3.11"
5757
- uses: actions/download-artifact@v3
5858
with:
5959
name: releases

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ repos:
2929
hooks:
3030
- id: pyupgrade
3131
args:
32-
- "--py38-plus"
32+
- "--py39-plus"
3333
# https://github.com/python/black#version-control-integration
3434
- repo: https://github.com/psf/black
3535
rev: 22.12.0

asv_bench/asv.conf.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040

4141
// The Pythons you'd like to test against. If not provided, defaults
4242
// to the current version of Python used to run `asv`.
43-
"pythons": ["3.8"],
43+
"pythons": ["3.10"],
4444

4545
// The matrix of dependencies to test. Each key is the name of a
4646
// package (in PyPI) and the values are version numbers. An empty

ci/min_deps_check.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
1+
#!/usr/bin/env python
12
"""Fetch from conda database all available versions of the xarray dependencies and their
23
publication date. Compare it against requirements/py37-min-all-deps.yml to verify the
34
policy on obsolete dependencies is being followed. Print a pretty report :)
45
"""
56
import itertools
67
import sys
8+
from collections.abc import Iterator
79
from datetime import datetime
8-
from typing import Dict, Iterator, Optional, Tuple
10+
from typing import Optional
911

1012
import conda.api # type: ignore[import]
1113
import yaml
@@ -29,7 +31,7 @@
2931

3032
POLICY_MONTHS = {"python": 24, "numpy": 18}
3133
POLICY_MONTHS_DEFAULT = 12
32-
POLICY_OVERRIDE: Dict[str, Tuple[int, int]] = {}
34+
POLICY_OVERRIDE: dict[str, tuple[int, int]] = {}
3335
errors = []
3436

3537

@@ -43,7 +45,7 @@ def warning(msg: str) -> None:
4345
print("WARNING:", msg)
4446

4547

46-
def parse_requirements(fname) -> Iterator[Tuple[str, int, int, Optional[int]]]:
48+
def parse_requirements(fname) -> Iterator[tuple[str, int, int, Optional[int]]]:
4749
"""Load requirements/py37-min-all-deps.yml
4850
4951
Yield (package name, major version, minor version, [patch version])
@@ -75,7 +77,7 @@ def parse_requirements(fname) -> Iterator[Tuple[str, int, int, Optional[int]]]:
7577
raise ValueError("expected major.minor or major.minor.patch: " + row)
7678

7779

78-
def query_conda(pkg: str) -> Dict[Tuple[int, int], datetime]:
80+
def query_conda(pkg: str) -> dict[tuple[int, int], datetime]:
7981
"""Query the conda repository for a specific package
8082
8183
Return map of {(major version, minor version): publication date}
@@ -115,7 +117,7 @@ def metadata(entry):
115117

116118
def process_pkg(
117119
pkg: str, req_major: int, req_minor: int, req_patch: Optional[int]
118-
) -> Tuple[str, str, str, str, str, str]:
120+
) -> tuple[str, str, str, str, str, str]:
119121
"""Compare package version from requirements file to available versions in conda.
120122
Return row to build pandas dataframe:
121123

ci/requirements/bare-minimum.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,13 @@ channels:
33
- conda-forge
44
- nodefaults
55
dependencies:
6-
- python=3.8
6+
- python=3.9
77
- coveralls
88
- pip
99
- pytest
1010
- pytest-cov
1111
- pytest-env
1212
- pytest-xdist
13-
- numpy=1.20
13+
- numpy=1.21
1414
- packaging=21.3
15-
- pandas=1.3
15+
- pandas=1.4

ci/requirements/doc.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ dependencies:
88
- bottleneck
99
- cartopy
1010
- cfgrib>=0.9
11-
- dask-core>=2.30
12-
- h5netcdf>=0.7.4
11+
- dask-core>=2022.1
12+
- h5netcdf>=0.13
1313
- ipykernel
1414
- ipython
1515
- iris>=2.3
@@ -18,9 +18,9 @@ dependencies:
1818
- nbsphinx
1919
- netcdf4>=1.5
2020
- numba
21-
- numpy>=1.20,<1.24
22-
- packaging>=21.0
23-
- pandas>=1.3
21+
- numpy>=1.21,<1.24
22+
- packaging>=21.3
23+
- pandas>=1.4
2424
- pooch
2525
- pip
2626
- pydata-sphinx-theme>=0.4.3
@@ -35,7 +35,7 @@ dependencies:
3535
- sphinx-copybutton
3636
- sphinx-design
3737
- sphinx!=4.4.0
38-
- zarr>=2.4
38+
- zarr>=2.10
3939
- pip:
4040
- sphinxext-rediraffe
4141
- sphinxext-opengraph

ci/requirements/min-all-deps.yml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,35 +7,35 @@ dependencies:
77
# Run ci/min_deps_check.py to verify that this file respects the policy.
88
# When upgrading python, numpy, or pandas, must also change
99
# doc/user-guide/installing.rst, doc/user-guide/plotting.rst and setup.py.
10-
- python=3.8
10+
- python=3.9
1111
- boto3=1.20
1212
- bottleneck=1.3
1313
- cartopy=0.20
1414
- cdms2=3.1
1515
- cfgrib=0.9
1616
- cftime=1.5
1717
- coveralls
18-
- dask-core=2021.11
19-
- distributed=2021.11
18+
- dask-core=2022.1
19+
- distributed=2022.1
2020
- flox=0.5
21-
- h5netcdf=0.11
21+
- h5netcdf=0.13
2222
# h5py and hdf5 tend to cause conflicts
2323
# for e.g. hdf5 1.12 conflicts with h5py=3.1
2424
# prioritize bumping other packages instead
2525
- h5py=3.6
2626
- hdf5=1.12
2727
- hypothesis
2828
- iris=3.1
29-
- lxml=4.6 # Optional dep of pydap
29+
- lxml=4.7 # Optional dep of pydap
3030
- matplotlib-base=3.5
3131
- nc-time-axis=1.4
3232
# netcdf follows a 1.major.minor[.patch] convention
3333
# (see https://github.com/Unidata/netcdf4-python/issues/1090)
3434
- netcdf4=1.5.7
35-
- numba=0.54
36-
- numpy=1.20
35+
- numba=0.55
36+
- numpy=1.21
3737
- packaging=21.3
38-
- pandas=1.3
38+
- pandas=1.4
3939
- pint=0.18
4040
- pip
4141
- pseudonetcdf=3.2

doc/contributing.rst

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ We'll now kick off a two-step process:
154154
.. code-block:: sh
155155
156156
# Create and activate the build environment
157-
conda create -c conda-forge -n xarray-tests python=3.8
157+
conda create -c conda-forge -n xarray-tests python=3.10
158158
159159
# This is for Linux and MacOS
160160
conda env update -f ci/requirements/environment.yml
@@ -571,9 +571,9 @@ A test run of this yields
571571
572572
((xarray) $ pytest test_cool_feature.py -v
573573
=============================== test session starts ================================
574-
platform darwin -- Python 3.6.4, pytest-3.2.1, py-1.4.34, pluggy-0.4.0 --
575-
cachedir: ../../.cache
576-
plugins: cov-2.5.1, hypothesis-3.23.0
574+
platform darwin -- Python 3.10.6, pytest-7.2.0, pluggy-1.0.0 --
575+
cachedir: .pytest_cache
576+
plugins: hypothesis-6.56.3, cov-4.0.0
577577
collected 11 items
578578
579579
test_cool_feature.py::test_dtypes[int8] PASSED
@@ -599,7 +599,9 @@ which match ``int8``.
599599
600600
((xarray) bash-3.2$ pytest test_cool_feature.py -v -k int8
601601
=========================== test session starts ===========================
602-
platform darwin -- Python 3.6.2, pytest-3.2.1, py-1.4.31, pluggy-0.4.0
602+
platform darwin -- Python 3.10.6, pytest-7.2.0, pluggy-1.0.0 --
603+
cachedir: .pytest_cache
604+
plugins: hypothesis-6.56.3, cov-4.0.0
603605
collected 11 items
604606
605607
test_cool_feature.py::test_dtypes[int8] PASSED
@@ -645,8 +647,7 @@ Performance matters and it is worth considering whether your code has introduced
645647
performance regressions. *xarray* is starting to write a suite of benchmarking tests
646648
using `asv <https://github.com/spacetelescope/asv>`__
647649
to enable easy monitoring of the performance of critical *xarray* operations.
648-
These benchmarks are all found in the ``xarray/asv_bench`` directory. asv
649-
supports both python2 and python3.
650+
These benchmarks are all found in the ``xarray/asv_bench`` directory.
650651
651652
To use all features of asv, you will need either ``conda`` or
652653
``virtualenv``. For more details please check the `asv installation
@@ -699,7 +700,7 @@ environment by::
699700
700701
or, to use a specific Python interpreter,::
701702
702-
asv run -e -E existing:python3.6
703+
asv run -e -E existing:python3.10
703704
704705
This will display stderr from the benchmarks, and use your local
705706
``python`` that comes from your ``$PATH``.

0 commit comments

Comments
 (0)