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,29 @@ 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 : TEMPORARY Work around actions/checkout#2041
57
+ run : git fetch --tags
58
+
59
+ - name : Set up uv, Python
60
+ uses : astral-sh/setup-uv@v5
68
61
with :
62
+ cache-dependency-glob : " **/pyproject.toml"
69
63
python-version : ${{ matrix.python-version }}
70
- cache : pip
71
- cache-dependency-path : " **/pyproject.toml"
72
64
73
65
- uses : ts-graphviz/setup-graphviz@v2
74
- # TEMPORARY Work around ts-graphviz/setup-graphviz#630
75
- if : ${{ ! startswith( matrix.os, 'macos-') }}
66
+ # Work around ts-graphviz/setup-graphviz#630
67
+ if : matrix.os != 'macos-13'
76
68
77
69
- uses : r-lib/actions/setup-r@v2
78
70
id : setup-r
79
- with :
80
- r-version : " 4.4.1"
71
+ with : { r-version: "4.4.1" }
81
72
82
73
- name : Cache GAMS installer and R packages
83
74
uses : actions/cache@v4
@@ -95,45 +86,21 @@ jobs:
95
86
license : ${{ secrets.GAMS_LICENSE }}
96
87
97
88
- name : Set RETICULATE_PYTHON
98
- # Use the environment variable set by the setup-python action, above.
99
- run : echo "RETICULATE_PYTHON=$pythonLocation " >> $GITHUB_ENV
89
+ # Retrieve the Python executable set up above
90
+ run : echo "RETICULATE_PYTHON=$(uv python find) " >> $GITHUB_ENV
100
91
shell : bash
101
92
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
93
+ - name : Install the package and dependencies
94
+ # [docs] requires [tests] which requires [report,tutorial]
95
+ run : uv pip install .[docs]
113
96
114
- - name : Install R dependencies and tutorial requirements
115
- # Workaround for https://github.com/actions/runner-images/issues/11137
116
- if : ${{ matrix.os == 'ubuntu-latest' && matrix.python-version == '3.12' }}
117
- run : |
118
- install.packages(c("remotes", "Rcpp"))
119
- remotes::install_cran(
120
- c("IRkernel", "reticulate"),
121
- dependencies = TRUE,
122
- # force = TRUE,
123
- )
124
-
125
- reticulate::py_config()
126
- shell : Rscript {0}
97
+ - name : " Install libpng-dev" # for R 'png', required by reticulate
98
+ if : startsWith(matrix.os, 'ubuntu-')
99
+ run : sudo apt install libpng-dev
127
100
128
101
- name : Install R dependencies and tutorial requirements
129
- if : ${{ ! (matrix.os == 'ubuntu-latest' && matrix.python-version == '3.12') }}
130
102
run : |
131
- install.packages(c("remotes", "Rcpp"))
132
- remotes::install_cran(
133
- c("IRkernel", "reticulate"),
134
- dependencies = TRUE,
135
- # force = TRUE,
136
- )
103
+ install.packages(c("IRkernel", "reticulate"))
137
104
138
105
# commented: for debugging
139
106
# print(reticulate::py_config())
@@ -142,23 +109,20 @@ jobs:
142
109
IRkernel::installspec()
143
110
shell : Rscript {0}
144
111
145
- - name : Run test suite using pytest
112
+ - name : Run tests
146
113
run : |
147
- pytest ixmp \
114
+ uv run --no-sync \
115
+ pytest ixmp \
148
116
-m "not performance" \
149
- --color=yes -rA --verbose \
117
+ --color=yes --durations=20 - rA --verbose \
150
118
--cov-report=xml \
151
119
--numprocesses=auto --dist=loadgroup
152
120
shell : bash
153
121
154
122
- name : Upload test coverage to Codecov.io
155
123
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
124
with :
161
- token : ${{ secrets.CODECOV_TOKEN }} # required
125
+ token : ${{ secrets.CODECOV_TOKEN}}
162
126
163
127
pre-commit :
164
128
name : Code quality
@@ -167,12 +131,11 @@ jobs:
167
131
168
132
steps :
169
133
- 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
134
+ - uses : astral-sh/setup-uv@v5
135
+ with : { cache-dependency-glob: "**/pyproject.toml" }
136
+ - uses : actions/cache@v4
137
+ with :
138
+ path : ~/.cache/pre-commit
139
+ key : pre-commit|${{ env.UV_PYTHON }}|${{ hashFiles('.pre-commit-config.yaml') }}
140
+ lookup-only : ${{ github.event_name == 'schedule' }} # Set 'true' to recreate cache
141
+ - run : uvx pre-commit run --all-files --color=always --show-diff-on-failure
0 commit comments