Skip to content

Commit

Permalink
chore(ci): Switch to using tox-uv
Browse files Browse the repository at this point in the history
  • Loading branch information
effigies committed Dec 17, 2024
1 parent 087d867 commit 32dfc74
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 18 deletions.
36 changes: 22 additions & 14 deletions .github/workflows/build-test-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,15 +49,22 @@ jobs:
AFNI_IMSAVE_WARNINGS: NO
AFNI_TTATLAS_DATASET: /opt/afni/atlases
AFNI_PLUGINPATH: /opt/afni/plugins
MARKS: ${{ matrix.marks }}
DEPENDS: ${{ matrix.dependencies }}
strategy:
max-parallel: 6
matrix:
python-version: ["3.9", "3.10", "3.11", "3.12"]
marks: ["not slow"]
dependencies: ["latest", "pre"]
marks: ["fast"]
include:
- python-version: "3.9"
marks: "slow and not veryslow"
dependencies: "min"
marks: "fast"
- python-version: "3.9"
dependencies: "latest"
marks: "slow"
- python-version: "3.12"
dependencies: "latest"
marks: "veryslow"

steps:
Expand Down Expand Up @@ -94,6 +101,8 @@ jobs:
run: |
git config --global user.name 'NiPreps Bot'
git config --global user.email '[email protected]'
- name: Install the latest version of uv
uses: astral-sh/setup-uv@v4
- name: Set up Python ${{ matrix.python-version }}
uses: conda-incubator/setup-miniconda@v3
with:
Expand All @@ -114,8 +123,9 @@ jobs:
python-${{ matrix.python-version }}-${{ env.CACHE_NUM }}
- name: Install DataLad
run: |
conda install git-annex=*=alldep* pip
pip install datalad datalad-osf
conda install git-annex=*=alldep*
uv tool install datalad --with=datalad-next --with=datalad-osf
uv tool install datalad-osf --with=datalad-next
- name: Install fsl and ANTs
run: |
conda install fsl-fugue fsl-topup ants
Expand Down Expand Up @@ -198,18 +208,16 @@ jobs:
mkdir -p $( dirname $FS_LICENSE )
echo "b2VzdGViYW5Ac3RhbmZvcmQuZWR1CjMwNzU2CiAqQ1MzYkJ5VXMxdTVNCiBGU2kvUGJsejJxR1V3Cg==" | base64 -d > $FS_LICENSE
- name: Run pytest with coverage
- name: Install tox
run: |
export PATH=${AFNI_HOME}:$PATH
export FSLDIR=${CONDA_PREFIX}
pytest -v --cov sdcflows --cov-report xml:cov.xml --doctest-modules -n auto sdcflows \
--durations=20 --durations-min=10 -m "$MARKS"
env:
MARKS: ${{ matrix.marks }}
uv tool install tox --with=tox-uv --with=tox-gh-actions
- name: Show tox config
run: tox c
- name: Run tox
run: tox -v --exit-and-dump-after 1200

- uses: codecov/codecov-action@v4
- uses: codecov/codecov-action@v5
with:
file: cov.xml
token: ${{ secrets.CODECOV_TOKEN }}
if: ${{ always() }}

Expand Down
17 changes: 13 additions & 4 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ requires =
tox>=4
tox-uv
envlist =
py3{9,10,11,12,13}-latest
py39-min
py3{11,12,13}-pre
py3{9,10,11,12,13}-latest-{fast,slow,veryslow}
py39-min-fast
py3{11,12,13}-pre-{fast,slow,veryslow}
style
spellcheck
skip_missing_interpreters = true
Expand All @@ -25,6 +25,11 @@ DEPENDS =
latest: latest
pre: pre

MARKS =
fast: fast
slow: slow
veryslow: veryslow

[testenv]
description = Pytest with coverage
labels = test
Expand Down Expand Up @@ -68,7 +73,11 @@ uv_resolution =
min: lowest-direct

commands =
pytest --durations=20 --durations-min=1.0 --cov-report term-missing {posargs:-n auto}
pytest --durations=20 --durations-min=1.0 --cov-report term-missing \
fast: -m "not slow" \
slow: -m "slow and not veryslow" \
veryslow: -m "veryslow" \
{posargs:-n auto}

[testenv:style]
description = Check our style guide
Expand Down

0 comments on commit 32dfc74

Please sign in to comment.