Skip to content

Commit e280510

Browse files
authored
Merge pull request #228 from effigies/mnt/pyproject
chore: Transition to pyproject.toml and tox, support numpy 2, python 3.13
2 parents e7757e2 + 2d01dfd commit e280510

File tree

11 files changed

+334
-291
lines changed

11 files changed

+334
-291
lines changed

.github/workflows/pythonpackage.yml

Lines changed: 0 additions & 96 deletions
This file was deleted.

.github/workflows/tox.yml

Lines changed: 130 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,130 @@
1+
name: Tox
2+
3+
on:
4+
push:
5+
branches: [ master, main, 'maint/*' ]
6+
tags: [ '*' ]
7+
pull_request:
8+
branches: [ master, main, 'maint/*' ]
9+
schedule:
10+
- cron: '0 0 * * *'
11+
12+
concurrency:
13+
group: ${{ github.workflow }}-${{ github.ref }}
14+
cancel-in-progress: true
15+
16+
permissions:
17+
contents: read
18+
19+
env:
20+
# Force tox and pytest to use color
21+
FORCE_COLOR: true
22+
TEST_DATA_HOME: /home/runner/testdata/nitransforms-tests
23+
24+
jobs:
25+
cache-test-data:
26+
if: "!contains(github.event.head_commit.message, '[skip ci]')"
27+
runs-on: ubuntu-latest
28+
outputs:
29+
SHA: ${{ steps.test-head.outputs.SHA }}
30+
steps:
31+
- name: Install the latest version of uv
32+
uses: astral-sh/setup-uv@v3
33+
- name: Git settings (pacify DataLad)
34+
run: |
35+
git config --global user.name 'NiPreps Bot'
36+
git config --global user.email '[email protected]'
37+
- name: Install DataLad
38+
run: |
39+
$CONDA/bin/conda install -c conda-forge git-annex
40+
uv tool install --with=datalad-next --with=datalad-osf datalad
41+
- name: Check remote HEAD
42+
id: test-head
43+
run: |
44+
git ls-remote https://gin.g-node.org/oesteban/nitransforms-tests \
45+
| awk '/HEAD/{ print "SHA=" $1 }' >> $GITHUB_OUTPUT
46+
47+
- uses: actions/cache@v4
48+
with:
49+
path: ${{ env.TEST_DATA_HOME }}
50+
key: data-cache-v2-${{ steps.test-head.outputs.SHA }}
51+
restore-keys: |
52+
data-cache-v2-${{ steps.test-head.outputs.SHA }}
53+
data-cache-v2
54+
55+
- name: Install test data
56+
run: |
57+
export PATH=$CONDA/bin:$PATH
58+
mkdir -p /home/runner/testdata
59+
60+
datalad install -s https://gin.g-node.org/oesteban/nitransforms-tests $TEST_DATA_HOME
61+
datalad update --merge -d $TEST_DATA_HOME
62+
datalad get -J 2 -d $TEST_DATA_HOME
63+
64+
test:
65+
runs-on: ubuntu-latest
66+
needs: [cache-test-data]
67+
strategy:
68+
matrix:
69+
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
70+
dependencies: [latest, pre]
71+
include:
72+
- python-version: "3.9"
73+
dependencies: min
74+
exclude:
75+
# Do not test pre-releases for versions out of SPEC0
76+
- python-version: "3.9"
77+
dependencies: pre
78+
- python-version: "3.10"
79+
dependencies: pre
80+
81+
env:
82+
DEPENDS: ${{ matrix.dependencies }}
83+
84+
steps:
85+
- uses: actions/checkout@v4
86+
with:
87+
submodules: recursive
88+
fetch-depth: 0
89+
- name: Install the latest version of uv
90+
uses: astral-sh/setup-uv@v3
91+
- uses: actions/cache/restore@v4
92+
with:
93+
path: ${{ env.TEST_DATA_HOME }}
94+
key: data-cache-v2-${{ needs.cache-test-data.outputs.SHA }}
95+
- name: Set up Python ${{ matrix.python-version }}
96+
uses: actions/setup-python@v5
97+
with:
98+
python-version: ${{ matrix.python-version }}
99+
- name: Display Python version
100+
run: python -c "import sys; print(sys.version)"
101+
- name: Install tox
102+
run: |
103+
uv tool install tox --with=tox-uv --with=tox-gh-actions
104+
- name: Show tox config
105+
run: tox c
106+
- name: Run tox
107+
run: tox -v --exit-and-dump-after 1200
108+
- uses: codecov/codecov-action@v4
109+
with:
110+
file: coverage.xml
111+
token: ${{ secrets.CODECOV_TOKEN }}
112+
if: ${{ always() }}
113+
114+
checks:
115+
runs-on: 'ubuntu-latest'
116+
continue-on-error: true
117+
strategy:
118+
matrix:
119+
check: ['style']
120+
121+
steps:
122+
- uses: actions/checkout@v4
123+
- name: Install the latest version of uv
124+
uses: astral-sh/setup-uv@v3
125+
- name: Show tox config
126+
run: uvx tox c
127+
- name: Show tox config (this call)
128+
run: uvx tox c -e ${{ matrix.check }}
129+
- name: Run check
130+
run: uvx tox -e ${{ matrix.check }}

.github/workflows/travis.yml

Lines changed: 0 additions & 91 deletions
This file was deleted.

.readthedocs.yaml

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,21 @@
1-
# Read the Docs configuration file
2-
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details
3-
41
version: 2
52

63
build:
7-
os: ubuntu-20.04
4+
os: ubuntu-lts-latest
85
tools:
9-
python: "3.8"
10-
11-
sphinx:
12-
configuration: docs/conf.py
6+
python: latest
137

14-
python:
15-
install:
16-
- path: .
17-
extra_requirements:
18-
- all
19-
- requirements: docs/requirements.txt
8+
jobs:
9+
pre_create_environment:
10+
- asdf plugin add uv
11+
- asdf install uv latest
12+
- asdf global uv latest
13+
# Turn `python -m virtualenv` into `python -c pass`
14+
- truncate --size 0 $( dirname $( uv python find ) )/../lib/python3*/site-packages/virtualenv/__main__.py
15+
post_create_environment:
16+
- uv venv $READTHEDOCS_VIRTUALENV_PATH
17+
# Turn `python -m pip` into `python -c pass`
18+
- truncate --size 0 $( ls -d $READTHEDOCS_VIRTUALENV_PATH/lib/python3* )/site-packages/pip.py
19+
post_install:
20+
- VIRTUAL_ENV=$READTHEDOCS_VIRTUALENV_PATH uv pip install --cache-dir $READTHEDOCS_VIRTUALENV_PATH/../../uv_cache .[niftiext]
21+
- VIRTUAL_ENV=$READTHEDOCS_VIRTUALENV_PATH uv pip install --cache-dir $READTHEDOCS_VIRTUALENV_PATH/../../uv_cache -r docs/requirements.txt

MANIFEST.in

Lines changed: 0 additions & 7 deletions
This file was deleted.

docs/conf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@
7676
#
7777
# This is also used if you do content translation via gettext catalogs.
7878
# Usually you set "language" from the command line for these cases.
79-
language = None
79+
language = 'en'
8080

8181
# List of patterns, relative to source directory, that match files and
8282
# directories to ignore when looking for source files.

docs/requirements.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,5 @@ packaging
44
pydot>=1.2.3
55
pydotplus
66
sphinx-argparse
7-
sphinx ~= 4.0
8-
sphinx_rtd_theme
7+
sphinx~=7.0
8+
sphinx_rtd_theme

0 commit comments

Comments
 (0)