Skip to content

Commit 7a2ad1d

Browse files
authored
Merge pull request #135 from nipreps/maint/migrate-travis-to-gha
MAINT: Move packaging tests from TravisCI to GitHub Actions
2 parents 087188c + 3a0edb3 commit 7a2ad1d

File tree

4 files changed

+108
-97
lines changed

4 files changed

+108
-97
lines changed

.circleci/config.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -505,7 +505,7 @@ jobs:
505505
python -m venv /tmp/sdist
506506
source /tmp/sdist/bin/activate
507507
python -m pip install -U pip
508-
python -m pip install "setuptools>=30.3.0" twine
508+
python -m pip install "setuptools>=40.8.0" twine
509509
- run:
510510
name: Build dMRIPrep
511511
command: |
@@ -540,7 +540,7 @@ jobs:
540540
python -m venv /tmp/wheel
541541
source /tmp/wheel/bin/activate
542542
python -m pip install -U pip
543-
python -m pip install "setuptools>=30.3.0" twine
543+
python -m pip install "setuptools>=40.8.0" twine
544544
THISVERSION=$( python get_version.py )
545545
THISVERSION=${THISVERSION%.dirty*}
546546
THISVERSION=${CIRCLE_TAG:-$THISVERSION}
@@ -568,7 +568,7 @@ jobs:
568568
python -m venv /tmp/sdist
569569
source /tmp/sdist/bin/activate
570570
python -m pip install -U pip
571-
python -m pip install "setuptools>=30.3.0" twine
571+
python -m pip install "setuptools>=40.8.0" wheel twine
572572
- run:
573573
name: Build dMRIPrep
574574
command: |

.github/workflows/pythonpackage.yml

Lines changed: 103 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,103 @@
1+
name: Python package
2+
3+
on:
4+
push:
5+
branches: [ '*' ]
6+
tags: [ '*' ]
7+
pull_request:
8+
branches: [ master, 'maint/*' ]
9+
10+
jobs:
11+
build:
12+
if: "!contains(github.event.head_commit.message, '[skip ci]')"
13+
runs-on: ubuntu-latest
14+
strategy:
15+
matrix:
16+
python-version: [3.7, 3.8]
17+
pip: ["pip~=18.1", "pip>=20.3"]
18+
setuptools: ["setuptools==40.8.0", "setuptools"]
19+
20+
steps:
21+
- name: Set up Python ${{ matrix.python-version }}
22+
uses: actions/setup-python@v1
23+
with:
24+
python-version: ${{ matrix.python-version }}
25+
- uses: actions/checkout@v2
26+
with:
27+
ssh-key: "${{ secrets.NIPREPS_DEPLOY }}"
28+
- name: Fetch all tags (for versioneer to work)
29+
if: "!startsWith(github.ref, 'refs/tags/')"
30+
run: |
31+
/usr/bin/git -c protocol.version=2 fetch --tags --prune --unshallow origin
32+
- name: Build in confined, updated environment and interpolate version
33+
run: |
34+
python -m venv /tmp/buildenv
35+
source /tmp/buildenv/bin/activate
36+
python -m pip install -U setuptools pip wheel twine docutils
37+
python setup.py sdist bdist_wheel
38+
python -m twine check dist/dmriprep*
39+
# Interpolate version
40+
if [[ "$GITHUB_REF" == refs/tags/* ]]; then
41+
TAG=${GITHUB_REF##*/}
42+
fi
43+
THISVERSION=$( python get_version.py )
44+
THISVERSION=${TAG:-$THISVERSION}
45+
echo "Expected VERSION: \"${THISVERSION}\""
46+
echo "THISVERSION=${THISVERSION}" >> ${GITHUB_ENV}
47+
- name: Install in confined environment [sdist]
48+
run: |
49+
python -m venv /tmp/install_sdist
50+
source /tmp/install_sdist/bin/activate
51+
python -m pip install "${{ matrix.pip }}" "${{ matrix.setuptools }}"
52+
python -m pip install dist/dmriprep*.tar.gz
53+
INSTALLED_VERSION=$(python -c 'import dmriprep; print(dmriprep.__version__, end="")')
54+
echo "VERSION: \"${THISVERSION}\""
55+
echo "INSTALLED: \"${INSTALLED_VERSION}\""
56+
test "${INSTALLED_VERSION}" = "${THISVERSION}"
57+
- name: Install in confined environment [wheel]
58+
run: |
59+
python -m venv /tmp/install_wheel
60+
source /tmp/install_wheel/bin/activate
61+
python -m pip install "${{ matrix.pip }}" "${{ matrix.setuptools }}"
62+
python -m pip install dist/dmriprep*.whl
63+
INSTALLED_VERSION=$(python -c 'import dmriprep; print(dmriprep.__version__, end="")')
64+
echo "INSTALLED: \"${INSTALLED_VERSION}\""
65+
test "${INSTALLED_VERSION}" = "${THISVERSION}"
66+
- name: Install in confined environment [setup.py - install]
67+
run: |
68+
python -m venv /tmp/setup_install
69+
source /tmp/setup_install/bin/activate
70+
python -m pip install "${{ matrix.pip }}" "${{ matrix.setuptools }}"
71+
python -m pip install numpy scipy "Cython >= 0.28.5" # sklearn needs this
72+
python -m pip install scikit-learn # otherwise it attempts to build it
73+
python setup.py install
74+
INSTALLED_VERSION=$(python -c 'import dmriprep; print(dmriprep.__version__, end="")')
75+
echo "INSTALLED: \"${INSTALLED_VERSION}\""
76+
test "${INSTALLED_VERSION}" = "${THISVERSION}"
77+
- name: Install in confined environment [setup.py - develop]
78+
run: |
79+
python -m venv /tmp/setup_develop
80+
source /tmp/setup_develop/bin/activate
81+
python -m pip install "${{ matrix.pip }}" "${{ matrix.setuptools }}"
82+
# sklearn needs these dependencies
83+
if [ "${{ matrix.python-version }}" == "3.6" ]; then
84+
python -m pip install "numpy < 1.20" scipy "Cython >= 0.28.5" # numpy 1.20 drops Py3.6
85+
else
86+
python -m pip install numpy scipy "Cython >= 0.28.5"
87+
fi
88+
python -m pip install scikit-learn # otherwise it attempts to build it
89+
python setup.py develop
90+
INSTALLED_VERSION=$(python -c 'import dmriprep; print(dmriprep.__version__, end="")')
91+
echo "INSTALLED: \"${INSTALLED_VERSION}\""
92+
test "${INSTALLED_VERSION}" = "${THISVERSION}"
93+
flake8:
94+
if: "!contains(github.event.head_commit.message, '[skip ci]')"
95+
runs-on: ubuntu-latest
96+
steps:
97+
- uses: actions/checkout@v2
98+
- name: Set up Python 3.7
99+
uses: actions/setup-python@v1
100+
with:
101+
python-version: 3.7
102+
- run: pip install flake8
103+
- run: flake8 dmriprep

.travis.yml

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

setup.cfg

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@ install_requires =
2929
numpy
3030
pybids >= 0.11.1
3131
pyyaml
32-
sdcflows ~= 1.3.3
33-
smriprep ~= 0.7.0
32+
sdcflows >= 2.0.0rc2
33+
smriprep >= 0.8.0rc0
3434
templateflow ~= 0.6
3535
toml
3636
setup_requires =

0 commit comments

Comments
 (0)