Skip to content

CI: python 3.12 by default. #8969

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

Merged
merged 12 commits into from
Apr 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/ci-additional.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ jobs:
shell: bash -l {0}
env:
CONDA_ENV_FILE: ci/requirements/environment.yml
PYTHON_VERSION: "3.11"
PYTHON_VERSION: "3.12"
steps:
- uses: actions/checkout@v4
with:
Expand Down Expand Up @@ -205,7 +205,7 @@ jobs:
shell: bash -l {0}
env:
CONDA_ENV_FILE: ci/requirements/environment.yml
PYTHON_VERSION: "3.10"
PYTHON_VERSION: "3.12"

steps:
- uses: actions/checkout@v4
Expand Down Expand Up @@ -330,7 +330,7 @@ jobs:
with:
environment-name: xarray-tests
create-args: >-
python=3.11
python=3.12
pyyaml
conda
python-dateutil
Expand Down
22 changes: 11 additions & 11 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ jobs:
matrix:
os: ["ubuntu-latest", "macos-latest", "windows-latest"]
# Bookend python versions
python-version: ["3.9", "3.11", "3.12"]
python-version: ["3.9", "3.12"]
env: [""]
include:
# Minimum python version:
Expand All @@ -56,10 +56,11 @@ jobs:
os: ubuntu-latest
# Latest python version:
- env: "all-but-dask"
python-version: "3.10"
# Not 3.12 because of pint
python-version: "3.11"
os: ubuntu-latest
- env: "flaky"
python-version: "3.10"
python-version: "3.12"
os: ubuntu-latest
steps:
- uses: actions/checkout@v4
Expand All @@ -71,30 +72,30 @@ jobs:

if [[ ${{ matrix.os }} == windows* ]] ;
then
if [[ ${{ matrix.python-version }} != "3.12" ]]; then
if [[ ${{ matrix.python-version }} != "3.13" ]]; then
echo "CONDA_ENV_FILE=ci/requirements/environment-windows.yml" >> $GITHUB_ENV
else
echo "CONDA_ENV_FILE=ci/requirements/environment-windows-3.12.yml" >> $GITHUB_ENV
echo "CONDA_ENV_FILE=ci/requirements/environment-windows-3.13.yml" >> $GITHUB_ENV
fi
elif [[ "${{ matrix.env }}" != "" ]] ;
then
if [[ "${{ matrix.env }}" == "flaky" ]] ;
then
echo "CONDA_ENV_FILE=ci/requirements/environment.yml" >> $GITHUB_ENV
echo "PYTEST_EXTRA_FLAGS=--run-flaky --run-network-tests -W default" >> $GITHUB_ENV
echo "PYTEST_ADDOPTS=-m 'flaky or network' --run-flaky --run-network-tests -W default" >> $GITHUB_ENV
else
echo "CONDA_ENV_FILE=ci/requirements/${{ matrix.env }}.yml" >> $GITHUB_ENV
fi
if [[ "${{ matrix.env }}" == "min-all-deps" ]] ;
then
# Don't raise on warnings
echo "PYTEST_EXTRA_FLAGS=-W default" >> $GITHUB_ENV
echo "PYTEST_ADDOPTS=-W default" >> $GITHUB_ENV
fi
else
if [[ ${{ matrix.python-version }} != "3.12" ]]; then
if [[ ${{ matrix.python-version }} != "3.13" ]]; then
echo "CONDA_ENV_FILE=ci/requirements/environment.yml" >> $GITHUB_ENV
else
echo "CONDA_ENV_FILE=ci/requirements/environment-3.12.yml" >> $GITHUB_ENV
echo "CONDA_ENV_FILE=ci/requirements/environment-3.13.yml" >> $GITHUB_ENV
fi
fi

Expand All @@ -114,7 +115,7 @@ jobs:
# We only want to install this on one run, because otherwise we'll have
# duplicate annotations.
- name: Install error reporter
if: ${{ matrix.os }} == 'ubuntu-latest' and ${{ matrix.python-version }} == '3.10'
if: ${{ matrix.os }} == 'ubuntu-latest' and ${{ matrix.python-version }} == '3.12'
run: |
python -m pip install pytest-github-actions-annotate-failures

Expand Down Expand Up @@ -146,7 +147,6 @@ jobs:
--cov=xarray
--cov-report=xml
--junitxml=pytest.xml
$PYTEST_EXTRA_FLAGS

- name: Upload test results
if: always()
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/pypi-release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
- uses: actions/setup-python@v5
name: Install Python
with:
python-version: "3.11"
python-version: "3.12"

- name: Install dependencies
run: |
Expand Down Expand Up @@ -53,7 +53,7 @@ jobs:
- uses: actions/setup-python@v5
name: Install Python
with:
python-version: "3.11"
python-version: "3.12"
- uses: actions/download-artifact@v4
with:
name: releases
Expand Down
2 changes: 1 addition & 1 deletion ci/requirements/environment-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ dependencies:
- numpy
- packaging
- pandas
- pint>=0.22
# - pint>=0.22
- pip
- pre-commit
- pydap
Expand Down
2 changes: 1 addition & 1 deletion ci/requirements/environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ dependencies:
- opt_einsum
- packaging
- pandas
- pint>=0.22
# - pint>=0.22
- pip
- pooch
- pre-commit
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -117,13 +117,13 @@ module = [
"iris.*",
"matplotlib.*",
"mpl_toolkits.*",
"Nio.*",
"nc_time_axis.*",
"numbagg.*",
"netCDF4.*",
"netcdftime.*",
"opt_einsum.*",
"pandas.*",
"pint.*",
"pooch.*",
"pyarrow.*",
"pydap.*",
Expand Down
12 changes: 3 additions & 9 deletions xarray/tests/test_backends.py
Original file line number Diff line number Diff line change
Expand Up @@ -2988,14 +2988,6 @@ def test_chunked_cftime_datetime(self) -> None:
assert original[name].chunks == actual_var.chunks
assert original.chunks == actual.chunks

def test_vectorized_indexing_negative_step(self) -> None:
if not has_dask:
pytest.xfail(
reason="zarr without dask handles negative steps in slices incorrectly"
)

super().test_vectorized_indexing_negative_step()


@requires_zarr
class TestZarrDictStore(ZarrBase):
Expand Down Expand Up @@ -3821,6 +3813,7 @@ def skip_if_not_engine(engine):
pytest.importorskip(engine)


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

@pytest.mark.xfail(reason="Flaky test. Very open to contributions on fixing this")
# Flaky test. Very open to contributions on fixing this
@pytest.mark.flaky
def test_dask_roundtrip(self) -> None:
with create_tmp_file() as tmp:
data = create_test_data()
Expand Down
1 change: 0 additions & 1 deletion xarray/tests/test_plugins.py
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,6 @@ def test_lazy_import() -> None:
"matplotlib",
"nc_time_axis",
"netCDF4",
"Nio",
"numbagg",
"pint",
"pydap",
Expand Down
1 change: 0 additions & 1 deletion xarray/util/print_versions.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,6 @@ def show_versions(file=sys.stdout):
("pydap", lambda mod: mod.__version__),
("h5netcdf", lambda mod: mod.__version__),
("h5py", lambda mod: mod.__version__),
("Nio", lambda mod: mod.__version__),
("zarr", lambda mod: mod.__version__),
("cftime", lambda mod: mod.__version__),
("nc_time_axis", lambda mod: mod.__version__),
Expand Down