Skip to content

Commit

Permalink
Merge pull request #106 from templateflow/rel/23.0.0
Browse files Browse the repository at this point in the history
REL: 23.0.0
  • Loading branch information
effigies authored Feb 2, 2023
2 parents dd08432 + 91c600c commit 1c81342
Show file tree
Hide file tree
Showing 6 changed files with 137 additions and 175 deletions.
10 changes: 5 additions & 5 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
pip install -U pip
pip install -r /tmp/src/templateflow/requirements.txt
pip install "datalad ~= 0.11.8"
pip install "setuptools>=45" "setuptools_scm >= 6.2" twine codecov
pip install "setuptools>=45" "setuptools_scm >= 6.2" nipreps-versions build twine codecov
- run:
name: Install git and git-annex
Expand Down Expand Up @@ -120,7 +120,7 @@ jobs:
command: |
source /tmp/venv/bin/activate
cd /tmp/src/templateflow
python setup.py sdist
python -m build
twine check dist/*
build_docs:
Expand Down Expand Up @@ -150,8 +150,8 @@ jobs:
if ! [ -x "$(command -v conda)" ]; then
curl -sSLO https://repo.anaconda.com/miniconda/Miniconda3-py39_4.11.0-Linux-x86_64.sh
bash Miniconda3-py39_4.11.0-Linux-x86_64.sh -b -p $HOME/.conda
$HOME/.conda/bin/conda env update -f docs/environment.yml --prune
fi
$HOME/.conda/bin/conda env update -f docs/environment.yml --prune
- save_cache:
key: env-v7-{{ .Branch }}
Expand Down Expand Up @@ -194,8 +194,8 @@ jobs:
name: Deploy to PyPi
command: |
source /tmp/venv/bin/activate
pip install "setuptools>=45" "setuptools_scm >= 6.2" wheel twine
python setup.py sdist bdist_wheel
pip install build twine
python -m build
twine check dist/*
twine upload dist/*
Expand Down
260 changes: 95 additions & 165 deletions .github/workflows/pythonpackage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,193 +10,123 @@ on:
pull_request:
branches: [ master ]

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

permissions:
contents: read

jobs:
build:
if: "!startsWith(github.ref, 'refs/tags/') && !contains(github.event.head_commit.message, '[skip ci]')"
runs-on: ubuntu-latest
outputs:
version: ${{ steps.get_version.outputs.version }}
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: actions/setup-python@v4
with:
python-version: 3
- uses: actions/cache@v3
with:
path: ~/.cache/pip
key: pip-cache-v1
restore-keys: |
pip-cache-
- run: pip install --upgrade build twine
- name: Build sdist and wheel
run: python -m build
- run: twine check dist/*
- uses: actions/upload-artifact@v3
with:
name: dist
path: dist/
- name: Interpolate version in confined environment
id: get_version
run: |
python -m venv /tmp/buildenv
source /tmp/buildenv/bin/activate
python -m pip install --upgrade setuptools setuptools_scm nipreps-versions
if [[ "$GITHUB_REF" == refs/tags/* ]]; then
TAG=${GITHUB_REF##*/}
fi
THISVERSION=$( python -m setuptools_scm )
THISVERSION=${TAG:-$THISVERSION}
echo "Expected VERSION: \"${THISVERSION}\""
echo "version=${THISVERSION}" >> $GITHUB_OUTPUT
test-install:
runs-on: ubuntu-latest
needs: build
strategy:
matrix:
python-version: [3.7, 3.8, 3.9]
pip: ["pip==21.2", "pip~=22.0"]

python-version: ['3.7', '3.8', '3.9', '3.10', '3.11']
mode: ['wheel']
include:
- {python-version: '3.9', mode: 'repo'}
- {python-version: '3.9', mode: 'sdist'}
- {python-version: '3.9', mode: 'editable'}

env:
TEMPLATEFLOW_HOME: /tmp/home
THISVERSION: ${{ needs.build.outputs.version }}
steps:
- uses: actions/checkout@v2
- name: Fetch all tags (for setuptools_scm to work)
run: |
/usr/bin/git -c protocol.version=2 fetch --tags --prune --unshallow origin
- uses: actions/checkout@v3
if: matrix.mode == 'repo' || matrix.mode == 'editable'
with:
fetch-depth: 0
- uses: actions/download-artifact@v3
if: matrix.mode == 'sdist' || matrix.mode == 'wheel'
with:
name: dist
path: /tmp/package/
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v1
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- uses: actions/cache@v1
- uses: actions/cache@v3
with:
path: $HOME/.cache/pip
path: ~/.cache/pip
key: pip-cache-v1
restore-keys: |
pip-cache-
- name: Build in confined environment and interpolate version
run: |
python -m venv /tmp/buildenv
source /tmp/buildenv/bin/activate
python -m pip install -U "setuptools >= 45" wheel "setuptools_scm >= 6.2" \
setuptools_scm_git_archive pip twine docutils
python setup.py sdist bdist_wheel
python -m twine check dist/templateflow*
mv dist /tmp/package
rm -rf templateflow.egg-info/
# Interpolate version
if [[ "$GITHUB_REF" == refs/tags/* ]]; then
TAG=${GITHUB_REF##*/}
fi
THISVERSION=$( python setup.py --version )
THISVERSION=${TAG:-$THISVERSION}
echo "Expected VERSION: \"${THISVERSION}\""
echo "THISVERSION=${THISVERSION}" >> $GITHUB_ENV
- name: Install in confined environment [pip]
env:
TEMPLATEFLOW_HOME: /tmp/home/pip
- name: Upgrade pip
run: pip install --upgrade pip wheel
- name: Set install command
run: |
python -m venv /tmp/pip
source /tmp/pip/bin/activate
python -m pip install -U "setuptools >= 45" "setuptools_scm >= 6.2" "${{ matrix.pip }}"
python -m pip install .
INSTALLED_VERSION=$(python -c 'import templateflow as tf; print(tf.__version__, end="")')
echo "VERSION: \"${THISVERSION}\""
echo "INSTALLED: \"${INSTALLED_VERSION}\""
test "${INSTALLED_VERSION}" = "${THISVERSION}"
- name: Install in confined environment [sdist]
env:
TEMPLATEFLOW_HOME: /tmp/home/sdist
case ${{ matrix.mode }} in
repo)
echo "TARGET=." >> $GITHUB_ENV
;;
editable)
echo "TARGET=-e ." >> $GITHUB_ENV
;;
sdist)
echo "TARGET=$( ls /tmp/package/templateflow*.tar.gz )" >> $GITHUB_ENV
;;
wheel)
echo "TARGET=$( ls /tmp/package/templateflow*.whl )" >> $GITHUB_ENV
;;
esac
- name: Install and check version
run: |
python -m venv /tmp/install_sdist
source /tmp/install_sdist/bin/activate
python -m pip install -U "setuptools >= 45" "${{ matrix.pip }}"
python -m pip install /tmp/package/templateflow*.tar.gz
pip install $TARGET
INSTALLED_VERSION=$(python -c 'import templateflow as tf; print(tf.__version__, end="")')
echo "VERSION: \"${THISVERSION}\""
echo "INSTALLED: \"${INSTALLED_VERSION}\""
test "${INSTALLED_VERSION}" = "${THISVERSION}"
- name: Re-install in confined environment [sdist]
env:
TEMPLATEFLOW_HOME: /tmp/home/sdist
run: |
source /tmp/install_sdist/bin/activate
python -m pip install /tmp/package/templateflow*.tar.gz --force-reinstall
find ${TEMPLATEFLOW_HOME} >> /tmp/.sdist-install.txt
- name: Re-install in confined environment [sdist - missing template]
env:
TEMPLATEFLOW_HOME: /tmp/home/sdist
run: |
rm -rf ${TEMPLATEFLOW_HOME}/tpl-MNI152NLin2009cAsym
source /tmp/install_sdist/bin/activate
python -m pip install /tmp/package/templateflow*.tar.gz --force-reinstall
python -c "import templateflow; templateflow.update(overwrite=False)"
find ${TEMPLATEFLOW_HOME} >> /tmp/.sdist-install-2.txt
diff /tmp/.sdist-install.txt /tmp/.sdist-install-2.txt
exit $?
- name: Install in confined environment [wheel]
env:
TEMPLATEFLOW_HOME: /tmp/home/wheel
run: |
python -m venv /tmp/install_wheel
source /tmp/install_wheel/bin/activate
python -m pip install -U "setuptools >= 45" "${{ matrix.pip }}"
python -m pip install /tmp/package/templateflow*.whl
INSTALLED_VERSION=$(python -c 'import templateflow as tf; print(tf.__version__, end="")')
echo "INSTALLED: \"${INSTALLED_VERSION}\""
test "${INSTALLED_VERSION}" = "${THISVERSION}"
- name: Re-install in confined environment [wheel]
env:
TEMPLATEFLOW_HOME: /tmp/home/wheel
run: |
source /tmp/install_wheel/bin/activate
python -m pip install /tmp/package/templateflow*.whl --force-reinstall
find ${TEMPLATEFLOW_HOME} >> /tmp/.wheel-install.txt
- name: Re-install in confined environment [wheel - missing template]
env:
TEMPLATEFLOW_HOME: /tmp/home/wheel
run: |
rm -rf ${TEMPLATEFLOW_HOME}/tpl-MNI152NLin2009cAsym
source /tmp/install_wheel/bin/activate
python -m pip install /tmp/package/templateflow*.whl --force-reinstall
# Wheels do not run post-install hooks:
test ! -d ${TEMPLATEFLOW_HOME}/tpl-MNI152NLin2009cAsym
python -c "import templateflow; templateflow.update(overwrite=False)"
find ${TEMPLATEFLOW_HOME} >> /tmp/.wheel-install-2.txt
diff /tmp/.wheel-install.txt /tmp/.wheel-install-2.txt
exit $?
- name: Install in confined environment [setup.py - install]
env:
TEMPLATEFLOW_HOME: /tmp/home/setup_install
run: |
python -m venv /tmp/setup_install
source /tmp/setup_install/bin/activate
python -m pip install -U "setuptools >= 45" wheel "setuptools_scm >= 6.2" \
setuptools_scm_git_archive "${{ matrix.pip }}"
python -m pip install "numpy==1.20" Cython "pandas==1.3" "scipy==1.7"
python setup.py install
INSTALLED_VERSION=$(python -c 'import templateflow as tf; print(tf.__version__, end="")')
echo "INSTALLED: \"${INSTALLED_VERSION}\""
test "${INSTALLED_VERSION}" = "${THISVERSION}"
- name: Re-install in confined environment [setup.py - install]
env:
TEMPLATEFLOW_HOME: /tmp/home/setup_install
run: |
source /tmp/setup_install/bin/activate
python setup.py install
find ${TEMPLATEFLOW_HOME} >> /tmp/.setup-install.txt
- name: Re-install in confined environment [setup.py - install - missing template]
env:
TEMPLATEFLOW_HOME: /tmp/home/setup_install
run: |
rm -rf ${TEMPLATEFLOW_HOME}/tpl-MNI152NLin2009cAsym
source /tmp/setup_install/bin/activate
python setup.py install
python -c "import templateflow; templateflow.update(overwrite=False)"
find ${TEMPLATEFLOW_HOME} >> /tmp/.setup-install-2.txt
diff /tmp/.setup-install.txt /tmp/.setup-install-2.txt
exit $?
- name: Install in confined environment [setup.py - develop]
env:
TEMPLATEFLOW_HOME: /tmp/home/setup_develop
- name: Re-install
run: |
python -m venv /tmp/setup_develop
source /tmp/setup_develop/bin/activate
python -m pip install -U "setuptools >= 45" wheel "setuptools_scm >= 6.2" \
setuptools_scm_git_archive "${{ matrix.pip }}"
python -m pip install "numpy==1.20" Cython "pandas==1.3" "scipy==1.7"
python setup.py develop
INSTALLED_VERSION=$(python -c 'import templateflow as tf; print(tf.__version__, end="")')
echo "INSTALLED: \"${INSTALLED_VERSION}\""
test "${INSTALLED_VERSION}" = "${THISVERSION}"
- name: Re-install in confined environment [setup.py - develop]
env:
TEMPLATEFLOW_HOME: /tmp/home/setup_develop
run: |
source /tmp/setup_develop/bin/activate
python setup.py develop
find ${TEMPLATEFLOW_HOME} >> /tmp/.setup-develop.txt
- name: Re-install in confined environment [setup.py - develop - missing template]
env:
TEMPLATEFLOW_HOME: /tmp/home/setup_develop
pip install $TARGET --force-reinstall
find ${TEMPLATEFLOW_HOME} >> /tmp/.install.txt
- name: Re-install [missing template]
run: |
rm -rf ${TEMPLATEFLOW_HOME}/tpl-MNI152NLin2009cAsym
source /tmp/setup_develop/bin/activate
python setup.py develop
pip install $TARGET --force-reinstall
python -c "import templateflow; templateflow.update(overwrite=False)"
find ${TEMPLATEFLOW_HOME} >> /tmp/.setup-develop-2.txt
diff /tmp/.setup-develop.txt /tmp/.setup-develop-2.txt
find ${TEMPLATEFLOW_HOME} >> /tmp/.install-2.txt
diff /tmp/.install.txt /tmp/.install-2.txt
exit $?
12 changes: 12 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
@@ -1,3 +1,15 @@
23.0.0 (February 2, 2023)
=========================
Minor release including additional API features and an updated skeleton.

* FIX: Preempt ``BIDSLayout`` from indexing dot-folders (#99)
* ENH: Make sure existing ``layout.get_*`` are not bubbled in (#102)
* ENH: Allow access to PyBIDS' magic ``get_*`` (#101)
* ENH: Add an ``api.ls()`` function to list (without getting) files (#97)
* MAINT: Discontinue legacy docker runners of CircleCI (#104)
* MAINT: Rotate CircleCI secrets and setup up org-level context (#103)
* MAINT: Fix docs build environment in CircleCI (#96)

0.8.1 (May 7, 2022)
===================
Patch release updating the S3 skeleton to include the fixed version of ``tpl-MouseIn``.
Expand Down
4 changes: 2 additions & 2 deletions docs/environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -152,8 +152,6 @@ dependencies:
- requests=2.27.1=pyhd8ed1ab_0
- scipy=1.8.0=py39hee8e79c_1
- setuptools=62.1.0=py39hf3d152e_0
- setuptools-scm=6.4.2=pyhd8ed1ab_0
- setuptools_scm=6.4.2=hd8ed1ab_0
- six=1.16.0=pyh6c4a22f_0
- snowballstemmer=2.2.0=pyhd8ed1ab_0
- soupsieve=2.3.1=pyhd8ed1ab_0
Expand Down Expand Up @@ -202,6 +200,8 @@ dependencies:
- docopt==0.6.2
- formulaic==0.3.4
- nibabel==3.2.2
- nipreps-versions==1.0.3
- pandas==1.4.2
- pybids==0.15.2
- setuptools_scm==7.1.0
- sqlalchemy==1.3.24
3 changes: 2 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
requires = [
"setuptools >= 45",
"setuptools_scm >= 6.2",
"wheel"
"nipreps-versions",
]
build-backend = "setuptools.build_meta"

Expand All @@ -13,3 +13,4 @@ write_to_template = """\
__version__ = "{version}"
"""
fallback_version = "0.0"
version_scheme = "nipreps-calver"
Loading

0 comments on commit 1c81342

Please sign in to comment.