Skip to content

Commit 914bc3a

Browse files
committed
Merge remote-tracking branch 'upstream/maint/1.4.x' into maint/1.5.x
2 parents e1f4267 + b6cf424 commit 914bc3a

File tree

14 files changed

+219
-621
lines changed

14 files changed

+219
-621
lines changed

.circleci/config.yml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
- build-v1-{{ .Branch }}-{{ .Revision }}
1919
- build-v1--{{ .Revision }}
2020
- build-v1-{{ .Branch }}-
21-
- build-v1-master-
21+
- build-v1-maint/1.4.x-
2222
- build-v1-
2323
paths:
2424
- /tmp/docker
@@ -97,9 +97,9 @@ jobs:
9797
steps:
9898
- restore_cache:
9999
keys:
100-
- env-v1-{{ .Branch }}-
101-
- env-v1-master-
102-
- env-v1-
100+
- env-v2-{{ .Branch }}-
101+
- env-v2-maint/1.4.x-
102+
- env-v2-
103103
- run:
104104
name: Setup git-annex, DataLad & TemplateFlow
105105
command: |
@@ -109,15 +109,15 @@ jobs:
109109
git config --global user.email '[email protected]'
110110
python -m pip install --no-cache-dir -U templateflow
111111
- save_cache:
112-
key: env-v1-{{ .Branch }}-{{ .BuildNum }}
112+
key: env-v2-{{ .Branch }}-{{ .BuildNum }}
113113
paths:
114114
- /opt/conda
115115

116116
- restore_cache:
117117
keys:
118118
- data-v3-{{ .Branch }}-{{ epoch }}
119119
- data-v3-{{ .Branch }}-
120-
- data-v3-master-
120+
- data-v3-maint/1.4.x-
121121
- data-v3-
122122
- run:
123123
name: Get test data from ds000003
@@ -185,7 +185,7 @@ jobs:
185185
- build-v1-{{ .Branch }}-{{ .Revision }}
186186
- build-v1--{{ .Revision }}
187187
- build-v1-{{ .Branch }}-
188-
- build-v1-master-
188+
- build-v1-maint/1.4.x-
189189
- build-v1-
190190
- run:
191191
name: Docker authentication
@@ -215,7 +215,7 @@ jobs:
215215
keys:
216216
- data-v3-{{ .Branch }}-{{ epoch }}
217217
- data-v3-{{ .Branch }}-
218-
- data-v3-master-
218+
- data-v3-maint/1.4.x-
219219
- data-v3-
220220

221221
- run:
@@ -337,7 +337,7 @@ jobs:
337337
- build-v1-{{ .Branch }}-{{ .Revision }}
338338
- build-v1--{{ .Revision }}
339339
- build-v1-{{ .Branch }}-
340-
- build-v1-master-
340+
- build-v1-maint/1.4.x-
341341
- build-v1-
342342
paths:
343343
- /tmp/docker

.github/workflows/pythonpackage.yml

Lines changed: 122 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -9,22 +9,46 @@ on:
99
tags: [ '*' ]
1010
pull_request:
1111
branches: [ master, 'maint/*' ]
12+
schedule:
13+
- cron: '0 0 * * *'
14+
15+
concurrency:
16+
group: python-${{ github.ref }}
17+
cancel-in-progress: true
1218

1319
jobs:
20+
check_if_skip:
21+
runs-on: ubuntu-latest
22+
outputs:
23+
commit_message: ${{ steps.get_commit_message.outputs.commit_message }}
24+
steps:
25+
- name: Get repo
26+
uses: actions/checkout@v3
27+
with:
28+
ref: ${{ github.event.pull_request.head.sha }}
29+
- name: Print head git commit message
30+
id: get_commit_message
31+
run: |
32+
if [[ -z "$COMMIT_MSG" ]]; then
33+
COMMIT_MSG=$(git show -s --format=%s)
34+
fi
35+
echo $COMMIT_MSG
36+
echo "::set-output name=commit_message::$COMMIT_MSG"
37+
env:
38+
COMMIT_MSG: ${{ github.event.head_commit.message }}
39+
1440
build:
15-
if: "!contains(github.event.head_commit.message, '[skip ci]')"
41+
needs: check_if_skip
42+
if: "!contains(needs.check_if_skip.outputs.commit_message, '[skip ci]')"
1643
runs-on: ubuntu-latest
17-
strategy:
18-
matrix:
19-
python-version: ["3.10"]
2044
steps:
2145
- uses: actions/checkout@v3
2246
with:
2347
fetch-depth: 0
24-
- name: Set up Python ${{ matrix.python-version }}
25-
uses: actions/setup-python@v3
48+
- name: Set up Python 3
49+
uses: actions/setup-python@v4
2650
with:
27-
python-version: ${{ matrix.python-version }}
51+
python-version: 3
2852
- name: Display Python version
2953
run: python -c "import sys; print(sys.version)"
3054
- name: Check python version and install build
@@ -42,24 +66,40 @@ jobs:
4266

4367
get_data:
4468
runs-on: ubuntu-latest
69+
defaults:
70+
run:
71+
shell: bash -l {0}
4572
steps:
4673
- name: Create test data directory
4774
run: mkdir -p $HOME/.cache/stanford-crn
4875
- name: Load test data cache
49-
uses: actions/cache@v2
76+
uses: actions/cache@v3
5077
id: stanford-crn
5178
with:
5279
path: ~/.cache/stanford-crn/
5380
key: data-v0-${{ github.ref_name }}-${{ github.sha }}
5481
restore-keys: |
5582
data-v0-${{ github.ref_name }}-
5683
data-v0-
84+
- name: Setup conda
85+
uses: conda-incubator/setup-miniconda@v2
86+
with:
87+
auto-activate-base: true
88+
activate-environment: ""
89+
- name: Verify environment
90+
run: |
91+
conda info
92+
which python
5793
- name: Install datalad
5894
run: |
59-
sudo apt-get update -y
60-
sudo apt-get install -y git-annex --no-install-recommends
61-
python -m pip install datalad==0.14.7 datalad-osf
95+
python -m pip install datalad-installer
96+
datalad-installer --sudo ok git-annex
97+
python -m pip install datalad datalad-osf
6298
datalad wtf
99+
- name: Pacify git
100+
run: |
101+
git config --global user.email "[email protected]"
102+
git config --global user.name "Niworkflows Action"
63103
- name: Fetch test data
64104
run: |
65105
DS=$HOME/.cache/stanford-crn
@@ -83,6 +123,7 @@ jobs:
83123
install: wheel
84124
- python-version: 3.9
85125
install: editable
126+
86127
env:
87128
INSTALL_TYPE: ${{ matrix.install }}
88129

@@ -91,17 +132,17 @@ jobs:
91132
with:
92133
fetch-depth: 0
93134
- name: Set up Python ${{ matrix.python-version }}
94-
uses: actions/setup-python@v3
135+
uses: actions/setup-python@v4
95136
with:
96137
python-version: ${{ matrix.python-version }}
97138
- name: Load test data cache
98-
uses: actions/cache@v2
139+
uses: actions/cache@v3
99140
id: stanford-crn
100141
with:
101142
path: ~/.cache/stanford-crn/
102143
key: data-v0-${{ github.ref_name }}-${{ github.sha }}
103144
- name: Load TemplateFlow cache
104-
uses: actions/cache@v2
145+
uses: actions/cache@v3
105146
id: templateflow
106147
with:
107148
path: ~/.cache/templateflow
@@ -142,20 +183,85 @@ jobs:
142183
test "${INSTALLED_VERSION}" = "${THISVERSION}"
143184
- name: Install test dependencies
144185
run: python -m pip install "niworkflows[tests]"
186+
- name: Set TEST_DATA_HOME
187+
run: echo "TEST_DATA_HOME=$HOME/.cache/stanford-crn" >> $GITHUB_ENV
145188
- name: Run tests
146189
uses: GabrielBB/xvfb-action@v1
147190
with:
148191
run: pytest -sv --no-xvfb --doctest-modules --cov niworkflows niworkflows
149192
- uses: codecov/codecov-action@v2
150193
name: Submit to CodeCov
151194

195+
test-pre:
196+
needs: [get_data, check_if_skip]
197+
if: ${{ !contains(needs.check_if_skip.outputs.commit_message, '[skip pre]') }}
198+
runs-on: ubuntu-latest
199+
strategy:
200+
matrix:
201+
python-version: [3.7, 3.8, 3.9, "3.10"]
202+
install: [repo]
203+
pip-flags: ['--pre']
204+
205+
env:
206+
INSTALL_TYPE: ${{ matrix.install }}
207+
PIP_FLAGS: ${{ matrix.pip-flags }}
208+
209+
steps:
210+
- name: Debug commit message
211+
run: echo "${{ needs.check_if_skip.outputs.commit_message }}"
212+
- uses: actions/checkout@v3
213+
with:
214+
fetch-depth: 0
215+
- name: Set up Python ${{ matrix.python-version }}
216+
uses: actions/setup-python@v4
217+
with:
218+
python-version: ${{ matrix.python-version }}
219+
- name: Load test data cache
220+
uses: actions/cache@v3
221+
id: stanford-crn
222+
with:
223+
path: ~/.cache/stanford-crn/
224+
key: data-v0-${{ github.ref_name }}-${{ github.sha }}
225+
- name: Load TemplateFlow cache
226+
uses: actions/cache@v3
227+
id: templateflow
228+
with:
229+
path: ~/.cache/templateflow
230+
key: templateflow-v0-${{ github.ref_name }}-${{ strategy.job-index }}-${{ github.sha }}
231+
restore-keys: |
232+
templateflow-v0-${{ github.ref_name }}-
233+
templateflow-v0-
234+
- name: Install package
235+
run: python -m pip install $PIP_FLAGS .
236+
- name: Check version
237+
run: |
238+
# Interpolate version
239+
if [[ "$GITHUB_REF" == refs/tags/* ]]; then
240+
TAG=${GITHUB_REF##*/}
241+
fi
242+
THISVERSION=$( python get_version.py )
243+
THISVERSION=${TAG:-$THISVERSION}
244+
INSTALLED_VERSION=$(python -c 'import niworkflows; print(niworkflows.__version__, end="")')
245+
echo "VERSION: \"${THISVERSION}\""
246+
echo "INSTALLED: \"${INSTALLED_VERSION}\""
247+
test "${INSTALLED_VERSION}" = "${THISVERSION}"
248+
- name: Install test dependencies
249+
run: python -m pip install $PIP_FLAGS "niworkflows[tests]"
250+
- name: Set TEST_DATA_HOME
251+
run: echo "TEST_DATA_HOME=$HOME/.cache/stanford-crn" >> $GITHUB_ENV
252+
- name: Run tests
253+
run: pytest -sv --doctest-modules -n auto --cov niworkflows niworkflows
254+
- uses: codecov/codecov-action@v3
255+
name: Submit to CodeCov
256+
152257
flake8:
153-
if: "!contains(github.event.head_commit.message, '[skip ci]')"
258+
needs: check_if_skip
259+
if: "!contains(needs.check_if_skip.outputs.commit_message, '[skip ci]')"
154260
runs-on: ubuntu-latest
155261
steps:
156262
- uses: actions/checkout@v3
157263
- name: Set up Python 3.7
158-
uses: actions/setup-python@v3
264+
uses: actions/setup-python@v4
159265
with:
160266
python-version: 3.7
161267
- run: pip install flake8

CHANGES.rst

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,26 @@ This release upgrades the Dockerfile to use FSL6, and includes some new interfac
5454
* FIX: Scipy docs path (#681)
5555
* TEST: Drop excessively long interface equivalence tests (#674)
5656

57+
1.4.10 (September 14, 2022)
58+
===========================
59+
Bug-fix release in the 1.4.x series
60+
61+
Backports and minor maintenance.
62+
63+
* FIX: TSV2JSON should convert empty TSV files to empty JSON files (#747)
64+
* FIX: Stop relying on deprecated indexing behavior (#730)
65+
* MNT: Update docs and GitHub actions config from master in LTS branch (#748)
66+
67+
1.4.9 (April 21, 2022)
68+
======================
69+
Bug-fix release in the 1.4.x series.
70+
71+
This release includes improvements to the reliability of the BOLD masking workflow,
72+
as well as an fMRIPrep bug-fix when reusing multi-echo anatomicals.
73+
74+
* FIX: Account for potential lists of lists in multi-echo cases (#719)
75+
* FIX: Improve reliability of BOLD masking workflow (#712)
76+
5777
1.4.8 (April 08, 2022)
5878
======================
5979
Bug-fix release in the 1.4.x series.
@@ -230,6 +250,16 @@ A list of prominent changes can be found below. (With thanks to Lea Waller for t
230250
* ``NormalizeMotionParams`` now under ``confounds``.
231251
* ``FMRISummary``, ``CompCorVariancePlot``, ``ConfoundsCorrelationPlot`` from ``plotting``
232252

253+
1.3.8 (September 14, 2022)
254+
==========================
255+
Bug-fix release in the 1.3.x series
256+
257+
Backports and minor maintenance.
258+
259+
* FIX: TSV2JSON should convert empty TSV files to empty JSON files (#747)
260+
* FIX: Stop relying on deprecated indexing behavior (#730)
261+
* MNT: Update docs and GitHub actions config from master in LTS branch (#748)
262+
233263
1.3.7 (March 31, 2022)
234264
======================
235265
Bug-fix release in the 1.3.x series

docs/conf.py

Lines changed: 25 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,29 @@
1414
#
1515
import os
1616
import sys
17+
from unittest import mock
18+
import tempfile
19+
1720
from packaging.version import Version
21+
import templateflow
22+
23+
# Prevent etelemetry from loading at all
24+
# Could set NO_ET environment variable, but why?
25+
MOCKS = [
26+
"etelemetry",
27+
"matplotlib",
28+
"matplotlib.pyplot",
29+
"matplotlib.cm",
30+
"matplotlib.colors",
31+
"matplotlib.colorbar",
32+
]
33+
sys.modules.update({mod: mock.Mock() for mod in MOCKS})
34+
35+
# Keep templateflow API intact except for fetching files.
36+
# Return an existent but empty temporary file
37+
tffiledesc, tffilename = tempfile.mkstemp()
38+
os.close(tffiledesc)
39+
templateflow.api.get = mock.MagicMock(return_value=tffilename)
1840

1941
from niworkflows import __version__, __copyright__, __packagename__
2042

@@ -47,7 +69,6 @@
4769
]
4870

4971
autodoc_mock_imports = [
50-
"matplotlib",
5172
"nilearn",
5273
"nitime",
5374
"numpy",
@@ -57,6 +78,7 @@
5778
"svgutils",
5879
"templateflow",
5980
"transforms3d",
81+
"yaml",
6082
]
6183

6284
# Accept custom section names to be parsed for numpy-style docstrings
@@ -234,13 +256,13 @@
234256
# Example configuration for intersphinx: refer to the Python standard library.
235257
intersphinx_mapping = {
236258
"bids": ("https://bids-standard.github.io/pybids/", None),
237-
"matplotlib": ("https://matplotlib.org/", None),
259+
"matplotlib": ("https://matplotlib.org/stable", None),
238260
"nibabel": ("https://nipy.org/nibabel/", None),
239261
"nipype": ("https://nipype.readthedocs.io/en/latest/", None),
240262
"numpy": ("https://numpy.org/doc/stable/", None),
241263
"pandas": ("https://pandas.pydata.org/pandas-docs/dev", None),
242264
"python": ("https://docs.python.org/3/", None),
243-
"scipy": ("https://docs.scipy.org/doc/scipy-1.8.0/html-scipyorg/", None),
265+
"scipy": ("https://docs.scipy.org/doc/scipy/", None),
244266
"smriprep": ("https://www.nipreps.org/smriprep/", None),
245267
"surfplot": ("https://surfplot.readthedocs.io/en/latest/", None),
246268
"templateflow": ("https://www.templateflow.org/python-client", None),

0 commit comments

Comments
 (0)