Skip to content

Commit 1c81342

Browse files
authored
Merge pull request #106 from templateflow/rel/23.0.0
REL: 23.0.0
2 parents dd08432 + 91c600c commit 1c81342

File tree

6 files changed

+137
-175
lines changed

6 files changed

+137
-175
lines changed

.circleci/config.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ jobs:
2626
pip install -U pip
2727
pip install -r /tmp/src/templateflow/requirements.txt
2828
pip install "datalad ~= 0.11.8"
29-
pip install "setuptools>=45" "setuptools_scm >= 6.2" twine codecov
29+
pip install "setuptools>=45" "setuptools_scm >= 6.2" nipreps-versions build twine codecov
3030
3131
- run:
3232
name: Install git and git-annex
@@ -120,7 +120,7 @@ jobs:
120120
command: |
121121
source /tmp/venv/bin/activate
122122
cd /tmp/src/templateflow
123-
python setup.py sdist
123+
python -m build
124124
twine check dist/*
125125
126126
build_docs:
@@ -150,8 +150,8 @@ jobs:
150150
if ! [ -x "$(command -v conda)" ]; then
151151
curl -sSLO https://repo.anaconda.com/miniconda/Miniconda3-py39_4.11.0-Linux-x86_64.sh
152152
bash Miniconda3-py39_4.11.0-Linux-x86_64.sh -b -p $HOME/.conda
153-
$HOME/.conda/bin/conda env update -f docs/environment.yml --prune
154153
fi
154+
$HOME/.conda/bin/conda env update -f docs/environment.yml --prune
155155
156156
- save_cache:
157157
key: env-v7-{{ .Branch }}
@@ -194,8 +194,8 @@ jobs:
194194
name: Deploy to PyPi
195195
command: |
196196
source /tmp/venv/bin/activate
197-
pip install "setuptools>=45" "setuptools_scm >= 6.2" wheel twine
198-
python setup.py sdist bdist_wheel
197+
pip install build twine
198+
python -m build
199199
twine check dist/*
200200
twine upload dist/*
201201

.github/workflows/pythonpackage.yml

Lines changed: 95 additions & 165 deletions
Original file line numberDiff line numberDiff line change
@@ -10,193 +10,123 @@ on:
1010
pull_request:
1111
branches: [ master ]
1212

13+
concurrency:
14+
group: ${{ github.workflow }}-${{ github.ref }}
15+
cancel-in-progress: true
16+
17+
permissions:
18+
contents: read
19+
1320
jobs:
1421
build:
15-
if: "!startsWith(github.ref, 'refs/tags/') && !contains(github.event.head_commit.message, '[skip ci]')"
1622
runs-on: ubuntu-latest
23+
outputs:
24+
version: ${{ steps.get_version.outputs.version }}
25+
steps:
26+
- uses: actions/checkout@v3
27+
with:
28+
fetch-depth: 0
29+
- uses: actions/setup-python@v4
30+
with:
31+
python-version: 3
32+
- uses: actions/cache@v3
33+
with:
34+
path: ~/.cache/pip
35+
key: pip-cache-v1
36+
restore-keys: |
37+
pip-cache-
38+
- run: pip install --upgrade build twine
39+
- name: Build sdist and wheel
40+
run: python -m build
41+
- run: twine check dist/*
42+
- uses: actions/upload-artifact@v3
43+
with:
44+
name: dist
45+
path: dist/
46+
- name: Interpolate version in confined environment
47+
id: get_version
48+
run: |
49+
python -m venv /tmp/buildenv
50+
source /tmp/buildenv/bin/activate
51+
python -m pip install --upgrade setuptools setuptools_scm nipreps-versions
52+
if [[ "$GITHUB_REF" == refs/tags/* ]]; then
53+
TAG=${GITHUB_REF##*/}
54+
fi
55+
THISVERSION=$( python -m setuptools_scm )
56+
THISVERSION=${TAG:-$THISVERSION}
57+
echo "Expected VERSION: \"${THISVERSION}\""
58+
echo "version=${THISVERSION}" >> $GITHUB_OUTPUT
59+
60+
test-install:
61+
runs-on: ubuntu-latest
62+
needs: build
1763
strategy:
1864
matrix:
19-
python-version: [3.7, 3.8, 3.9]
20-
pip: ["pip==21.2", "pip~=22.0"]
21-
65+
python-version: ['3.7', '3.8', '3.9', '3.10', '3.11']
66+
mode: ['wheel']
67+
include:
68+
- {python-version: '3.9', mode: 'repo'}
69+
- {python-version: '3.9', mode: 'sdist'}
70+
- {python-version: '3.9', mode: 'editable'}
71+
72+
env:
73+
TEMPLATEFLOW_HOME: /tmp/home
74+
THISVERSION: ${{ needs.build.outputs.version }}
2275
steps:
23-
- uses: actions/checkout@v2
24-
- name: Fetch all tags (for setuptools_scm to work)
25-
run: |
26-
/usr/bin/git -c protocol.version=2 fetch --tags --prune --unshallow origin
76+
- uses: actions/checkout@v3
77+
if: matrix.mode == 'repo' || matrix.mode == 'editable'
78+
with:
79+
fetch-depth: 0
80+
- uses: actions/download-artifact@v3
81+
if: matrix.mode == 'sdist' || matrix.mode == 'wheel'
82+
with:
83+
name: dist
84+
path: /tmp/package/
2785
- name: Set up Python ${{ matrix.python-version }}
28-
uses: actions/setup-python@v1
86+
uses: actions/setup-python@v4
2987
with:
3088
python-version: ${{ matrix.python-version }}
31-
- uses: actions/cache@v1
89+
- uses: actions/cache@v3
3290
with:
33-
path: $HOME/.cache/pip
91+
path: ~/.cache/pip
3492
key: pip-cache-v1
3593
restore-keys: |
3694
pip-cache-
37-
38-
- name: Build in confined environment and interpolate version
39-
run: |
40-
python -m venv /tmp/buildenv
41-
source /tmp/buildenv/bin/activate
42-
python -m pip install -U "setuptools >= 45" wheel "setuptools_scm >= 6.2" \
43-
setuptools_scm_git_archive pip twine docutils
44-
python setup.py sdist bdist_wheel
45-
python -m twine check dist/templateflow*
46-
47-
mv dist /tmp/package
48-
rm -rf templateflow.egg-info/
49-
50-
# Interpolate version
51-
if [[ "$GITHUB_REF" == refs/tags/* ]]; then
52-
TAG=${GITHUB_REF##*/}
53-
fi
54-
THISVERSION=$( python setup.py --version )
55-
THISVERSION=${TAG:-$THISVERSION}
56-
echo "Expected VERSION: \"${THISVERSION}\""
57-
echo "THISVERSION=${THISVERSION}" >> $GITHUB_ENV
58-
59-
- name: Install in confined environment [pip]
60-
env:
61-
TEMPLATEFLOW_HOME: /tmp/home/pip
95+
- name: Upgrade pip
96+
run: pip install --upgrade pip wheel
97+
- name: Set install command
6298
run: |
63-
python -m venv /tmp/pip
64-
source /tmp/pip/bin/activate
65-
python -m pip install -U "setuptools >= 45" "setuptools_scm >= 6.2" "${{ matrix.pip }}"
66-
python -m pip install .
67-
INSTALLED_VERSION=$(python -c 'import templateflow as tf; print(tf.__version__, end="")')
68-
echo "VERSION: \"${THISVERSION}\""
69-
echo "INSTALLED: \"${INSTALLED_VERSION}\""
70-
test "${INSTALLED_VERSION}" = "${THISVERSION}"
71-
72-
- name: Install in confined environment [sdist]
73-
env:
74-
TEMPLATEFLOW_HOME: /tmp/home/sdist
99+
case ${{ matrix.mode }} in
100+
repo)
101+
echo "TARGET=." >> $GITHUB_ENV
102+
;;
103+
editable)
104+
echo "TARGET=-e ." >> $GITHUB_ENV
105+
;;
106+
sdist)
107+
echo "TARGET=$( ls /tmp/package/templateflow*.tar.gz )" >> $GITHUB_ENV
108+
;;
109+
wheel)
110+
echo "TARGET=$( ls /tmp/package/templateflow*.whl )" >> $GITHUB_ENV
111+
;;
112+
esac
113+
- name: Install and check version
75114
run: |
76-
python -m venv /tmp/install_sdist
77-
source /tmp/install_sdist/bin/activate
78-
python -m pip install -U "setuptools >= 45" "${{ matrix.pip }}"
79-
python -m pip install /tmp/package/templateflow*.tar.gz
115+
pip install $TARGET
80116
INSTALLED_VERSION=$(python -c 'import templateflow as tf; print(tf.__version__, end="")')
81117
echo "VERSION: \"${THISVERSION}\""
82118
echo "INSTALLED: \"${INSTALLED_VERSION}\""
83119
test "${INSTALLED_VERSION}" = "${THISVERSION}"
84120
85-
- name: Re-install in confined environment [sdist]
86-
env:
87-
TEMPLATEFLOW_HOME: /tmp/home/sdist
88-
run: |
89-
source /tmp/install_sdist/bin/activate
90-
python -m pip install /tmp/package/templateflow*.tar.gz --force-reinstall
91-
find ${TEMPLATEFLOW_HOME} >> /tmp/.sdist-install.txt
92-
- name: Re-install in confined environment [sdist - missing template]
93-
env:
94-
TEMPLATEFLOW_HOME: /tmp/home/sdist
95-
run: |
96-
rm -rf ${TEMPLATEFLOW_HOME}/tpl-MNI152NLin2009cAsym
97-
source /tmp/install_sdist/bin/activate
98-
python -m pip install /tmp/package/templateflow*.tar.gz --force-reinstall
99-
python -c "import templateflow; templateflow.update(overwrite=False)"
100-
find ${TEMPLATEFLOW_HOME} >> /tmp/.sdist-install-2.txt
101-
diff /tmp/.sdist-install.txt /tmp/.sdist-install-2.txt
102-
exit $?
103-
104-
- name: Install in confined environment [wheel]
105-
env:
106-
TEMPLATEFLOW_HOME: /tmp/home/wheel
107-
run: |
108-
python -m venv /tmp/install_wheel
109-
source /tmp/install_wheel/bin/activate
110-
python -m pip install -U "setuptools >= 45" "${{ matrix.pip }}"
111-
python -m pip install /tmp/package/templateflow*.whl
112-
INSTALLED_VERSION=$(python -c 'import templateflow as tf; print(tf.__version__, end="")')
113-
echo "INSTALLED: \"${INSTALLED_VERSION}\""
114-
test "${INSTALLED_VERSION}" = "${THISVERSION}"
115-
116-
- name: Re-install in confined environment [wheel]
117-
env:
118-
TEMPLATEFLOW_HOME: /tmp/home/wheel
119-
run: |
120-
source /tmp/install_wheel/bin/activate
121-
python -m pip install /tmp/package/templateflow*.whl --force-reinstall
122-
find ${TEMPLATEFLOW_HOME} >> /tmp/.wheel-install.txt
123-
- name: Re-install in confined environment [wheel - missing template]
124-
env:
125-
TEMPLATEFLOW_HOME: /tmp/home/wheel
126-
run: |
127-
rm -rf ${TEMPLATEFLOW_HOME}/tpl-MNI152NLin2009cAsym
128-
source /tmp/install_wheel/bin/activate
129-
python -m pip install /tmp/package/templateflow*.whl --force-reinstall
130-
# Wheels do not run post-install hooks:
131-
test ! -d ${TEMPLATEFLOW_HOME}/tpl-MNI152NLin2009cAsym
132-
python -c "import templateflow; templateflow.update(overwrite=False)"
133-
find ${TEMPLATEFLOW_HOME} >> /tmp/.wheel-install-2.txt
134-
diff /tmp/.wheel-install.txt /tmp/.wheel-install-2.txt
135-
exit $?
136-
137-
- name: Install in confined environment [setup.py - install]
138-
env:
139-
TEMPLATEFLOW_HOME: /tmp/home/setup_install
140-
run: |
141-
python -m venv /tmp/setup_install
142-
source /tmp/setup_install/bin/activate
143-
python -m pip install -U "setuptools >= 45" wheel "setuptools_scm >= 6.2" \
144-
setuptools_scm_git_archive "${{ matrix.pip }}"
145-
python -m pip install "numpy==1.20" Cython "pandas==1.3" "scipy==1.7"
146-
python setup.py install
147-
INSTALLED_VERSION=$(python -c 'import templateflow as tf; print(tf.__version__, end="")')
148-
echo "INSTALLED: \"${INSTALLED_VERSION}\""
149-
test "${INSTALLED_VERSION}" = "${THISVERSION}"
150-
151-
- name: Re-install in confined environment [setup.py - install]
152-
env:
153-
TEMPLATEFLOW_HOME: /tmp/home/setup_install
154-
run: |
155-
source /tmp/setup_install/bin/activate
156-
python setup.py install
157-
find ${TEMPLATEFLOW_HOME} >> /tmp/.setup-install.txt
158-
- name: Re-install in confined environment [setup.py - install - missing template]
159-
env:
160-
TEMPLATEFLOW_HOME: /tmp/home/setup_install
161-
run: |
162-
rm -rf ${TEMPLATEFLOW_HOME}/tpl-MNI152NLin2009cAsym
163-
source /tmp/setup_install/bin/activate
164-
python setup.py install
165-
python -c "import templateflow; templateflow.update(overwrite=False)"
166-
find ${TEMPLATEFLOW_HOME} >> /tmp/.setup-install-2.txt
167-
diff /tmp/.setup-install.txt /tmp/.setup-install-2.txt
168-
exit $?
169-
170-
- name: Install in confined environment [setup.py - develop]
171-
env:
172-
TEMPLATEFLOW_HOME: /tmp/home/setup_develop
121+
- name: Re-install
173122
run: |
174-
python -m venv /tmp/setup_develop
175-
source /tmp/setup_develop/bin/activate
176-
python -m pip install -U "setuptools >= 45" wheel "setuptools_scm >= 6.2" \
177-
setuptools_scm_git_archive "${{ matrix.pip }}"
178-
python -m pip install "numpy==1.20" Cython "pandas==1.3" "scipy==1.7"
179-
python setup.py develop
180-
INSTALLED_VERSION=$(python -c 'import templateflow as tf; print(tf.__version__, end="")')
181-
echo "INSTALLED: \"${INSTALLED_VERSION}\""
182-
test "${INSTALLED_VERSION}" = "${THISVERSION}"
183-
184-
- name: Re-install in confined environment [setup.py - develop]
185-
env:
186-
TEMPLATEFLOW_HOME: /tmp/home/setup_develop
187-
run: |
188-
source /tmp/setup_develop/bin/activate
189-
python setup.py develop
190-
find ${TEMPLATEFLOW_HOME} >> /tmp/.setup-develop.txt
191-
192-
- name: Re-install in confined environment [setup.py - develop - missing template]
193-
env:
194-
TEMPLATEFLOW_HOME: /tmp/home/setup_develop
123+
pip install $TARGET --force-reinstall
124+
find ${TEMPLATEFLOW_HOME} >> /tmp/.install.txt
125+
- name: Re-install [missing template]
195126
run: |
196127
rm -rf ${TEMPLATEFLOW_HOME}/tpl-MNI152NLin2009cAsym
197-
source /tmp/setup_develop/bin/activate
198-
python setup.py develop
128+
pip install $TARGET --force-reinstall
199129
python -c "import templateflow; templateflow.update(overwrite=False)"
200-
find ${TEMPLATEFLOW_HOME} >> /tmp/.setup-develop-2.txt
201-
diff /tmp/.setup-develop.txt /tmp/.setup-develop-2.txt
130+
find ${TEMPLATEFLOW_HOME} >> /tmp/.install-2.txt
131+
diff /tmp/.install.txt /tmp/.install-2.txt
202132
exit $?

CHANGES.rst

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,15 @@
1+
23.0.0 (February 2, 2023)
2+
=========================
3+
Minor release including additional API features and an updated skeleton.
4+
5+
* FIX: Preempt ``BIDSLayout`` from indexing dot-folders (#99)
6+
* ENH: Make sure existing ``layout.get_*`` are not bubbled in (#102)
7+
* ENH: Allow access to PyBIDS' magic ``get_*`` (#101)
8+
* ENH: Add an ``api.ls()`` function to list (without getting) files (#97)
9+
* MAINT: Discontinue legacy docker runners of CircleCI (#104)
10+
* MAINT: Rotate CircleCI secrets and setup up org-level context (#103)
11+
* MAINT: Fix docs build environment in CircleCI (#96)
12+
113
0.8.1 (May 7, 2022)
214
===================
315
Patch release updating the S3 skeleton to include the fixed version of ``tpl-MouseIn``.

docs/environment.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -152,8 +152,6 @@ dependencies:
152152
- requests=2.27.1=pyhd8ed1ab_0
153153
- scipy=1.8.0=py39hee8e79c_1
154154
- setuptools=62.1.0=py39hf3d152e_0
155-
- setuptools-scm=6.4.2=pyhd8ed1ab_0
156-
- setuptools_scm=6.4.2=hd8ed1ab_0
157155
- six=1.16.0=pyh6c4a22f_0
158156
- snowballstemmer=2.2.0=pyhd8ed1ab_0
159157
- soupsieve=2.3.1=pyhd8ed1ab_0
@@ -202,6 +200,8 @@ dependencies:
202200
- docopt==0.6.2
203201
- formulaic==0.3.4
204202
- nibabel==3.2.2
203+
- nipreps-versions==1.0.3
205204
- pandas==1.4.2
206205
- pybids==0.15.2
206+
- setuptools_scm==7.1.0
207207
- sqlalchemy==1.3.24

pyproject.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
requires = [
33
"setuptools >= 45",
44
"setuptools_scm >= 6.2",
5-
"wheel"
5+
"nipreps-versions",
66
]
77
build-backend = "setuptools.build_meta"
88

@@ -13,3 +13,4 @@ write_to_template = """\
1313
__version__ = "{version}"
1414
"""
1515
fallback_version = "0.0"
16+
version_scheme = "nipreps-calver"

0 commit comments

Comments
 (0)