Skip to content

Commit 32dfc74

Browse files
committed
chore(ci): Switch to using tox-uv
1 parent 087d867 commit 32dfc74

File tree

2 files changed

+35
-18
lines changed

2 files changed

+35
-18
lines changed

.github/workflows/build-test-publish.yml

Lines changed: 22 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -49,15 +49,22 @@ jobs:
4949
AFNI_IMSAVE_WARNINGS: NO
5050
AFNI_TTATLAS_DATASET: /opt/afni/atlases
5151
AFNI_PLUGINPATH: /opt/afni/plugins
52+
MARKS: ${{ matrix.marks }}
53+
DEPENDS: ${{ matrix.dependencies }}
5254
strategy:
53-
max-parallel: 6
5455
matrix:
5556
python-version: ["3.9", "3.10", "3.11", "3.12"]
56-
marks: ["not slow"]
57+
dependencies: ["latest", "pre"]
58+
marks: ["fast"]
5759
include:
5860
- python-version: "3.9"
59-
marks: "slow and not veryslow"
61+
dependencies: "min"
62+
marks: "fast"
63+
- python-version: "3.9"
64+
dependencies: "latest"
65+
marks: "slow"
6066
- python-version: "3.12"
67+
dependencies: "latest"
6168
marks: "veryslow"
6269

6370
steps:
@@ -94,6 +101,8 @@ jobs:
94101
run: |
95102
git config --global user.name 'NiPreps Bot'
96103
git config --global user.email '[email protected]'
104+
- name: Install the latest version of uv
105+
uses: astral-sh/setup-uv@v4
97106
- name: Set up Python ${{ matrix.python-version }}
98107
uses: conda-incubator/setup-miniconda@v3
99108
with:
@@ -114,8 +123,9 @@ jobs:
114123
python-${{ matrix.python-version }}-${{ env.CACHE_NUM }}
115124
- name: Install DataLad
116125
run: |
117-
conda install git-annex=*=alldep* pip
118-
pip install datalad datalad-osf
126+
conda install git-annex=*=alldep*
127+
uv tool install datalad --with=datalad-next --with=datalad-osf
128+
uv tool install datalad-osf --with=datalad-next
119129
- name: Install fsl and ANTs
120130
run: |
121131
conda install fsl-fugue fsl-topup ants
@@ -198,18 +208,16 @@ jobs:
198208
mkdir -p $( dirname $FS_LICENSE )
199209
echo "b2VzdGViYW5Ac3RhbmZvcmQuZWR1CjMwNzU2CiAqQ1MzYkJ5VXMxdTVNCiBGU2kvUGJsejJxR1V3Cg==" | base64 -d > $FS_LICENSE
200210
201-
- name: Run pytest with coverage
211+
- name: Install tox
202212
run: |
203-
export PATH=${AFNI_HOME}:$PATH
204-
export FSLDIR=${CONDA_PREFIX}
205-
pytest -v --cov sdcflows --cov-report xml:cov.xml --doctest-modules -n auto sdcflows \
206-
--durations=20 --durations-min=10 -m "$MARKS"
207-
env:
208-
MARKS: ${{ matrix.marks }}
213+
uv tool install tox --with=tox-uv --with=tox-gh-actions
214+
- name: Show tox config
215+
run: tox c
216+
- name: Run tox
217+
run: tox -v --exit-and-dump-after 1200
209218

210-
- uses: codecov/codecov-action@v4
219+
- uses: codecov/codecov-action@v5
211220
with:
212-
file: cov.xml
213221
token: ${{ secrets.CODECOV_TOKEN }}
214222
if: ${{ always() }}
215223

tox.ini

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@ requires =
33
tox>=4
44
tox-uv
55
envlist =
6-
py3{9,10,11,12,13}-latest
7-
py39-min
8-
py3{11,12,13}-pre
6+
py3{9,10,11,12,13}-latest-{fast,slow,veryslow}
7+
py39-min-fast
8+
py3{11,12,13}-pre-{fast,slow,veryslow}
99
style
1010
spellcheck
1111
skip_missing_interpreters = true
@@ -25,6 +25,11 @@ DEPENDS =
2525
latest: latest
2626
pre: pre
2727

28+
MARKS =
29+
fast: fast
30+
slow: slow
31+
veryslow: veryslow
32+
2833
[testenv]
2934
description = Pytest with coverage
3035
labels = test
@@ -68,7 +73,11 @@ uv_resolution =
6873
min: lowest-direct
6974

7075
commands =
71-
pytest --durations=20 --durations-min=1.0 --cov-report term-missing {posargs:-n auto}
76+
pytest --durations=20 --durations-min=1.0 --cov-report term-missing \
77+
fast: -m "not slow" \
78+
slow: -m "slow and not veryslow" \
79+
veryslow: -m "veryslow" \
80+
{posargs:-n auto}
7281

7382
[testenv:style]
7483
description = Check our style guide

0 commit comments

Comments
 (0)