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
run : |
@@ -127,23 +107,20 @@ jobs:
127
107
# reticulate::py_run_string("import os; print(os.environ)")
128
108
shell : Rscript {0}
129
109
130
- - name : Run test suite using pytest
110
+ - name : Run tests
131
111
run : |
132
- pytest ixmp \
112
+ uv run --no-sync \
113
+ pytest ixmp \
133
114
-m "not performance" \
134
- --color=yes -rA --verbose \
115
+ --color=yes --durations=20 - rA --verbose \
135
116
--cov-report=xml \
136
117
--numprocesses=auto --dist=loadgroup
137
118
shell : bash
138
119
139
120
- name : Upload test coverage to Codecov.io
140
121
uses : codecov/codecov-action@v5
141
- # FIXME Limit runtime until
142
- # https://github.com/codecov/codecov-action/issues/1316 is resolved
143
- timeout-minutes : 1
144
- continue-on-error : true
145
122
with :
146
- token : ${{ secrets.CODECOV_TOKEN }} # required
123
+ token : ${{ secrets.CODECOV_TOKEN}}
147
124
148
125
pre-commit :
149
126
name : Code quality
@@ -152,12 +129,11 @@ jobs:
152
129
153
130
steps :
154
131
- uses : actions/checkout@v4
155
- - uses : actions/setup-python@v5
156
- with : { python-version: "3.12" }
157
-
158
- - name : Force recreation of pre-commit virtual environment for mypy
159
- if : github.event_name == 'schedule'
160
- run : gh cache list -L 999 | cut -f2 | grep pre-commit | xargs -I{} gh cache delete "{}" || true
161
- env : { GH_TOKEN: "${{ github.token }}" }
162
-
163
- -
uses :
pre-commit/[email protected]
132
+ - uses : astral-sh/setup-uv@v5
133
+ with : { cache-dependency-glob: "**/pyproject.toml" }
134
+ - uses : actions/cache@v4
135
+ with :
136
+ path : ~/.cache/pre-commit
137
+ key : pre-commit|${{ env.UV_PYTHON }}|${{ hashFiles('.pre-commit-config.yaml') }}
138
+ lookup-only : ${{ github.event_name == 'schedule' }} # Set 'true' to recreate cache
139
+ - run : uvx pre-commit run --all-files --color=always --show-diff-on-failure
0 commit comments