Skip to content

Commit ac69db0

Browse files
authored
Merge branch 'master' into enh/89-collapse-nonlinear
2 parents fbc9228 + 6f497c0 commit ac69db0

60 files changed

Lines changed: 9531 additions & 1377 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.circleci/config.yml

Lines changed: 22 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ version: 2
22
jobs:
33
build_pytest:
44
machine:
5-
image: ubuntu-2004:202107-02
5+
image: default
66
working_directory: /tmp/src/nitransforms
77
environment:
88
TZ: "/usr/share/zoneinfo/America/Los_Angeles"
@@ -12,9 +12,9 @@ jobs:
1212
- checkout
1313
- restore_cache:
1414
keys:
15-
- env-v3-{{ .Branch }}-
16-
- env-v3-master-
17-
- env-v3-
15+
- env-v6-{{ .Branch }}-
16+
- env-v6-master-
17+
- env-v6-
1818
- run:
1919
name: Setup git-annex
2020
command: |
@@ -29,17 +29,14 @@ jobs:
2929
- run:
3030
name: Setup DataLad
3131
command: |
32-
export PY3=$(pyenv versions | grep '3\.' |
33-
sed -e 's/.* 3\./3./' -e 's/ .*//')
34-
pyenv local $PY3
35-
python -m pip install --no-cache-dir -U pip "setuptools >= 45.0" "setuptools_scm[toml] >= 3.4"
36-
python -m pip install --no-cache-dir -U datalad datalad-osf
32+
python3 -m pip install --no-cache-dir -U pip "setuptools >= 45.0" "setuptools_scm[toml] >= 6.2"
33+
python3 -m pip install --no-cache-dir -U datalad datalad-osf
3734
3835
- save_cache:
39-
key: env-v3-{{ .Branch }}-{{ .BuildNum }}
36+
key: env-v6-{{ .Branch }}-{{ .BuildNum }}
4037
paths:
4138
- /opt/circleci/git-annex.linux
42-
- /opt/circleci/.pyenv/versions/3.9.4
39+
- /opt/circleci/.pyenv/versions
4340

4441
- restore_cache:
4542
keys:
@@ -49,10 +46,9 @@ jobs:
4946
- run:
5047
name: Install test data from GIN
5148
command: |
52-
export PY3=$(pyenv versions | grep '3\.' |
53-
sed -e 's/.* 3\./3./' -e 's/ .*//')
54-
pyenv local $PY3
5549
export PATH=/opt/circleci/git-annex.linux:$PATH
50+
pyenv local 3
51+
eval "$(pyenv init --path)"
5652
mkdir -p /tmp/data
5753
cd /tmp/data
5854
datalad install -r https://gin.g-node.org/oesteban/nitransforms-tests
@@ -98,15 +94,12 @@ jobs:
9894
name: Build Docker image & push to registry
9995
no_output_timeout: 60m
10096
command: |
101-
export PY3=$(pyenv versions | grep '3\.' |
102-
sed -e 's/.* 3\./3./' -e 's/ .*//')
103-
pyenv local $PY3
10497
e=1 && for i in {1..5}; do
10598
docker build --rm --cache-from=nitransforms:latest \
10699
-t nitransforms:latest \
107100
--build-arg BUILD_DATE=`date -u +"%Y-%m-%dT%H:%M:%SZ"` \
108101
--build-arg VCS_REF=`git rev-parse --short HEAD` \
109-
--build-arg VERSION=$( python3 setup.py --version ) . \
102+
--build-arg VERSION=$( python3 -m setuptools_scm ) . \
110103
&& e=0 && break || sleep 15
111104
done && [ "$e" -eq "0" ]
112105
docker tag nitransforms:latest localhost:5000/nitransforms
@@ -123,10 +116,7 @@ jobs:
123116
- run:
124117
name: Check version packaged in Docker image
125118
command: |
126-
export PY3=$(pyenv versions | grep '3\.' |
127-
sed -e 's/.* 3\./3./' -e 's/ .*//')
128-
pyenv local $PY3
129-
THISVERSION=${CIRCLE_TAG:-$(python3 setup.py --version)}
119+
THISVERSION=${CIRCLE_TAG:-$(python3 -m setuptools_scm)}
130120
INSTALLED_VERSION=$(\
131121
docker run -it --rm --entrypoint=python nitransforms \
132122
-c 'import nitransforms as nit; print(nit.__version__, end="")' )
@@ -141,13 +131,14 @@ jobs:
141131
echo "cHJpbnRmICJrcnp5c3p0b2YuZ29yZ29sZXdza2lAZ21haWwuY29tXG41MTcyXG4gKkN2dW12RVYzelRmZ1xuRlM1Si8yYzFhZ2c0RVxuIiA+IGxpY2Vuc2UudHh0Cg==" | base64 -d | sh
142132
- run:
143133
name: Get codecov
144-
command: python -m pip install codecov
134+
command: python3 -m pip install codecov
145135
- run:
146136
name: Run unit tests
147137
no_output_timeout: 2h
148138
command: |
149139
mkdir -p /tmp/tests/{artifacts,summaries}
150-
docker run -u $( id -u ) -it --rm -w /src/nitransforms \
140+
docker run -u $( id -u ) -it --rm \
141+
-w /src/nitransforms -v $PWD:/src/nitransforms \
151142
-v /tmp/data/nitransforms-tests:/data -e TEST_DATA_HOME=/data \
152143
-e COVERAGE_FILE=/tmp/summaries/.pytest.coverage \
153144
-v /tmp/fslicense/license.txt:/opt/freesurfer/license.txt:ro \
@@ -159,7 +150,7 @@ jobs:
159150
name: Submit unit test coverage
160151
command: |
161152
cd /tmp/src/nitransforms
162-
python -m codecov --file /tmp/tests/summaries/unittests.xml \
153+
python3 -m codecov --file /tmp/tests/summaries/unittests.xml \
163154
--flags unittests -e CIRCLE_JOB
164155
- run:
165156
name: Clean up tests directory
@@ -186,9 +177,9 @@ jobs:
186177
command: |
187178
python3 -m venv /tmp/buildenv
188179
source /tmp/buildenv/bin/activate
189-
python3 -m pip install "setuptools >= 45.0" wheel "setuptools_scm[toml] >= 3.4" \
180+
python3 -m pip install "setuptools >= 45.0" build wheel "setuptools_scm[toml] >= 6.2" \
190181
"pip>=10.0.1" twine docutils
191-
python setup.py sdist bdist_wheel
182+
python3 -m build
192183
twine check dist/nitransforms*
193184
- store_artifacts:
194185
path: /tmp/src/nitransforms/dist
@@ -200,9 +191,9 @@ jobs:
200191
command: |
201192
python3 -m venv /tmp/install_sdist
202193
source /tmp/install_sdist/bin/activate
203-
python3 -m pip install "setuptools >= 45.0" "pip>=10.0.1"
194+
python3 -m pip install "setuptools >= 45.0" "pip>=10.0.1" "setuptools_scm[toml] >= 6.2"
204195
205-
THISVERSION=$( python3 setup.py --version )
196+
THISVERSION=$( python3 -m setuptools_scm )
206197
THISVERSION=${CIRCLE_TAG:-$THISVERSION}
207198
python3 -m pip install dist/nitransforms*.tar.gz
208199
INSTALLED_VERSION=$(python3 -c 'import nitransforms as nit; print(nit.__version__, end="")')
@@ -214,9 +205,9 @@ jobs:
214205
command: |
215206
python3 -m venv /tmp/install_wheel
216207
source /tmp/install_wheel/bin/activate
217-
python3 -m pip install "setuptools >= 45.0" "pip>=10.0.1"
208+
python3 -m pip install "setuptools >= 45.0" "pip>=10.0.1" "setuptools_scm[toml] >= 6.2"
218209
219-
THISVERSION=$( python3 setup.py --version )
210+
THISVERSION=$( python3 -m setuptools_scm )
220211
THISVERSION=${CIRCLE_TAG:-$THISVERSION}
221212
python3 -m pip install dist/nitransforms*.whl
222213
INSTALLED_VERSION=$(python3 -c 'import nitransforms as nit; print(nit.__version__, end="")')

.github/dependabot.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: "github-actions"
4+
directory: "/"
5+
schedule:
6+
interval: "monthly"
7+
groups:
8+
actions-infrastructure:
9+
patterns:
10+
- "actions/*"

.github/workflows/pythonpackage.yml

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

.github/workflows/tox.yml

Lines changed: 129 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,129 @@
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@v6
33+
- name: Git settings (pacify DataLad)
34+
run: |
35+
git config --global user.name 'NiPreps Bot'
36+
git config --global user.email 'nipreps@gmail.com'
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@v6
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@v5
109+
with:
110+
token: ${{ secrets.CODECOV_TOKEN }}
111+
if: ${{ always() }}
112+
113+
checks:
114+
runs-on: 'ubuntu-latest'
115+
continue-on-error: true
116+
strategy:
117+
matrix:
118+
check: ['style']
119+
120+
steps:
121+
- uses: actions/checkout@v4
122+
- name: Install the latest version of uv
123+
uses: astral-sh/setup-uv@v6
124+
- name: Show tox config
125+
run: uvx tox c
126+
- name: Show tox config (this call)
127+
run: uvx tox c -e ${{ matrix.check }}
128+
- name: Run check
129+
run: uvx tox -e ${{ matrix.check }}

0 commit comments

Comments
 (0)