@@ -18,27 +18,24 @@ jobs:
18
18
test :
19
19
name : Test (${{matrix.env}}, ${{ matrix.python-version }}, ${{ matrix.os }})
20
20
runs-on : ${{ matrix.os }}
21
- defaults :
22
- run :
23
- shell : bash -l {0}
24
21
strategy :
25
22
fail-fast : false
26
23
matrix :
27
24
os : ["ubuntu-latest"]
28
- env : ["environment "]
25
+ env : ["complete "]
29
26
python-version : ["3.11", "3.13"]
30
27
include :
31
28
- os : " windows-latest"
32
- env : " environment "
29
+ env : " complete "
33
30
python-version : " 3.13"
34
31
- os : " ubuntu-latest"
35
- env : " no-dask" # "no-xarray", "no-numba"
32
+ env : " no-dask"
36
33
python-version : " 3.13"
37
34
- os : " ubuntu-latest"
38
- env : " minimal-requirements "
35
+ env : " minimal"
39
36
python-version : " 3.11"
40
37
- os : " windows-latest"
41
- env : " env- numpy1"
38
+ env : " numpy1"
42
39
python-version : " 3.11"
43
40
steps :
44
41
- uses : actions/checkout@v5
@@ -47,18 +44,18 @@ jobs:
47
44
- name : Set environment variables
48
45
run : |
49
46
echo "PYTHON_VERSION=${{ matrix.python-version }}" >> $GITHUB_ENV
50
- - name : Set up conda environment
51
- uses : mamba-org /setup-micromamba@v2
47
+ - name : Set up Python and uv
48
+ uses : astral-sh /setup-uv@v4
52
49
with :
53
- environment-file : ci/ ${{ matrix.env }}.yml
54
- environment-name : flox-tests
55
- init-shell : bash
56
- cache-environment : true
57
- create-args : |
58
- python= ${{ matrix.python-version }}
59
- - name : Install flox
60
- run : |
61
- python -m pip install --no-deps -e .
50
+ python-version : ${{ matrix.python-version }}
51
+ enable-cache : true
52
+ cache-dependency-glob : " pyproject.toml "
53
+ - name : Install dependencies (with config file)
54
+ if : matrix.env == 'numpy1'
55
+ run : uv sync --group ${{ matrix.env }} --config-file uv-numpy1.toml --no-dev
56
+ - name : Install dependencies (without config file)
57
+ if : matrix.env != 'numpy1'
58
+ run : uv sync --group ${{ matrix.env }} --no-dev
62
59
63
60
# https://github.com/actions/cache/blob/main/tips-and-workarounds.md#update-a-cache
64
61
- name : Restore cached hypothesis directory
73
70
- name : Run Tests
74
71
id : status
75
72
run : |
76
- python -c "import xarray; xarray.show_versions()"
77
- pytest --durations=20 --durations-min=0.5 -n auto --cov=./ --cov-report=xml --hypothesis-profile ci
73
+ uv run --no-dev python -c "import xarray; xarray.show_versions()" || true
74
+ uv run --no-dev pytest --durations=20 --durations-min=0.5 -n auto --cov=./ --cov-report=xml --hypothesis-profile ci
78
75
- name : Upload code coverage to Codecov
79
76
uses : codecov/codecov-action@v5.5.0
80
77
with :
@@ -96,48 +93,39 @@ jobs:
96
93
xarray-groupby :
97
94
name : xarray-groupby
98
95
runs-on : ubuntu-latest
99
- defaults :
100
- run :
101
- shell : bash -l {0}
102
96
steps :
103
97
- uses : actions/checkout@v5
104
98
with :
105
99
repository : " pydata/xarray"
106
100
fetch-depth : 0 # Fetch all history for all branches and tags.
107
- - name : Set up conda environment
108
- uses : mamba-org /setup-micromamba@v2
101
+ - name : Set up Python and uv
102
+ uses : astral-sh /setup-uv@v4
109
103
with :
110
- environment-file : ci/requirements/environment.yml
111
- environment-name : xarray-tests
112
- init-shell : bash
113
- cache-environment : true
114
- create-args : >-
115
- python=3.11
116
- pint>=0.22
117
- - name : Install xarray
104
+ python-version : " 3.13"
105
+ enable-cache : true
106
+ cache-dependency-glob : " pyproject.toml"
107
+ - name : Install xarray and dependencies
118
108
run : |
119
- python -m pip install --no-deps .
109
+ uv add --dev .[complete] pint>=0.22
120
110
- name : Install upstream flox
121
111
run : |
122
- python -m pip install --no-deps \
123
- git+https://github.com/dcherian/flox.git@${{ github.ref }}
112
+ uv add git+https://github.com/dcherian/flox.git@${{ github.ref }}
124
113
- name : Version info
125
114
run : |
126
- conda info -a
127
- conda list
128
- python xarray/util/print_versions.py
115
+ uv tree
116
+ uv run --no-dev python xarray/util/print_versions.py
129
117
- name : import xarray
130
118
run : |
131
- python -c 'import xarray'
119
+ uv run --no-dev python -c 'import xarray'
132
120
- name : import flox
133
121
run : |
134
- python -c 'import flox'
122
+ uv run --no-dev python -c 'import flox'
135
123
- name : Run Tests
136
124
if : success()
137
125
id : status
138
126
run : |
139
127
set -euo pipefail
140
- python -m pytest -n auto \
128
+ uv run --no-dev python -m pytest -n auto \
141
129
xarray/tests/test_groupby.py \
142
130
xarray/tests/test_units.py::TestDataArray::test_computation_objects \
143
131
xarray/tests/test_units.py::TestDataArray::test_grouped_operations \
0 commit comments