Skip to content

Commit fa8e90c

Browse files
authored
CI: python 3.12 by default. (#8969)
* CI: python 3.12 by default. Now that numba supports 3.12. * limit flaky test run * More flaky marks * Use PYTEST_ADDOPTS * More Nio cleanup * cleanup * disable pint * More bumps * Ignore pint if not installed * skip mypy bump
1 parent a05fe82 commit fa8e90c

11 files changed

+22
-30
lines changed

.github/workflows/ci-additional.yaml

+3-3
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ jobs:
4141
shell: bash -l {0}
4242
env:
4343
CONDA_ENV_FILE: ci/requirements/environment.yml
44-
PYTHON_VERSION: "3.11"
44+
PYTHON_VERSION: "3.12"
4545
steps:
4646
- uses: actions/checkout@v4
4747
with:
@@ -205,7 +205,7 @@ jobs:
205205
shell: bash -l {0}
206206
env:
207207
CONDA_ENV_FILE: ci/requirements/environment.yml
208-
PYTHON_VERSION: "3.10"
208+
PYTHON_VERSION: "3.12"
209209

210210
steps:
211211
- uses: actions/checkout@v4
@@ -330,7 +330,7 @@ jobs:
330330
with:
331331
environment-name: xarray-tests
332332
create-args: >-
333-
python=3.11
333+
python=3.12
334334
pyyaml
335335
conda
336336
python-dateutil

.github/workflows/ci.yaml

+11-11
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ jobs:
4444
matrix:
4545
os: ["ubuntu-latest", "macos-latest", "windows-latest"]
4646
# Bookend python versions
47-
python-version: ["3.9", "3.11", "3.12"]
47+
python-version: ["3.9", "3.12"]
4848
env: [""]
4949
include:
5050
# Minimum python version:
@@ -56,10 +56,11 @@ jobs:
5656
os: ubuntu-latest
5757
# Latest python version:
5858
- env: "all-but-dask"
59-
python-version: "3.10"
59+
# Not 3.12 because of pint
60+
python-version: "3.11"
6061
os: ubuntu-latest
6162
- env: "flaky"
62-
python-version: "3.10"
63+
python-version: "3.12"
6364
os: ubuntu-latest
6465
steps:
6566
- uses: actions/checkout@v4
@@ -71,30 +72,30 @@ jobs:
7172
7273
if [[ ${{ matrix.os }} == windows* ]] ;
7374
then
74-
if [[ ${{ matrix.python-version }} != "3.12" ]]; then
75+
if [[ ${{ matrix.python-version }} != "3.13" ]]; then
7576
echo "CONDA_ENV_FILE=ci/requirements/environment-windows.yml" >> $GITHUB_ENV
7677
else
77-
echo "CONDA_ENV_FILE=ci/requirements/environment-windows-3.12.yml" >> $GITHUB_ENV
78+
echo "CONDA_ENV_FILE=ci/requirements/environment-windows-3.13.yml" >> $GITHUB_ENV
7879
fi
7980
elif [[ "${{ matrix.env }}" != "" ]] ;
8081
then
8182
if [[ "${{ matrix.env }}" == "flaky" ]] ;
8283
then
8384
echo "CONDA_ENV_FILE=ci/requirements/environment.yml" >> $GITHUB_ENV
84-
echo "PYTEST_EXTRA_FLAGS=--run-flaky --run-network-tests -W default" >> $GITHUB_ENV
85+
echo "PYTEST_ADDOPTS=-m 'flaky or network' --run-flaky --run-network-tests -W default" >> $GITHUB_ENV
8586
else
8687
echo "CONDA_ENV_FILE=ci/requirements/${{ matrix.env }}.yml" >> $GITHUB_ENV
8788
fi
8889
if [[ "${{ matrix.env }}" == "min-all-deps" ]] ;
8990
then
9091
# Don't raise on warnings
91-
echo "PYTEST_EXTRA_FLAGS=-W default" >> $GITHUB_ENV
92+
echo "PYTEST_ADDOPTS=-W default" >> $GITHUB_ENV
9293
fi
9394
else
94-
if [[ ${{ matrix.python-version }} != "3.12" ]]; then
95+
if [[ ${{ matrix.python-version }} != "3.13" ]]; then
9596
echo "CONDA_ENV_FILE=ci/requirements/environment.yml" >> $GITHUB_ENV
9697
else
97-
echo "CONDA_ENV_FILE=ci/requirements/environment-3.12.yml" >> $GITHUB_ENV
98+
echo "CONDA_ENV_FILE=ci/requirements/environment-3.13.yml" >> $GITHUB_ENV
9899
fi
99100
fi
100101
@@ -114,7 +115,7 @@ jobs:
114115
# We only want to install this on one run, because otherwise we'll have
115116
# duplicate annotations.
116117
- name: Install error reporter
117-
if: ${{ matrix.os }} == 'ubuntu-latest' and ${{ matrix.python-version }} == '3.10'
118+
if: ${{ matrix.os }} == 'ubuntu-latest' and ${{ matrix.python-version }} == '3.12'
118119
run: |
119120
python -m pip install pytest-github-actions-annotate-failures
120121
@@ -146,7 +147,6 @@ jobs:
146147
--cov=xarray
147148
--cov-report=xml
148149
--junitxml=pytest.xml
149-
$PYTEST_EXTRA_FLAGS
150150

151151
- name: Upload test results
152152
if: always()

.github/workflows/pypi-release.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
- uses: actions/setup-python@v5
1919
name: Install Python
2020
with:
21-
python-version: "3.11"
21+
python-version: "3.12"
2222

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

ci/requirements/environment-windows.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ dependencies:
2626
- numpy
2727
- packaging
2828
- pandas
29-
- pint>=0.22
29+
# - pint>=0.22
3030
- pip
3131
- pre-commit
3232
- pydap

ci/requirements/environment.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ dependencies:
3030
- opt_einsum
3131
- packaging
3232
- pandas
33-
- pint>=0.22
33+
# - pint>=0.22
3434
- pip
3535
- pooch
3636
- pre-commit

pyproject.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -117,13 +117,13 @@ module = [
117117
"iris.*",
118118
"matplotlib.*",
119119
"mpl_toolkits.*",
120-
"Nio.*",
121120
"nc_time_axis.*",
122121
"numbagg.*",
123122
"netCDF4.*",
124123
"netcdftime.*",
125124
"opt_einsum.*",
126125
"pandas.*",
126+
"pint.*",
127127
"pooch.*",
128128
"pyarrow.*",
129129
"pydap.*",

xarray/tests/test_backends.py

+3-9
Original file line numberDiff line numberDiff line change
@@ -2988,14 +2988,6 @@ def test_chunked_cftime_datetime(self) -> None:
29882988
assert original[name].chunks == actual_var.chunks
29892989
assert original.chunks == actual.chunks
29902990

2991-
def test_vectorized_indexing_negative_step(self) -> None:
2992-
if not has_dask:
2993-
pytest.xfail(
2994-
reason="zarr without dask handles negative steps in slices incorrectly"
2995-
)
2996-
2997-
super().test_vectorized_indexing_negative_step()
2998-
29992991

30002992
@requires_zarr
30012993
class TestZarrDictStore(ZarrBase):
@@ -3821,6 +3813,7 @@ def skip_if_not_engine(engine):
38213813
pytest.importorskip(engine)
38223814

38233815

3816+
# Flaky test. Very open to contributions on fixing this
38243817
@requires_dask
38253818
@pytest.mark.filterwarnings("ignore:use make_scale(name) instead")
38263819
@pytest.mark.xfail(reason="Flaky test. Very open to contributions on fixing this")
@@ -4523,7 +4516,8 @@ def test_open_multi_dataset(self) -> None:
45234516
) as actual:
45244517
assert_identical(expected, actual)
45254518

4526-
@pytest.mark.xfail(reason="Flaky test. Very open to contributions on fixing this")
4519+
# Flaky test. Very open to contributions on fixing this
4520+
@pytest.mark.flaky
45274521
def test_dask_roundtrip(self) -> None:
45284522
with create_tmp_file() as tmp:
45294523
data = create_test_data()

xarray/tests/test_plugins.py

-1
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,6 @@ def test_lazy_import() -> None:
228228
"matplotlib",
229229
"nc_time_axis",
230230
"netCDF4",
231-
"Nio",
232231
"numbagg",
233232
"pint",
234233
"pydap",

xarray/util/print_versions.py

-1
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,6 @@ def show_versions(file=sys.stdout):
104104
("pydap", lambda mod: mod.__version__),
105105
("h5netcdf", lambda mod: mod.__version__),
106106
("h5py", lambda mod: mod.__version__),
107-
("Nio", lambda mod: mod.__version__),
108107
("zarr", lambda mod: mod.__version__),
109108
("cftime", lambda mod: mod.__version__),
110109
("nc_time_axis", lambda mod: mod.__version__),

0 commit comments

Comments
 (0)