Skip to content

Commit d258e17

Browse files
authored
Merge pull request #49 from templateflow/maint/distribute-wheel
MAINT: Distribute wheel + Revise CI framework
2 parents 63ddbac + d27f263 commit d258e17

File tree

5 files changed

+55
-102
lines changed

5 files changed

+55
-102
lines changed

.circleci/config.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -219,8 +219,8 @@ jobs:
219219
name: Deploy to PyPi
220220
command: |
221221
source /tmp/venv/bin/activate
222-
pip install "setuptools>=42.0" "setuptools_scm[toml] >= 3.4" twine
223-
python setup.py sdist
222+
pip install "setuptools>=42.0" "setuptools_scm[toml] >= 3.4" wheel twine
223+
python setup.py sdist bdist_wheel
224224
twine check dist/*
225225
twine upload dist/*
226226

.github/workflows/pythonpackage.yml

Lines changed: 39 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ jobs:
1717
strategy:
1818
matrix:
1919
python-version: [3.6, 3.7, 3.8]
20+
pip: ["pip", "pip~=10.0.1"]
2021

2122
steps:
2223
- uses: actions/checkout@v2
@@ -30,15 +31,25 @@ jobs:
3031
uses: actions/setup-python@v1
3132
with:
3233
python-version: ${{ matrix.python-version }}
34+
- uses: actions/cache@v1
35+
with:
36+
path: $HOME/.cache/pip
37+
key: pip-cache-v1
38+
restore-keys: |
39+
pip-cache-
40+
3341
- name: Build in confined environment and interpolate version
3442
run: |
3543
python -m venv /tmp/buildenv
3644
source /tmp/buildenv/bin/activate
37-
python -m pip install "setuptools ~= 42.0" wheel "setuptools_scm[toml] >= 3.4" \
38-
setuptools_scm_git_archive "pip>=10.0.1" twine docutils
45+
python -m pip install -U "setuptools ~= 42.0" wheel "setuptools_scm[toml] >= 3.4" \
46+
setuptools_scm_git_archive pip twine docutils
3947
python setup.py sdist bdist_wheel
4048
python -m twine check dist/templateflow*
4149
50+
mv dist /tmp/package
51+
rm -rf templateflow.egg-info/
52+
4253
# Interpolate version
4354
if [[ "$GITHUB_REF" == refs/tags/* ]]; then
4455
TAG=${GITHUB_REF##*/}
@@ -47,14 +58,28 @@ jobs:
4758
THISVERSION=${TAG:-$THISVERSION}
4859
echo "Expected VERSION: \"${THISVERSION}\""
4960
echo ::set-env name=THISVERSION::"${THISVERSION}"
61+
62+
- name: Install in confined environment [pip]
63+
env:
64+
TEMPLATEFLOW_HOME: /tmp/home/pip
65+
run: |
66+
python -m venv /tmp/pip
67+
source /tmp/pip/bin/activate
68+
python -m pip install -U "setuptools ~= 42.0" "setuptools_scm[toml] >= 3.4" "${{ matrix.pip }}"
69+
python -m pip install .
70+
INSTALLED_VERSION=$(python -c 'import templateflow as tf; print(tf.__version__, end="")')
71+
echo "VERSION: \"${THISVERSION}\""
72+
echo "INSTALLED: \"${INSTALLED_VERSION}\""
73+
test "${INSTALLED_VERSION}" = "${THISVERSION}"
74+
5075
- name: Install in confined environment [sdist]
5176
env:
5277
TEMPLATEFLOW_HOME: /tmp/home/sdist
5378
run: |
5479
python -m venv /tmp/install_sdist
5580
source /tmp/install_sdist/bin/activate
56-
python -m pip install "setuptools ~= 42.0" "pip>=10.0.1"
57-
python -m pip install dist/templateflow*.tar.gz
81+
python -m pip install -U "setuptools ~= 42.0" "${{ matrix.pip }}"
82+
python -m pip install /tmp/package/templateflow*.tar.gz
5883
INSTALLED_VERSION=$(python -c 'import templateflow as tf; print(tf.__version__, end="")')
5984
echo "VERSION: \"${THISVERSION}\""
6085
echo "INSTALLED: \"${INSTALLED_VERSION}\""
@@ -65,15 +90,15 @@ jobs:
6590
TEMPLATEFLOW_HOME: /tmp/home/sdist
6691
run: |
6792
source /tmp/install_sdist/bin/activate
68-
python -m pip install dist/templateflow*.tar.gz
93+
python -m pip install /tmp/package/templateflow*.tar.gz
6994
find ${TEMPLATEFLOW_HOME} >> /tmp/.sdist-install.txt
7095
- name: Re-install in confined environment [sdist - missing template]
7196
env:
7297
TEMPLATEFLOW_HOME: /tmp/home/sdist
7398
run: |
7499
rm -rf ${TEMPLATEFLOW_HOME}/tpl-MNI152NLin2009cAsym
75100
source /tmp/install_sdist/bin/activate
76-
python -m pip install dist/templateflow*.tar.gz
101+
python -m pip install /tmp/package/templateflow*.tar.gz
77102
python -c "import templateflow; templateflow.update(overwrite=False)"
78103
find ${TEMPLATEFLOW_HOME} >> /tmp/.sdist-install-2.txt
79104
diff /tmp/.sdist-install.txt /tmp/.sdist-install-2.txt
@@ -85,8 +110,8 @@ jobs:
85110
run: |
86111
python -m venv /tmp/install_wheel
87112
source /tmp/install_wheel/bin/activate
88-
python -m pip install "setuptools ~= 42.0" "pip>=10.0.1"
89-
python -m pip install dist/templateflow*.whl
113+
python -m pip install -U "setuptools ~= 42.0" "${{ matrix.pip }}"
114+
python -m pip install /tmp/package/templateflow*.whl
90115
INSTALLED_VERSION=$(python -c 'import templateflow as tf; print(tf.__version__, end="")')
91116
echo "INSTALLED: \"${INSTALLED_VERSION}\""
92117
test "${INSTALLED_VERSION}" = "${THISVERSION}"
@@ -96,15 +121,15 @@ jobs:
96121
TEMPLATEFLOW_HOME: /tmp/home/wheel
97122
run: |
98123
source /tmp/install_wheel/bin/activate
99-
python -m pip install dist/templateflow*.whl
124+
python -m pip install /tmp/package/templateflow*.whl
100125
find ${TEMPLATEFLOW_HOME} >> /tmp/.wheel-install.txt
101126
- name: Re-install in confined environment [wheel - missing template]
102127
env:
103128
TEMPLATEFLOW_HOME: /tmp/home/wheel
104129
run: |
105130
rm -rf ${TEMPLATEFLOW_HOME}/tpl-MNI152NLin2009cAsym
106131
source /tmp/install_wheel/bin/activate
107-
python -m pip install dist/templateflow*.whl
132+
python -m pip install /tmp/package/templateflow*.whl
108133
# Wheels do not run post-install hooks:
109134
test ! -d ${TEMPLATEFLOW_HOME}/tpl-MNI152NLin2009cAsym
110135
python -c "import templateflow; templateflow.update(overwrite=False)"
@@ -118,8 +143,8 @@ jobs:
118143
run: |
119144
python -m venv /tmp/setup_install
120145
source /tmp/setup_install/bin/activate
121-
python -m pip install "setuptools ~= 42.0" wheel "setuptools_scm[toml] >= 3.4" \
122-
setuptools_scm_git_archive "pip>=10.0.1"
146+
python -m pip install -U "setuptools ~= 42.0" wheel "setuptools_scm[toml] >= 3.4" \
147+
setuptools_scm_git_archive "${{ matrix.pip }}"
123148
python setup.py install
124149
INSTALLED_VERSION=$(python -c 'import templateflow as tf; print(tf.__version__, end="")')
125150
echo "INSTALLED: \"${INSTALLED_VERSION}\""
@@ -150,8 +175,8 @@ jobs:
150175
run: |
151176
python -m venv /tmp/setup_develop
152177
source /tmp/setup_develop/bin/activate
153-
python -m pip install "setuptools ~= 42.0" wheel "setuptools_scm[toml] >= 3.4" \
154-
setuptools_scm_git_archive "pip>=10.0.1"
178+
python -m pip install -U "setuptools ~= 42.0" wheel "setuptools_scm[toml] >= 3.4" \
179+
setuptools_scm_git_archive "${{ matrix.pip }}"
155180
python setup.py develop
156181
INSTALLED_VERSION=$(python -c 'import templateflow as tf; print(tf.__version__, end="")')
157182
echo "INSTALLED: \"${INSTALLED_VERSION}\""

.travis.yml

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

MANIFEST.in

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,8 @@
1-
# data
2-
include templateflow/conf/config.json
3-
include templateflow/conf/templateflow-skel.zip
4-
include templateflow/conf/templateflow-skel.md5
1+
recursive-exclude templateflow/tests *
2+
recursive-exclude templateflow/conf/tests *
3+
recursive-exclude docs/ *
54

65
recursive-exclude .circleci/ *
76
recursive-exclude .github/ *
8-
recursive-exclude docker/ *
9-
recursive-exclude docs/ *
10-
recursive-exclude joss/ *
11-
exclude .codecov.yml .coveragerc .gitignore .gitattributes .pep8speaks.yml .travis.yml .zenodo.json codecov.yml Dockerfile update_changes.sh
7+
8+
exclude .gitignore .gitattributes .git_archival.txt .travis.yml .zenodo.json codecov.yml update_changes.sh

setup.cfg

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
[metadata]
2-
author = Oscar Esteban
32
classifiers =
43
Development Status :: 3 - Alpha
54
Intended Audience :: Science/Research
@@ -36,11 +35,19 @@ test_requires =
3635
pytest-cov == 2.5.1
3736
coverage
3837
packages = find:
39-
include_package_data = True
38+
zip_safe = true
39+
40+
[options.package_data]
41+
templateflow =
42+
conf/config.json
43+
conf/templateflow-skel.zip
44+
conf/templateflow-skel.md5
4045

4146
[options.packages.find]
4247
exclude =
4348
*.tests
49+
tests.*
50+
*.tests.*
4451

4552
[options.extras_require]
4653
citations =

0 commit comments

Comments
 (0)