Skip to content

Commit ae2887e

Browse files
committed
chore: add a pip installation
1 parent 7678f5d commit ae2887e

File tree

2 files changed

+26
-9
lines changed

2 files changed

+26
-9
lines changed

.github/workflows/pythonpackage.yml

Lines changed: 24 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ jobs:
3030
uses: actions/setup-python@v1
3131
with:
3232
python-version: ${{ matrix.python-version }}
33+
3334
- name: Build in confined environment and interpolate version
3435
run: |
3536
python -m venv /tmp/buildenv
@@ -39,6 +40,9 @@ jobs:
3940
python setup.py sdist bdist_wheel
4041
python -m twine check dist/templateflow*
4142
43+
mv dist /tmp/package
44+
rm -rf templateflow.egg-info/
45+
4246
# Interpolate version
4347
if [[ "$GITHUB_REF" == refs/tags/* ]]; then
4448
TAG=${GITHUB_REF##*/}
@@ -47,14 +51,28 @@ jobs:
4751
THISVERSION=${TAG:-$THISVERSION}
4852
echo "Expected VERSION: \"${THISVERSION}\""
4953
echo ::set-env name=THISVERSION::"${THISVERSION}"
54+
55+
- name: Install in confined environment [pip]
56+
env:
57+
TEMPLATEFLOW_HOME: /tmp/home/pip
58+
run: |
59+
python -m venv /tmp/pip
60+
source /tmp/pip/bin/activate
61+
python -m pip install "setuptools ~= 42.0" "pip>=10.0.1"
62+
python -m pip install .
63+
INSTALLED_VERSION=$(python -c 'import templateflow as tf; print(tf.__version__, end="")')
64+
echo "VERSION: \"${THISVERSION}\""
65+
echo "INSTALLED: \"${INSTALLED_VERSION}\""
66+
test "${INSTALLED_VERSION}" = "${THISVERSION}"
67+
5068
- name: Install in confined environment [sdist]
5169
env:
5270
TEMPLATEFLOW_HOME: /tmp/home/sdist
5371
run: |
5472
python -m venv /tmp/install_sdist
5573
source /tmp/install_sdist/bin/activate
5674
python -m pip install "setuptools ~= 42.0" "pip>=10.0.1"
57-
python -m pip install dist/templateflow*.tar.gz
75+
python -m pip install /tmp/package/templateflow*.tar.gz
5876
INSTALLED_VERSION=$(python -c 'import templateflow as tf; print(tf.__version__, end="")')
5977
echo "VERSION: \"${THISVERSION}\""
6078
echo "INSTALLED: \"${INSTALLED_VERSION}\""
@@ -65,15 +83,15 @@ jobs:
6583
TEMPLATEFLOW_HOME: /tmp/home/sdist
6684
run: |
6785
source /tmp/install_sdist/bin/activate
68-
python -m pip install dist/templateflow*.tar.gz
86+
python -m pip install /tmp/package/templateflow*.tar.gz
6987
find ${TEMPLATEFLOW_HOME} >> /tmp/.sdist-install.txt
7088
- name: Re-install in confined environment [sdist - missing template]
7189
env:
7290
TEMPLATEFLOW_HOME: /tmp/home/sdist
7391
run: |
7492
rm -rf ${TEMPLATEFLOW_HOME}/tpl-MNI152NLin2009cAsym
7593
source /tmp/install_sdist/bin/activate
76-
python -m pip install dist/templateflow*.tar.gz
94+
python -m pip install /tmp/package/templateflow*.tar.gz
7795
python -c "import templateflow; templateflow.update(overwrite=False)"
7896
find ${TEMPLATEFLOW_HOME} >> /tmp/.sdist-install-2.txt
7997
diff /tmp/.sdist-install.txt /tmp/.sdist-install-2.txt
@@ -86,7 +104,7 @@ jobs:
86104
python -m venv /tmp/install_wheel
87105
source /tmp/install_wheel/bin/activate
88106
python -m pip install "setuptools ~= 42.0" "pip>=10.0.1"
89-
python -m pip install dist/templateflow*.whl
107+
python -m pip install /tmp/package/templateflow*.whl
90108
INSTALLED_VERSION=$(python -c 'import templateflow as tf; print(tf.__version__, end="")')
91109
echo "INSTALLED: \"${INSTALLED_VERSION}\""
92110
test "${INSTALLED_VERSION}" = "${THISVERSION}"
@@ -96,15 +114,15 @@ jobs:
96114
TEMPLATEFLOW_HOME: /tmp/home/wheel
97115
run: |
98116
source /tmp/install_wheel/bin/activate
99-
python -m pip install dist/templateflow*.whl
117+
python -m pip install /tmp/package/templateflow*.whl
100118
find ${TEMPLATEFLOW_HOME} >> /tmp/.wheel-install.txt
101119
- name: Re-install in confined environment [wheel - missing template]
102120
env:
103121
TEMPLATEFLOW_HOME: /tmp/home/wheel
104122
run: |
105123
rm -rf ${TEMPLATEFLOW_HOME}/tpl-MNI152NLin2009cAsym
106124
source /tmp/install_wheel/bin/activate
107-
python -m pip install dist/templateflow*.whl
125+
python -m pip install /tmp/package/templateflow*.whl
108126
# Wheels do not run post-install hooks:
109127
test ! -d ${TEMPLATEFLOW_HOME}/tpl-MNI152NLin2009cAsym
110128
python -c "import templateflow; templateflow.update(overwrite=False)"

.travis.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ matrix:
3535

3636
before_install:
3737
- python -m pip install -U $PIP
38-
- python -m pip install -U "setuptools>=42.0" "setuptools_scm[toml]>=3.4"
38+
- python -m pip install -U "setuptools>=42.0" "setuptools_scm[toml]>=3.4" wheel
3939
- pip install -U flake8
4040

4141
install:
@@ -66,8 +66,7 @@ script:
6666
INTENDED_VERSION="$(python setup.py --version)"
6767
mkdir for_testing
6868
cd for_testing
69-
INSTALLED_VERSION="$(python -c 'import templateflow; print(templateflow.__version__)')"
70-
python -c 'import templateflow; print(templateflow.__file__)'
69+
INSTALLED_VERSION=$( python -c "import templateflow; print(templateflow.__version__, end='')" )
7170
echo "Intended: $INTENDED_VERSION"
7271
echo "Installed: $INSTALLED_VERSION"
7372
test "$INTENDED_VERSION" == "$INSTALLED_VERSION"

0 commit comments

Comments
 (0)