Skip to content

try to get the upstream-dev CI to complete again #8823

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
Mar 12, 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
17 changes: 14 additions & 3 deletions ci/install-upstream-wheels.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,12 @@
micromamba install "cython>=0.29.20" py-cpuinfo
# temporarily (?) remove numbagg and numba
micromamba remove -y numba numbagg
# temporarily remove numexpr
micromamba remove -y numexpr
# temporarily remove backends
micromamba remove -y cf_units h5py hdf5 netcdf4
micromamba remove -y cf_units hdf5 h5py netcdf4
# forcibly remove packages to avoid artifacts
conda uninstall -y --force \
micromamba remove -y --force \
numpy \
scipy \
pandas \
Expand All @@ -30,8 +32,17 @@ python -m pip install \
scipy \
matplotlib \
pandas
# for some reason pandas depends on pyarrow already.
# Remove once a `pyarrow` version compiled with `numpy>=2.0` is on `conda-forge`
python -m pip install \
-i https://pypi.fury.io/arrow-nightlies/ \
--prefer-binary \
--no-deps \
--pre \
--upgrade \
pyarrow
# without build isolation for packages compiling against numpy
# TODO: remove once there are `numpy>=2.0` builds for numcodecs and cftime
# TODO: remove once there are `numpy>=2.0` builds for these
python -m pip install \
--no-deps \
--upgrade \
Expand Down
1 change: 1 addition & 0 deletions ci/requirements/all-but-dask.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ channels:
dependencies:
- black
- aiobotocore
- array-api-strict
- boto3
- bottleneck
- cartopy
Expand Down
1 change: 1 addition & 0 deletions ci/requirements/environment-3.12.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ channels:
- nodefaults
dependencies:
- aiobotocore
- array-api-strict
- boto3
- bottleneck
- cartopy
Expand Down
1 change: 1 addition & 0 deletions ci/requirements/environment-windows-3.12.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ name: xarray-tests
channels:
- conda-forge
dependencies:
- array-api-strict
- boto3
- bottleneck
- cartopy
Expand Down
1 change: 1 addition & 0 deletions ci/requirements/environment-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ name: xarray-tests
channels:
- conda-forge
dependencies:
- array-api-strict
- boto3
- bottleneck
- cartopy
Expand Down
1 change: 1 addition & 0 deletions ci/requirements/environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ channels:
- nodefaults
dependencies:
- aiobotocore
- array-api-strict
- boto3
- bottleneck
- cartopy
Expand Down
1 change: 1 addition & 0 deletions ci/requirements/min-all-deps.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ dependencies:
# When upgrading python, numpy, or pandas, must also change
# doc/user-guide/installing.rst, doc/user-guide/plotting.rst and setup.py.
- python=3.9
- array-api-strict=1.0 # dependency for testing the array api compat
- boto3=1.24
- bottleneck=1.3
- cartopy=0.21
Expand Down
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,7 @@ module = [
"toolz.*",
"zarr.*",
"numpy.exceptions.*", # remove once support for `numpy<2.0` has been dropped
"array_api_strict.*",
]

# Gradually we want to add more modules to this list, ratcheting up our total
Expand Down
19 changes: 13 additions & 6 deletions xarray/tests/test_array_api.py
Original file line number Diff line number Diff line change
@@ -1,18 +1,25 @@
from __future__ import annotations

import warnings

import pytest

import xarray as xr
from xarray.testing import assert_equal

np = pytest.importorskip("numpy", minversion="1.22")

with warnings.catch_warnings():
warnings.simplefilter("ignore")
import numpy.array_api as xp # isort:skip
from numpy.array_api._array_object import Array # isort:skip
try:
import warnings

with warnings.catch_warnings():
warnings.simplefilter("ignore")

import numpy.array_api as xp
from numpy.array_api._array_object import Array
except ImportError:
# for `numpy>=2.0`
xp = pytest.importorskip("array_api_strict")

from array_api_strict._array_object import Array # type: ignore[no-redef]


@pytest.fixture
Expand Down