1414 - cron : " 0 0 1,16 * *"
1515
1616jobs :
17+ mypy :
18+ runs-on : ubuntu-latest
19+ strategy :
20+ fail-fast : false
21+ matrix :
22+ python-version :
23+ - " 3.10"
24+ - " 3.11"
25+ - " 3.12"
26+ - " 3.13"
27+ steps :
28+ - uses : actions/checkout@v4
29+ - uses : astral-sh/setup-uv@v5
30+ with :
31+ enable-cache : false
32+ - name : Setup Python ${{ matrix.python-version }}
33+ uses : actions/setup-python@v5
34+ id : python-setup
35+ with :
36+ python-version : ${{ matrix.python-version }}
37+ - run : uvx nox -s mypy --python ${{ matrix.python-version }}
1738 check_conventions :
1839 runs-on : ubuntu-latest
1940 strategy :
2041 fail-fast : false
2142 matrix :
2243 include :
23- - nox-sessions : " ruff_format ruff_lint check_yaml check_json check_toml check_eof check_trailing_space check_lf"
24- python-version : " 3.x"
44+ - python-version : " 3.x"
2545 node-version : " 16.x"
26- - nox-sessions : " mypy"
27- python-version : " 3.9"
28- - nox-sessions : " mypy"
29- python-version : " 3.10"
30- - nox-sessions : " mypy"
31- python-version : " 3.11"
32- - nox-sessions : " mypy"
33- python-version : " 3.12"
3446 steps :
3547 - uses : actions/checkout@v4
3648 - name : Setup Node.js
37- if : matrix.node-version
3849 uses : actions/setup-node@v4
3950 with :
4051 node-version : ${{ matrix.node-version }}
52+ - uses : astral-sh/setup-uv@v5
53+ with :
54+ enable-cache : false
4155 - name : Setup Python ${{ matrix.python-version }}
4256 uses : actions/setup-python@v5
4357 id : python-setup
4458 with :
4559 python-version : ${{ matrix.python-version }}
4660 - name : Cache node.js modules
47- if : matrix.node-version
4861 uses : actions/cache@v4
4962 with :
5063 path : " **/node_modules"
5164 key : ${{ runner.os }}-${{ matrix.node-version }}-node_modules-${{ hashFiles('**/package-lock.json') }}
52- - name : Cache nox environments
53- uses : actions/cache@v4
54- if : matrix.node-version
55- with :
56- path : |
57- .nox/ruff_*
58- .nox/check_*
59- key : nox-${{ steps.python-setup.outputs.python-version }}-${{ hashFiles('requirements/dev-ruff.txt', 'requirements/dev-pre_commit_hooks.txt') }}
6065 - run : npm install
61- if : matrix.node-version
6266 - run : npm run check
63- if : matrix.node-version
64- - run : pipx run nox -s ${{ matrix.nox-sessions }}
67+ - run : uvx nox -s ruff_format ruff_lint check_yaml check_json check_toml check_eof check_trailing_space check_lf
6568
6669 build :
67- needs : [check_conventions]
70+ needs : ["mypy", " check_conventions" ]
6871 strategy :
6972 fail-fast : false
7073 matrix :
8689 uses : actions/setup-node@v4
8790 with :
8891 node-version : ${{ matrix.node-version }}
92+ - uses : astral-sh/setup-uv@v5
93+ with :
94+ enable-cache : false
8995 - name : Set up Python ${{ matrix.python-version }}
9096 uses : actions/setup-python@v5
9197 with :
@@ -98,19 +104,21 @@ jobs:
98104 - run : npm install
99105 - name : Check for dirty working directory
100106 run : git diff --exit-code
101- - run : python -m pip install nox
102107 - name : Build distributions
103108 id : dist
104- run : nox -s dist
109+ run : uvx nox -s build
105110 - name : Install wheel
106- run : python -m pip install "${{ steps.dist.outputs.wheel }}"
111+ run : |
112+ uv venv install-test-venv
113+ export VIRTUAL_ENV="${PWD}/install-test-venv"
114+ uv pip install dist/*.whl
115+ shell : bash
107116 - name : Upload wheels as artifacts
108117 uses : actions/upload-artifact@v4
109118 with :
110119 name : python-packages-${{ runner.os }}
111120 path : |
112121 dist/*.whl
113- dist/*.tar.*
114122 - name : Setup Graphviz
115123 uses : ts-graphviz/setup-graphviz@b1de5da23ed0a6d14e0aeee8ed52fdd87af2363c # v2.0.2
116124 with :
@@ -122,7 +130,7 @@ jobs:
122130 - name : Build docs
123131 env :
124132 SPHINX_IMMATERIAL_EXTERNAL_RESOURCE_CACHE_DIR : ${{ github.workspace }}/theme_build_cache
125- run : nox -s docs --forcecolor
133+ run : uvx nox -s docs --forcecolor
126134 - name : Upload doc builds as artifacts
127135 uses : actions/upload-artifact@v4
128136 with :
@@ -136,7 +144,7 @@ jobs:
136144 publish_dir : ./docs/_build/html
137145
138146 test :
139- needs : [check_conventions, build]
147+ needs : [" build" ]
140148 strategy :
141149 fail-fast : false
142150 matrix :
@@ -145,10 +153,10 @@ jobs:
145153 - " windows-latest"
146154 - " macos-latest"
147155 python-version :
148- - " 3.9"
149156 - " 3.10"
150157 - " 3.11"
151158 - " 3.12"
159+ - " 3.13"
152160 node-version :
153161 - " 16.x"
154162 runs-on : ${{ matrix.os }}
@@ -157,6 +165,9 @@ jobs:
157165 - uses : actions/setup-node@v4
158166 with :
159167 node-version : ${{ matrix.node-version }}
168+ - uses : astral-sh/setup-uv@v5
169+ with :
170+ enable-cache : false
160171 - name : Setup python
161172 uses : actions/setup-python@v5
162173 with :
@@ -183,7 +194,7 @@ jobs:
183194 COVERAGE_FILE : .coverage.${{ github.run_id }}.${{ github.run_attempt }}.${{ runner.os }}.${{ matrix.python-version }}
184195 PY_COLORS : 1
185196 # `coverage run` cmd adds the working dir to python path, so no need to install pkg here
186- run : pipx run nox -s tests --forcecolor --python ${{ matrix.python-version }}
197+ run : uvx nox -s tests --forcecolor --python ${{ matrix.python-version }}
187198 - name : Upload coverage data
188199 uses : actions/upload-artifact@v4
189200 with :
@@ -202,12 +213,15 @@ jobs:
202213 path : ci-artifacts
203214 pattern : coverage-data-*
204215 - run : mv ci-artifacts/**/.coverage* ./
216+ - uses : astral-sh/setup-uv@v5
217+ with :
218+ enable-cache : false
205219 - name : Setup python
206220 uses : actions/setup-python@v5
207221 with :
208222 python-version : " 3.x"
209223 - name : Create coverage report
210- run : pipx run nox -s coverage
224+ run : uvx nox -s coverage
211225 - name : Post coverage summary
212226 if : github.repository == 'jbms/sphinx-immaterial'
213227 uses : codecov/codecov-action@v4
0 commit comments