Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/maint/20.2.x'
Browse files Browse the repository at this point in the history
  • Loading branch information
effigies committed Oct 12, 2021
2 parents 9f869eb + 5a10780 commit fb48c64
Show file tree
Hide file tree
Showing 6 changed files with 114 additions and 42 deletions.
55 changes: 35 additions & 20 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,10 @@ jobs:
- run:
name: Check whether build should be skipped
command: |
if [[ "$( git log --format='format:%s' -n 1 $CIRCLE_SHA1 | grep -i -E '^docs?(\(\w+\))?:' )" != "" ]]; then
set -x +e
COMMIT_MSG="$(git log --format='format:%s' -n 1 $CIRCLE_SHA1)"
DOCBUILD="$(echo ${COMMIT_MSG} | grep -i -E '^docs?(\(\w+\))?:')"
if [ -z "$CIRCLE_TAG" -a -n "$DOCBUILD" ]; then
echo "Only docs build"
circleci step halt
fi
Expand Down Expand Up @@ -277,11 +280,15 @@ jobs:
name: Check whether build should be skipped
command: |
cd /home/circleci/src/fmriprep
if [[ "$( git log --format='format:%s' -n 1 $CIRCLE_SHA1 | grep -i -E '^docs?(\(\w+\))?:' )" != "" ]]; then
set -x +e
COMMIT_MSG="$(git log --format='format:%s' -n 1 $CIRCLE_SHA1)"
DOCBUILD="$(echo ${COMMIT_MSG} | grep -i -E '^docs?(\(\w+\))?:')"
SKIP_PYTEST="$(echo ${COMMIT_MSG} | grep -i -E '\[skip[ _]?tests\]')"
if [ -z "$CIRCLE_TAG" -a -n "$DOCBUILD" ]; then
echo "Only docs build"
circleci step halt
fi
if [[ "$( git log --format=oneline -n 1 $CIRCLE_SHA1 | grep -i -E '\[skip[ _]?tests\]' )" != "" ]]; then
if [ -z "$CIRCLE_TAG" -a -n "$SKIP_PYTEST" ]; then
echo "Skipping pytest job"
circleci step halt
fi
Expand Down Expand Up @@ -370,18 +377,23 @@ jobs:
- checkout:
path: /home/circleci/src/fmriprep
- run:
name: Check whether build should be skipped
name: Check whether build should be skipped or fast-tracked
command: |
cd /home/circleci/src/fmriprep
if [[ "$( git log --format='format:%s' -n 1 $CIRCLE_SHA1 | grep -i -E '^docs?(\(\w+\))?:' )" != "" ]]; then
set -x +e
COMMIT_MSG="$(git log --format='format:%s' -n 1 $CIRCLE_SHA1)"
DOCBUILD="$(echo ${COMMIT_MSG} | grep -i -E '^docs?(\(\w+\))?:' )"
SKIP_DS005="$(echo ${COMMIT_MSG} | grep -i -E '\[skip[ _]?ds005\]' )"
NO_FASTTRACK="$(echo ${COMMIT_MSG} | grep -i -E '\[no[ _-]?fasttrack\]' )"
if [ -z "$CIRCLE_TAG" -a -n "$DOCBUILD" ]; then
echo "Only docs build"
circleci step halt
fi
if [[ "$( git log --format=oneline -n 1 $CIRCLE_SHA1 | grep -i -E '\[skip[ _]?ds005\]' )" != "" ]]; then
if [ -z "$CIRCLE_TAG" -a -n "$SKIP_DS005" ]; then
echo "Skipping ds000005 build"
circleci step halt
fi
if [[ "$( git log --format=oneline -n 1 $CIRCLE_SHA1 | grep -i -E '\[no[ _-]?fasttrack\]' )" != "" ]]; then
if [[ -n "$NO_FASTTRACK" ]]; then
touch /tmp/.nofasttrack
echo "Anatomical fasttrack reusing sMRIPrep's derivatives will not be used."
fi
Expand Down Expand Up @@ -608,11 +620,15 @@ jobs:
name: Check whether build should be skipped
command: |
cd /home/circleci/src/fmriprep
if [[ "$( git log --format='format:%s' -n 1 $CIRCLE_SHA1 | grep -i -E '^docs?(\(\w+\))?:' )" != "" ]]; then
set -x +e
COMMIT_MSG="$(git log --format='format:%s' -n 1 $CIRCLE_SHA1)"
DOCBUILD="$(echo ${COMMIT_MSG} | grep -i -E '^docs?(\(\w+\))?:')"
SKIP_DS054="$(echo ${COMMIT_MSG} | grep -i -E '\[skip[ _]?ds054\]' )"
if [ -z "$CIRCLE_TAG" -a -n "$DOCBUILD" ]; then
echo "Only docs build"
circleci step halt
fi
if [[ "$( git log --format=oneline -n 1 $CIRCLE_SHA1 | grep -i -E '\[skip[ _]?ds054\]' )" != "" ]]; then
if [ -z "$CIRCLE_TAG" -a -n "$SKIP_DS054" ]; then
echo "Skipping ds000054 build"
circleci step halt
fi
Expand Down Expand Up @@ -773,11 +789,15 @@ jobs:
name: Check whether build should be skipped
command: |
cd /home/circleci/src/fmriprep
if [[ "$( git log --format='format:%s' -n 1 $CIRCLE_SHA1 | grep -i -E '^docs?(\(\w+\))?:' )" != "" ]]; then
set -x +e
COMMIT_MSG="$(git log --format='format:%s' -n 1 $CIRCLE_SHA1)"
DOCBUILD="$(echo ${COMMIT_MSG} | grep -i -E '^docs?(\(\w+\))?:')"
SKIP_DS210="$(echo ${COMMIT_MSG} | grep -i -E '\[skip[ _]?ds054\]' )"
if [ -z "$CIRCLE_TAG" -a -n "$DOCBUILD" ]; then
echo "Only docs build"
circleci step halt
fi
if [[ "$( git log --format=oneline -n 1 $CIRCLE_SHA1 | grep -i -E '\[skip[ _]?ds210\]' )" != "" ]]; then
if [ -z "$CIRCLE_TAG" -a -n "$SKIP_DS210" ]; then
echo "Skipping ds000210 build"
circleci step halt
fi
Expand Down Expand Up @@ -919,14 +939,6 @@ jobs:
fi
- checkout:
path: /home/circleci/src/fmriprep
- run:
name: Check whether build should be skipped
command: |
cd /home/circleci/src/fmriprep
if [[ "$( git log --format='format:%s' -n 1 $CIRCLE_SHA1 | grep -i -E '^docs?(\(\w+\))?:' )" != "" ]]; then
echo "Only docs build"
circleci step halt
fi
- restore_cache:
keys:
- build-v4-{{ .Branch }}-{{ .Revision }}
Expand Down Expand Up @@ -975,7 +987,10 @@ jobs:
name: Check whether build should be skipped
command: |
cd /home/circleci/src/fmriprep
if [[ "$( git log --format='format:%s' -n 1 $CIRCLE_SHA1 | grep -i -E '^docs?(\(\w+\))?:' )" != "" ]]; then
set -x +e
COMMIT_MSG="$(git log --format='format:%s' -n 1 $CIRCLE_SHA1)"
DOCBUILD="$(echo ${COMMIT_MSG} | grep -i -E '^docs?(\(\w+\))?:')"
if [ -z "$CIRCLE_TAG" -a -n "$DOCBUILD" ]; then
echo "Only docs build"
circleci step halt
fi
Expand Down
41 changes: 41 additions & 0 deletions .github/workflows/contrib.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Contribution checks

on:
push:
branches:
- master
- maint/*
pull_request:
branches:
- master
- maint/*

defaults:
run:
shell: bash

jobs:
stable:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: ['ubuntu-latest']
python-version: [3.9]

steps:
- uses: actions/checkout@v2
with:
submodules: recursive
fetch-depth: 0
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Display Python version
run: python -c "import sys; print(sys.version)"
- name: Install flake8
run: python -m pip install flake8
- name: Check fMRIPrep
run: python -m flake8 fmriprep
- name: Check wrapper
run: python -m flake8 wrapper
16 changes: 0 additions & 16 deletions .travis.yml

This file was deleted.

12 changes: 12 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,18 @@ A new major version of fMRIPrep is finally here!
* MAINT: Migrate from poldracklab to nipreps orgs (#2290)
* MAINT: Ease CI packaging tests (#2472)

20.2.5 (October 12, 2021)
=========================
Bug-fix release in the 20.2.x LTS series.

This release includes a fix to `--slice-time-ref` parsing. Also, some
issues in anatomical processing are resolved, including poorly-interpolated
labels in aseg segmentations, and probabilistic segmentations have reverted
to FAST.

* FIX: --slice-time-ref option parsing (#2573)
* CI: Add style checks (missing since Travis got throttled) (#2570)

20.2.4 (October 04, 2021)
=========================
Bug-fix release in the 20.2.x LTS series.
Expand Down
16 changes: 10 additions & 6 deletions fmriprep/cli/parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,11 @@
from .. import config


def _build_parser():
"""Build parser object."""
def _build_parser(**kwargs):
"""Build parser object.
``kwargs`` are passed to ``argparse.ArgumentParser`` (mainly useful for debugging).
"""
from functools import partial
from pathlib import Path
from argparse import (
Expand Down Expand Up @@ -112,11 +115,13 @@ def _slice_time_ref(value, parser):
config.environment.version
),
formatter_class=ArgumentDefaultsHelpFormatter,
**kwargs,
)
PathExists = partial(_path_exists, parser=parser)
IsFile = partial(_is_file, parser=parser)
PositiveInt = partial(_min_one, parser=parser)
BIDSFilter = partial(_bids_filter, parser=parser)
SliceTimeRef = partial(_slice_time_ref, parser=parser)

# Arguments as specified by BIDS-Apps
# required, positional arguments
Expand Down Expand Up @@ -355,7 +360,7 @@ def _slice_time_ref(value, parser):
required=False,
action="store",
default=None,
type=_slice_time_ref,
type=SliceTimeRef,
help="The time of the reference slice to correct BOLD values to, as a fraction "
"acquisition time. 0 indicates the start, 0.5 the midpoint, and 1 the end "
"of acquisition. The alias `start` corresponds to 0, and `middle` to 0.5. "
Expand Down Expand Up @@ -655,9 +660,8 @@ def parse_args(args=None, namespace=None):
config.from_dict(vars(opts))

if not config.execution.notrack:
try:
import sentry_sdk
except ImportError:
import pkgutil
if pkgutil.find_loader("sentry_sdk") is None:
config.execution.notrack = True
config.loggers.cli.warning("Telemetry disabled because sentry_sdk is not installed.")
else:
Expand Down
16 changes: 16 additions & 0 deletions fmriprep/cli/tests/test_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -177,3 +177,19 @@ def test_bids_filter_file(tmp_path, capsys):

err = capsys.readouterr().err
assert "JSON syntax error in:" in err
_reset_config()


@pytest.mark.parametrize("st_ref", (None, "0", "1", "0.5", "start", "middle"))
def test_slice_time_ref(tmp_path, st_ref):
bids_path = tmp_path / "data"
out_path = tmp_path / "out"
args = [str(bids_path), str(out_path), "participant"]
if st_ref:
args.extend(["--slice-time-ref", st_ref])
bids_path.mkdir()

parser = _build_parser()

parser.parse_args(args)
_reset_config()

0 comments on commit fb48c64

Please sign in to comment.