Skip to content

Commit d550a0d

Browse files
committed
Merge remote-tracking branch 'upstream/maint/1.3.x' into maint/1.4.x
2 parents bf468a1 + 6a9db81 commit d550a0d

File tree

11 files changed

+179
-611
lines changed

11 files changed

+179
-611
lines changed

.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: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,16 @@ A list of prominent changes can be found below. (With thanks to Lea Waller for t
184184
* ``NormalizeMotionParams`` now under ``confounds``.
185185
* ``FMRISummary``, ``CompCorVariancePlot``, ``ConfoundsCorrelationPlot`` from ``plotting``
186186

187+
1.3.8 (September 14, 2022)
188+
==========================
189+
Bug-fix release in the 1.3.x series
190+
191+
Backports and minor maintenance.
192+
193+
* FIX: TSV2JSON should convert empty TSV files to empty JSON files (#747)
194+
* FIX: Stop relying on deprecated indexing behavior (#730)
195+
* MNT: Update docs and GitHub actions config from master in LTS branch (#748)
196+
187197
1.3.7 (March 31, 2022)
188198
======================
189199
Bug-fix release in the 1.3.x series

docs/conf.py

Lines changed: 26 additions & 4 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),
241-
"pandas": ("http://pandas.pydata.org/pandas-docs/dev", None),
263+
"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/reference", 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),

docs/requirements.txt

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,9 @@
1-
furo ~= 2021.10.09
2-
matplotlib >= 2.2.0
3-
nibabel
1+
attrs
2+
furo ~= 2022.4.7
43
nipype >= 1.5.1
5-
numpy
4+
traits < 6.4
65
packaging
7-
pydot >= 1.2.3
8-
pydotplus
96
sphinx ~= 4.2
107
sphinxcontrib-apidoc
118
sphinxcontrib-napoleon
129
templateflow
13-
nitransforms >= 20.0.0rc3

docs/tools/LICENSE.txt

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

0 commit comments

Comments
 (0)