@@ -20,55 +20,43 @@ jobs:
20
20
build :
21
21
name : Build (${{ matrix.python-version }}, ${{ matrix.os }}), ${{ matrix.env }}
22
22
runs-on : ${{ matrix.os }}
23
- defaults :
24
- run :
25
- shell : bash -l {0}
26
23
strategy :
27
24
fail-fast : false
28
25
matrix :
29
26
os : ["ubuntu-latest"]
30
27
python-version : ["3.11", "3.13"]
31
- env : [""]
28
+ env : ["test "]
32
29
include :
33
- - env : " all -min-deps"
30
+ - env : " test -min-deps"
34
31
python-version : " 3.11"
35
32
os : ubuntu-latest
36
- - env : " no-optional-deps "
33
+ - env : " test- no-optional"
37
34
python-version : " 3.13"
38
35
os : ubuntu-latest
39
36
steps :
40
37
- uses : actions/checkout@v5
41
38
with :
42
39
fetch-depth : 0 # Fetch all history for all branches and tags.
43
- - name : Set environment variables
44
- run : |
45
- echo "PYTHON_VERSION=${{ matrix.python-version }}" >> $GITHUB_ENV
46
- if [[ "${{ matrix.env }}" == "" ]] ;
47
- then
48
- echo "CONDA_ENV_FILE=ci/environment.yml" >> $GITHUB_ENV
49
- fi
50
- if [[ "${{ matrix.env }}" == "no-optional-deps" ]] ;
51
- then
52
- echo "CONDA_ENV_FILE=ci/environment-no-optional-deps.yml" >> $GITHUB_ENV
53
- fi
54
- if [[ "${{ matrix.env }}" == "all-min-deps" ]] ;
55
- then
56
- echo "CONDA_ENV_FILE=ci/environment-all-min-deps.yml" >> $GITHUB_ENV
57
- fi
58
- - name : Set up conda environment
59
- uses : mamba-org/setup-micromamba@v2
40
+
41
+ - name : Set up Python
42
+ uses : actions/setup-python@v5
43
+ with :
44
+ python-version : ${{ matrix.python-version }}
45
+
46
+ - name : Install uv
47
+ uses : astral-sh/setup-uv@v4
60
48
with :
61
- environment-file : ${{ env.CONDA_ENV_FILE }}
62
- environment-name : cf_xarray_test
63
- cache-environment : true
64
- create-args : >-
65
- python=${{ matrix.python-version }}
66
- - name : Install cf_xarray
49
+ enable-cache : true
50
+
51
+ - name : Install dependencies
67
52
run : |
68
- python -m pip install --no-deps -e .
53
+ uv pip install --system -e .
54
+ uv pip install --system --group ${{ matrix.env }}
55
+
69
56
- name : Run Tests
70
57
run : |
71
58
pytest -n auto --cov=./ --cov-report=xml
59
+
72
60
- name : Upload code coverage to Codecov
73
61
74
62
with :
@@ -81,33 +69,34 @@ jobs:
81
69
mypy :
82
70
name : mypy
83
71
runs-on : " ubuntu-latest"
84
- defaults :
85
- run :
86
- shell : bash -l {0}
87
72
strategy :
88
73
matrix :
89
74
python-version : ["3.11", "3.13"]
90
75
steps :
91
76
- uses : actions/checkout@v5
92
77
with :
93
78
fetch-depth : 0 # Fetch all history for all branches and tags.
94
- - name : Set up conda environment
95
- uses : mamba-org/setup-micromamba@v2
79
+
80
+ - name : Set up Python
81
+ uses : actions/setup-python@v5
96
82
with :
97
- environment-file : ci/environment.yml
98
- environment-name : cf_xarray_test
99
- cache-environment : true
100
- create-args : >-
101
- python=${{ matrix.python-version }}
102
- - name : Install cf_xarray
103
- run : |
104
- python -m pip install --no-deps -e .
105
- - name : Install mypy
83
+ python-version : ${{ matrix.python-version }}
84
+
85
+ - name : Install uv
86
+ uses : astral-sh/setup-uv@v4
87
+ with :
88
+ enable-cache : true
89
+
90
+ - name : Install dependencies
106
91
run : |
107
- python -m pip install 'mypy'
92
+ uv pip install --system -e .
93
+ uv pip install --system --group test
94
+ uv pip install --system --group typing
95
+
108
96
- name : Run mypy
109
97
run : |
110
98
python -m mypy --install-types --non-interactive --cobertura-xml-report mypy_report cf_xarray/
99
+
111
100
- name : Upload mypy coverage to Codecov
112
101
113
102
with :
0 commit comments