30
30
- " 3.12"
31
31
- " 3.13" # Latest supported by ixmp
32
32
gams-version :
33
- # Version used until 2024-07; disabled
34
- # - 25.1.1
35
- # First version including a macOS arm64 distribution
36
- - 43.4.1
37
-
38
- # commented: force a specific version of pandas, for e.g. pre-release
39
- # testing
40
- # pandas-version:
41
- # - ""
42
- # - "==2.0.0rc0"
33
+ - " 43.4.1" # First version including a macOS arm64 distribution
43
34
44
35
exclude :
45
36
# Specific version combinations that are invalid / not to be used
@@ -55,29 +46,26 @@ jobs:
55
46
56
47
runs-on : ${{ matrix.os }}
57
48
name : ${{ matrix.os }}-py${{ matrix.python-version }}
58
- # commented: use with "pandas-version" in the matrix, above
59
- # name: ${{ matrix.os }}-py${{ matrix.python-version }}-pandas${{ matrix.pandas-version }}
60
49
61
50
steps :
62
51
- uses : actions/checkout@v4
63
52
with :
64
53
fetch-depth : ${{ env.depth }}
65
54
fetch-tags : true
66
55
67
- - uses : actions/setup-python@v5
56
+ - name : Set up uv, Python
57
+ uses : astral-sh/setup-uv@v5
68
58
with :
59
+ cache-dependency-glob : " **/pyproject.toml"
69
60
python-version : ${{ matrix.python-version }}
70
- cache : pip
71
- cache-dependency-path : " **/pyproject.toml"
72
61
73
62
- uses : ts-graphviz/setup-graphviz@v2
74
- # TEMPORARY Work around ts-graphviz/setup-graphviz#630
75
- if : ${{ ! startswith( matrix.os, 'macos-') }}
63
+ # Work around ts-graphviz/setup-graphviz#630
64
+ if : matrix.os != 'macos-13'
76
65
77
66
- uses : r-lib/actions/setup-r@v2
78
67
id : setup-r
79
- with :
80
- r-version : " 4.4.1"
68
+ with : { r-version: "4.4.1" }
81
69
82
70
- name : Cache GAMS installer and R packages
83
71
uses : actions/cache@v4
@@ -95,21 +83,13 @@ jobs:
95
83
license : ${{ secrets.GAMS_LICENSE }}
96
84
97
85
- name : Set RETICULATE_PYTHON
98
- # Use the environment variable set by the setup-python action, above.
99
- run : echo "RETICULATE_PYTHON=$pythonLocation " >> $GITHUB_ENV
86
+ # Retrieve the Python executable set up above
87
+ run : echo "RETICULATE_PYTHON=$(uv python find) " >> $GITHUB_ENV
100
88
shell : bash
101
89
102
- - name : Install Python package and dependencies
103
- # [docs] contains [tests], which contains [report,tutorial]
104
- run : |
105
- pip install .[docs]
106
-
107
- # commented: use with "pandas-version" in the matrix, above
108
- # pip install --upgrade pandas${{ matrix.pandas-version }}
109
-
110
- # TEMPORARY With Python 3.13 pyam-iamc resolves to 1.3.1, which in turn
111
- # limits pint < 0.17. Override. cf. iiasa/ixmp#544
112
- pip install --upgrade pint
90
+ - name : Install the package and dependencies
91
+ # [docs] requires [tests] which requires [report,tutorial]
92
+ run : uv pip install .[docs]
113
93
114
94
- name : Install R dependencies and tutorial requirements
115
95
# Workaround for https://github.com/actions/runner-images/issues/11137
@@ -142,23 +122,20 @@ jobs:
142
122
IRkernel::installspec()
143
123
shell : Rscript {0}
144
124
145
- - name : Run test suite using pytest
125
+ - name : Run tests
146
126
run : |
147
- pytest ixmp \
127
+ uv run --no-sync \
128
+ pytest ixmp \
148
129
-m "not performance" \
149
- --color=yes -rA --verbose \
130
+ --color=yes --durations=20 - rA --verbose \
150
131
--cov-report=xml \
151
132
--numprocesses=auto --dist=loadgroup
152
133
shell : bash
153
134
154
135
- name : Upload test coverage to Codecov.io
155
136
uses : codecov/codecov-action@v5
156
- # FIXME Limit runtime until
157
- # https://github.com/codecov/codecov-action/issues/1316 is resolved
158
- timeout-minutes : 1
159
- continue-on-error : true
160
137
with :
161
- token : ${{ secrets.CODECOV_TOKEN }} # required
138
+ token : ${{ secrets.CODECOV_TOKEN}}
162
139
163
140
pre-commit :
164
141
name : Code quality
@@ -167,12 +144,11 @@ jobs:
167
144
168
145
steps :
169
146
- uses : actions/checkout@v4
170
- - uses : actions/setup-python@v5
171
- with : { python-version: "3.12" }
172
-
173
- - name : Force recreation of pre-commit virtual environment for mypy
174
- if : github.event_name == 'schedule'
175
- run : gh cache list -L 999 | cut -f2 | grep pre-commit | xargs -I{} gh cache delete "{}" || true
176
- env : { GH_TOKEN: "${{ github.token }}" }
177
-
178
- - uses : pre-commit/action@v3.0.1
147
+ - uses : astral-sh/setup-uv@v5
148
+ with : { cache-dependency-glob: "**/pyproject.toml" }
149
+ - uses : actions/cache@v4
150
+ with :
151
+ path : ~/.cache/pre-commit
152
+ key : pre-commit|${{ env.UV_PYTHON }}|${{ hashFiles('.pre-commit-config.yaml') }}
153
+ lookup-only : ${{ github.event_name == 'schedule' }} # Set 'true' to recreate cache
154
+ - run : uvx pre-commit run --all-files --color=always --show-diff-on-failure
0 commit comments