Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MAINT: Move packaging tests from TravisCI to GitHub Actions #135

Merged
merged 6 commits into from
Dec 9, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -505,7 +505,7 @@ jobs:
python -m venv /tmp/sdist
source /tmp/sdist/bin/activate
python -m pip install -U pip
python -m pip install "setuptools>=30.3.0" twine
python -m pip install "setuptools>=40.8.0" twine
- run:
name: Build dMRIPrep
command: |
Expand Down Expand Up @@ -540,7 +540,7 @@ jobs:
python -m venv /tmp/wheel
source /tmp/wheel/bin/activate
python -m pip install -U pip
python -m pip install "setuptools>=30.3.0" twine
python -m pip install "setuptools>=40.8.0" twine
THISVERSION=$( python get_version.py )
THISVERSION=${THISVERSION%.dirty*}
THISVERSION=${CIRCLE_TAG:-$THISVERSION}
Expand Down Expand Up @@ -568,7 +568,7 @@ jobs:
python -m venv /tmp/sdist
source /tmp/sdist/bin/activate
python -m pip install -U pip
python -m pip install "setuptools>=30.3.0" twine
python -m pip install "setuptools>=40.8.0" wheel twine
- run:
name: Build dMRIPrep
command: |
Expand Down
103 changes: 103 additions & 0 deletions .github/workflows/pythonpackage.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
name: Python package

on:
push:
branches: [ '*' ]
tags: [ '*' ]
pull_request:
branches: [ master, 'maint/*' ]

jobs:
build:
if: "!contains(github.event.head_commit.message, '[skip ci]')"
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.7, 3.8]
pip: ["pip~=18.1", "pip>=20.3"]
setuptools: ["setuptools==40.8.0", "setuptools"]

steps:
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v1
with:
python-version: ${{ matrix.python-version }}
- uses: actions/checkout@v2
with:
ssh-key: "${{ secrets.NIPREPS_DEPLOY }}"
- name: Fetch all tags (for versioneer to work)
if: "!startsWith(github.ref, 'refs/tags/')"
run: |
/usr/bin/git -c protocol.version=2 fetch --tags --prune --unshallow origin
- name: Build in confined, updated environment and interpolate version
run: |
python -m venv /tmp/buildenv
source /tmp/buildenv/bin/activate
python -m pip install -U setuptools pip wheel twine docutils
python setup.py sdist bdist_wheel
python -m twine check dist/dmriprep*
# Interpolate version
if [[ "$GITHUB_REF" == refs/tags/* ]]; then
TAG=${GITHUB_REF##*/}
fi
THISVERSION=$( python get_version.py )
THISVERSION=${TAG:-$THISVERSION}
echo "Expected VERSION: \"${THISVERSION}\""
echo "THISVERSION=${THISVERSION}" >> ${GITHUB_ENV}
- name: Install in confined environment [sdist]
run: |
python -m venv /tmp/install_sdist
source /tmp/install_sdist/bin/activate
python -m pip install "${{ matrix.pip }}" "${{ matrix.setuptools }}"
python -m pip install dist/dmriprep*.tar.gz
INSTALLED_VERSION=$(python -c 'import dmriprep; print(dmriprep.__version__, end="")')
echo "VERSION: \"${THISVERSION}\""
echo "INSTALLED: \"${INSTALLED_VERSION}\""
test "${INSTALLED_VERSION}" = "${THISVERSION}"
- name: Install in confined environment [wheel]
run: |
python -m venv /tmp/install_wheel
source /tmp/install_wheel/bin/activate
python -m pip install "${{ matrix.pip }}" "${{ matrix.setuptools }}"
python -m pip install dist/dmriprep*.whl
INSTALLED_VERSION=$(python -c 'import dmriprep; print(dmriprep.__version__, end="")')
echo "INSTALLED: \"${INSTALLED_VERSION}\""
test "${INSTALLED_VERSION}" = "${THISVERSION}"
- name: Install in confined environment [setup.py - install]
run: |
python -m venv /tmp/setup_install
source /tmp/setup_install/bin/activate
python -m pip install "${{ matrix.pip }}" "${{ matrix.setuptools }}"
python -m pip install numpy scipy "Cython >= 0.28.5" # sklearn needs this
python -m pip install scikit-learn # otherwise it attempts to build it
python setup.py install
INSTALLED_VERSION=$(python -c 'import dmriprep; print(dmriprep.__version__, end="")')
echo "INSTALLED: \"${INSTALLED_VERSION}\""
test "${INSTALLED_VERSION}" = "${THISVERSION}"
- name: Install in confined environment [setup.py - develop]
run: |
python -m venv /tmp/setup_develop
source /tmp/setup_develop/bin/activate
python -m pip install "${{ matrix.pip }}" "${{ matrix.setuptools }}"
# sklearn needs these dependencies
if [ "${{ matrix.python-version }}" == "3.6" ]; then
python -m pip install "numpy < 1.20" scipy "Cython >= 0.28.5" # numpy 1.20 drops Py3.6
else
python -m pip install numpy scipy "Cython >= 0.28.5"
fi
python -m pip install scikit-learn # otherwise it attempts to build it
python setup.py develop
INSTALLED_VERSION=$(python -c 'import dmriprep; print(dmriprep.__version__, end="")')
echo "INSTALLED: \"${INSTALLED_VERSION}\""
test "${INSTALLED_VERSION}" = "${THISVERSION}"
flake8:
if: "!contains(github.event.head_commit.message, '[skip ci]')"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python 3.7
uses: actions/setup-python@v1
with:
python-version: 3.7
- run: pip install flake8
- run: flake8 dmriprep
92 changes: 0 additions & 92 deletions .travis.yml

This file was deleted.

4 changes: 2 additions & 2 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ install_requires =
numpy
pybids >= 0.11.1
pyyaml
sdcflows ~= 1.3.3
smriprep ~= 0.7.0
sdcflows >= 2.0.0rc2
smriprep >= 0.8.0rc0
templateflow ~= 0.6
toml
setup_requires =
Expand Down