Skip to content

Commit 66c2685

Browse files
authored
Merge branch 'master' into ci/codecov
2 parents de02748 + b172865 commit 66c2685

File tree

6 files changed

+64
-44
lines changed

6 files changed

+64
-44
lines changed

.circleci/config.yml

Lines changed: 28 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ orbs:
66
jobs:
77
tests:
88
docker:
9-
- image: cimg/python:3.9
9+
- image: cimg/python:3.11
1010
auth:
1111
username: $DOCKER_USER
1212
password: $DOCKER_PAT
@@ -24,18 +24,18 @@ jobs:
2424
2525
- restore_cache:
2626
keys:
27-
- deps-v10-{{ checksum "/tmp/src/templateflow/dev-requirements.txt"}}-{{ epoch }}
28-
- deps-v10-{{ checksum "/tmp/src/templateflow/dev-requirements.txt"}}-
29-
- deps-v10-
27+
- deps-v11-{{ checksum "/tmp/src/templateflow/dev-requirements.txt"}}-{{ epoch }}
28+
- deps-v11-{{ checksum "/tmp/src/templateflow/dev-requirements.txt"}}-
29+
- deps-v11-
3030
- run:
3131
name: Prepare environment
3232
command: |
3333
python -m venv /tmp/venv
3434
source /tmp/venv/bin/activate
35-
pip install -U pip
36-
pip install -r /tmp/src/templateflow/dev-requirements.txt
37-
pip install datalad
38-
pip install -U build hatch hatchling nipreps-versions build twine
35+
python -m pip install -U pip
36+
python -m pip install -r /tmp/src/templateflow/dev-requirements.txt
37+
python -m pip install -U "datalad ~= 0.19.0"
38+
python -m pip install -U build hatch twine pkginfo
3939
4040
- run:
4141
name: Install git and git-annex
@@ -54,11 +54,19 @@ jobs:
5454
git config --global user.email "[email protected]"
5555
5656
- save_cache:
57-
key: deps-v10-{{ checksum "/tmp/src/templateflow/requirements.txt"}}-{{ epoch }}
57+
key: deps-v11-{{ checksum "/tmp/src/templateflow/dev-requirements.txt"}}-{{ epoch }}
5858
paths:
5959
- "/tmp/cache"
6060
- "/tmp/venv"
6161

62+
- run:
63+
name: Test packaging
64+
command: |
65+
source /tmp/venv/bin/activate
66+
cd /tmp/src/templateflow
67+
python -m build
68+
python -m twine check dist/*
69+
6270
- run:
6371
name: Run tests (w/ DataLad)
6472
command: |
@@ -116,14 +124,6 @@ jobs:
116124
- store_test_results:
117125
path: /tmp/tests
118126

119-
- run:
120-
name: Test packaging
121-
command: |
122-
source /tmp/venv/bin/activate
123-
cd /tmp/src/templateflow
124-
python -m build
125-
twine check dist/*
126-
127127
build_docs:
128128
machine:
129129
# https://discuss.circleci.com/t/linux-machine-executor-images-2021-april-q2-update/39928
@@ -186,20 +186,25 @@ jobs:
186186
- checkout:
187187
path: /tmp/src/templateflow
188188

189+
- run:
190+
name: Generate requirements.txt
191+
command: |
192+
python /tmp/src/templateflow/.maint/update_requirements.py
193+
189194
- restore_cache:
190195
keys:
191-
- deps-v10-{{ checksum "/tmp/src/templateflow/requirements.txt"}}-{{ epoch }}
192-
- deps-v10-{{ checksum "/tmp/src/templateflow/requirements.txt"}}-
193-
- deps-v10-
196+
- deps-v11-{{ checksum "/tmp/src/templateflow/dev-requirements.txt"}}-{{ epoch }}
197+
- deps-v11-{{ checksum "/tmp/src/templateflow/dev-requirements.txt"}}-
198+
- deps-v11-
194199

195200
- run:
196201
name: Deploy to PyPi
197202
command: |
198203
source /tmp/venv/bin/activate
199-
pip install build twine
204+
python -m pip install build -U twine pkginfo
200205
python -m build
201-
twine check dist/*
202-
twine upload dist/*
206+
python -m twine check dist/*
207+
python -m twine upload dist/*
203208
204209
workflows:
205210
version: 2

.github/workflows/pythonpackage.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ jobs:
4949
run: |
5050
python -m venv /tmp/buildenv
5151
source /tmp/buildenv/bin/activate
52-
python -m pip install -U build hatch hatchling nipreps-versions
52+
python -m pip install -U build hatch
5353
if [[ "$GITHUB_REF" == refs/tags/* ]]; then
5454
TAG=${GITHUB_REF##*/}
5555
fi

CHANGES.rst

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,16 @@
1+
24.2.0 (March 18, 2024)
2+
=======================
3+
Minor release including a new command line interface for the Client.
4+
5+
* ENH: Add a command line interface (#123)
6+
* MAINT: Generate a requirements file with ``test`` dependencies (#125)
7+
* MAINT: Add codespell and make it fix some typos (#121)
8+
* MAINT: Revise code style according to ruff (#124)
9+
* MAINT: Add license header in all Python files (#122)
10+
* MAINT: Migrate to hatchling packaging (#120)
11+
* MAINT: Run ruff and address some issues (#119)
12+
* MAINT: Finalize migration of package build to PEP517/8 (#117)
13+
114
24.1.0 (March 15, 2024)
215
=======================
316
Minor release updating *PyBIDS*'s configuration to enable new entities

MANIFEST.in

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

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ test = [
4343
"coverage",
4444
]
4545
datalad = [
46-
"datalad ~= 0.12.0"
46+
"datalad ~= 0.19.0"
4747
]
4848
doc = [
4949
"nbsphinx",

templateflow/conf/tests/test_conf.py

Lines changed: 21 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,16 @@
2828
from templateflow import conf as tfc
2929

3030

31+
def _find_message(lines, msg, reverse=True):
32+
if isinstance(lines, str):
33+
lines = lines.splitlines()
34+
35+
for line in reversed(lines):
36+
if line.strip().startswith(msg):
37+
return True
38+
return False
39+
40+
3141
@pytest.mark.parametrize('use_datalad', ['off', 'on'])
3242
def test_conf_init(monkeypatch, tmp_path, capsys, use_datalad):
3343
"""Check the correct functioning of config set-up."""
@@ -56,53 +66,54 @@ def test_setup_home(monkeypatch, tmp_path, capsys, use_datalad):
5666
# First execution, the S3 stub is created (or datalad install)
5767
assert tfc.TF_CACHED is False
5868
assert tfc.setup_home() is False
59-
out = capsys.readouterr()[0]
60-
assert out.startswith('TemplateFlow was not cached')
69+
70+
out = capsys.readouterr().out
71+
assert _find_message(out, 'TemplateFlow was not cached')
6172
assert ('TEMPLATEFLOW_HOME=%s' % home) in out
6273
assert home.exists()
6374
assert len(list(home.iterdir())) > 0
6475

6576
updated = tfc.setup_home(force=True) # Templateflow is now cached
6677
out = capsys.readouterr()[0]
67-
assert not out.startswith('TemplateFlow was not cached')
78+
assert _find_message(out, 'TemplateFlow was not cached') is False
6879

6980
if use_datalad == 'on':
70-
assert out.startswith('Updating TEMPLATEFLOW_HOME using DataLad')
81+
assert _find_message(out, 'Updating TEMPLATEFLOW_HOME using DataLad')
7182
assert updated is True
7283

7384
elif use_datalad == 'off':
7485
# At this point, S3 should be up-to-date
7586
assert updated is False
76-
assert out.startswith('TEMPLATEFLOW_HOME directory (S3 type) was up-to-date.')
87+
assert _find_message(out, 'TEMPLATEFLOW_HOME directory (S3 type) was up-to-date.')
7788

7889
# Let's force an update
7990
rmtree(str(home / 'tpl-MNI152NLin2009cAsym'))
8091
updated = tfc.setup_home(force=True)
8192
out = capsys.readouterr()[0]
8293
assert updated is True
83-
assert out.startswith('Updating TEMPLATEFLOW_HOME using S3.')
94+
assert _find_message(out, 'Updating TEMPLATEFLOW_HOME using S3.')
8495

8596
reload(tfc)
8697
assert tfc.TF_CACHED is True
8798
updated = tfc.setup_home() # Templateflow is now cached
8899
out = capsys.readouterr()[0]
89-
assert not out.startswith('TemplateFlow was not cached')
100+
assert not _find_message(out, 'TemplateFlow was not cached')
90101

91102
if use_datalad == 'on':
92-
assert out.startswith('Updating TEMPLATEFLOW_HOME using DataLad')
103+
assert _find_message(out, 'Updating TEMPLATEFLOW_HOME using DataLad')
93104
assert updated is True
94105

95106
elif use_datalad == 'off':
96107
# At this point, S3 should be up-to-date
97108
assert updated is False
98-
assert out.startswith('TEMPLATEFLOW_HOME directory (S3 type) was up-to-date.')
109+
assert _find_message(out, 'TEMPLATEFLOW_HOME directory (S3 type) was up-to-date.')
99110

100111
# Let's force an update
101112
rmtree(str(home / 'tpl-MNI152NLin2009cAsym'))
102113
updated = tfc.setup_home()
103114
out = capsys.readouterr()[0]
104115
assert updated is True
105-
assert out.startswith('Updating TEMPLATEFLOW_HOME using S3.')
116+
assert _find_message(out, 'Updating TEMPLATEFLOW_HOME using S3.')
106117

107118

108119
def test_layout(monkeypatch, tmp_path):

0 commit comments

Comments
 (0)