2828 --ignore={project}//tests//test_doctest.py
2929 --ignore={project}//tests//test_modname.py
3030 CIBW_DEPENDENCY_VERSIONS : " pinned"
31- # Configuration for the architecture-agnostic jobs
32- PY_VERSION : " 3.12" # Keep in sync with version in environment.yml
3331
3432
3533jobs :
@@ -38,27 +36,13 @@ jobs:
3836 runs-on : ubuntu-latest
3937 steps :
4038 - uses : actions/checkout@v4
41- - uses : actions-rs/toolchain@v1
39+ - uses : prefix-dev/setup-pixi@v0.9.6
4240 with :
43- toolchain : 1.95.0
44- override : true
45- components : rustfmt, clippy
46- - uses : actions/setup-python@v5
47- with :
48- python-version : " 3.12"
49- - name : Install ruff
50- # Keep in sync with the corresponding versions in pyproject.toml
51- run : pip install ruff==0.9.7 numpydoc==1.8.0
52- - name : Check code formatting
53- run : ruff format --diff
54- - name : Lint code base
55- run : ruff check
56- - name : Check docstring formatting
57- run : numpydoc lint src/biotite/**/*.py
58- - name : Check Rust formatting
59- run : cargo fmt --check
60- - name : Check Rust lints
61- run : cargo clippy -- -Dwarnings
41+ environments : lint
42+ cache : true
43+ cache-write : ${{ github.event_name == 'push' && github.ref_name == 'main' }}
44+ - name : Check code style and type annotations
45+ run : pixi run lint
6246
6347
6448 build-internal :
@@ -71,28 +55,14 @@ jobs:
7155 # so 'switcher.py' works correctly in 'docs' job
7256 fetch-depth : 0
7357 fetch-tags : true
74- - uses : actions /setup-python@v5
58+ - uses : prefix-dev /setup-pixi@v0.9.6
7559 with :
76- python-version : ${{ env.PY_VERSION }}
77- - name : Get current CCD for hashing
78- run : wget https://files.wwpdb.org/pub/pdb/data/monomers/components.cif.gz
79- - name : Cache CCD
80- uses : actions/cache@v4
81- id : cache-ccd
82- with :
83- path : ./src/biotite/structure/info/components.bcif
84- key : cache-${{ hashFiles('src/biotite/setup_ccd.py') }}-${{ hashFiles('components.cif.gz') }}
85- - name : Remove CCD used for hashing
86- run : rm components.cif.gz
87- - name : Build internal CCD
88- if : steps.cache-ccd.outputs.cache-hit != 'true'
89- run : |
90- pip install -e .
91- python -m biotite.setup_ccd
92- - name : Install build backend
93- run : pip install build
94- - name : Build distribution
95- run : python -m build --wheel
60+ environments : test
61+ activate-environment : true
62+ cache : true
63+ cache-write : ${{ github.event_name == 'push' && github.ref_name == 'main' }}
64+ - name : Build CCD and wheel
65+ run : pixi run build-wheel
9666 - uses : actions/upload-artifact@v4
9767 with :
9868 name : internal-build
@@ -201,27 +171,27 @@ jobs:
201171 runs-on : ubuntu-latest
202172 needs :
203173 - build-internal
204- defaults :
205- run :
206- shell : bash -l {0}
207174
208175 steps :
209176 - uses : actions/checkout@v4
210177 - uses : actions/download-artifact@v4
211178 with :
212179 name : internal-build
213180 path : dist
214- - uses : conda-incubator /setup-miniconda@v3
181+ - uses : prefix-dev /setup-pixi@v0.9.6
215182 with :
216- environment-file : environment.yml
217- miniforge-version : latest
218- - name : Install distribution
219- run : pip install ./dist/*.whl
183+ environments : test
184+ activate-environment : true
185+ cache : true
186+ cache-write : ${{ github.event_name == 'push' && github.ref_name == 'main' }}
187+ - name : Install pre-built wheel into the pixi environment
188+ # `--no-deps` because conda already provides all runtime dependencies
189+ run : pixi run python -m pip install --no-deps ./dist/*.whl
220190 - name : Run tests
221191 # Running NCBI BLAST and SRA takes too long
222192 # The tests on the NCBI Entrez database are not reliable enough
223193 run : >
224- pytest
194+ pixi run pytest
225195 --durations=50
226196 --ignore="tests//application//test_blast.py"
227197 --ignore="tests//application//test_sra.py"
@@ -239,27 +209,23 @@ jobs:
239209 runs-on : ubuntu-latest
240210 needs :
241211 - build-internal
242- defaults :
243- run :
244- shell : bash -l {0}
245212
246213 steps :
247214 - uses : actions/checkout@v4
248215 - uses : actions/download-artifact@v4
249216 with :
250217 name : internal-build
251218 path : dist
252- - uses : conda-incubator /setup-miniconda@v3
219+ - uses : prefix-dev /setup-pixi@v0.9.6
253220 with :
254- activate-environment : biotite-dev
255- miniforge-version : latest
256- python-version : ${{ env.PY_VERSION }}
257- - name : Install Muscle 5
258- run : conda install -c bioconda "muscle=5"
259- - name : Install distribution and pytest
260- run : pip install .//dist//*.whl pytest
221+ environments : test-muscle5
222+ activate-environment : true
223+ cache : true
224+ cache-write : ${{ github.event_name == 'push' && github.ref_name == 'main' }}
225+ - name : Install pre-built wheel into the pixi environment
226+ run : pixi run python -m pip install --no-deps ./dist/*.whl
261227 - name : Test Muscle 5 interface
262- run : pytest --durations=50 tests//application//test_msa.py
228+ run : pixi run pytest --durations=50 tests//application//test_msa.py
263229
264230
265231 docs :
@@ -268,9 +234,6 @@ jobs:
268234 runs-on : ubuntu-latest
269235 needs :
270236 - build-internal
271- defaults :
272- run :
273- shell : bash -l {0}
274237 env :
275238 NCBI_API_KEY : ${{ secrets.NCBI_API_KEY }}
276239
@@ -280,10 +243,12 @@ jobs:
280243 with :
281244 name : internal-build
282245 path : dist
283- - uses : conda-incubator /setup-miniconda@v3
246+ - uses : prefix-dev /setup-pixi@v0.9.6
284247 with :
285- environment-file : environment.yml
286- miniforge-version : latest
248+ environments : doc
249+ cache : true
250+ activate-environment : true
251+ cache-write : ${{ github.event_name == 'push' && github.ref_name == 'main' }}
287252 - name : Restore cached partially build docs from a failed previous build
288253 id : cache-docs-restore
289254 uses : actions/cache/restore@v4
@@ -294,18 +259,20 @@ jobs:
294259 doc/examples/gallery
295260 build/doc
296261 build/jupyter_execute
297- - name : Install distribution
298- run : pip install dist/*.whl
262+ - name : Install pre-built wheel into the pixi environment
263+ run : pixi run python -m pip install --no-deps ./dist/*.whl
264+ # Calling `sphinx-build` directly instead of `doc` task
265+ # to avoid the time consuming call of the `install` task
299266 - name : Build base documentation
300- run : sphinx-build -a -D plot_gallery=0 doc build/doc
267+ run : pixi run sphinx-build -a -D plot_gallery=0 doc build/doc
301268 - name : Build tutorial and gallery
302269 if : >
303270 (
304271 github.event_name == 'release' &&
305272 github.event.action == 'published'
306273 )
307274 || github.event_name == 'workflow_dispatch'
308- run : sphinx-build -a doc build/doc
275+ run : pixi run sphinx-build -a doc build/doc
309276 - name : Cache partially built docs from failed build
310277 id : cache-docs-save
311278 if : failure()
@@ -340,15 +307,17 @@ jobs:
340307 with :
341308 name : internal-build
342309 path : dist
343- - uses : actions /setup-python@v5
310+ - uses : prefix-dev /setup-pixi@v0.9.6
344311 with :
345- python-version : ${{ env.PY_VERSION }}
346- - name : Install dependencies
347- run : pip install dist//*.whl pytest pytest-codspeed
312+ environments : test
313+ cache : true
314+ cache-write : ${{ github.event_name == 'push' && github.ref_name == 'main' }}
315+ - name : Install pre-built wheel into the pixi environment
316+ run : pixi run -e test python -m pip install --no-deps ./dist/*.whl
348317 - name : Run benchmarks
349318 uses : CodSpeedHQ/action@v3
350319 with :
351- run : pytest --codspeed benchmarks
320+ run : pixi run -e test pytest --codspeed benchmarks
352321
353322
354323 upload-package :
0 commit comments