Skip to content

Commit 774d3ff

Browse files
committed
chore(deployment): fix deployment script
1 parent f056d58 commit 774d3ff

File tree

2 files changed

+26
-48
lines changed

2 files changed

+26
-48
lines changed

.circleci/config.yml

Lines changed: 25 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -150,53 +150,44 @@ jobs:
150150
- run:
151151
name: Prepare build environment
152152
command: |
153-
virtualenv --python=python3 /tmp/build
154-
source /tmp/build/bin/activate
155-
python3 -m pip install "setuptools ~= 42.0" "setuptools_scm[toml] >= 3.4" "pip>=10.0.1" \
156-
twine docutils
153+
python3 -m venv /tmp/buildenv
154+
source /tmp/buildenv/bin/activate
155+
python3 -m pip install "setuptools ~= 42.0" wheel "setuptools_scm[toml] >= 3.4" \
156+
"pip>=10.0.1" twine docutils
157157
- run:
158-
name: Build NiTransforms in build environment
158+
name: Build NiTransforms in build environment and check
159159
command: |
160-
source /tmp/build/bin/activate
160+
source /tmp/buildenv/bin/activate
161+
python3 setup.py check -r -s
161162
python setup.py sdist bdist_wheel
162-
- run:
163-
name: Check sdist package in build environment
164-
command: |
165-
source /tmp/build/bin/activate
166163
twine check dist/nitransforms*
167164
- store_artifacts:
168165
path: /tmp/src/nitransforms/dist
169166
- run:
170-
name: Prepare sdist install environment
167+
name: Install on separate environment and check version [sdist]
171168
command: |
172-
virtualenv --python=python3 /tmp/install_sdist
169+
python3 -m venv /tmp/install_sdist
173170
source /tmp/install_sdist/bin/activate
174171
python3 -m pip install "setuptools ~= 42.0" "setuptools_scm[toml] >= 3.4" "pip>=10.0.1"
175-
- run:
176-
name: Install sdist package into install environment and check version
177-
command: |
178-
source /tmp/install_sdist/bin/activate
179-
THISVERSION=$( python setup.py --version )
172+
173+
THISVERSION=$( python3 setup.py --version )
180174
THISVERSION=${CIRCLE_TAG:-$THISVERSION}
181-
pip install dist/nitransforms*.tar.gz
182-
INSTALLED_VERSION=$(python -c 'import nitransforms as nit; print(nit.__version__, end="")')
175+
python3 -m pip install dist/nitransforms*.tar.gz
176+
INSTALLED_VERSION=$(python3 -c 'import nitransforms as nit; print(nit.__version__, end="")')
183177
echo "VERSION: \"${THISVERSION}\""
184178
echo "INSTALLED: \"${INSTALLED_VERSION}\""
185179
test "${INSTALLED_VERSION}" = "${THISVERSION}"
186180
- run:
187-
name: Prepare wheel install environment
188-
command: |
189-
virtualenv --python=python3 /tmp/install_wheel
190-
source /tmp/install_wheel/bin/activate
191-
python3 -m pip install "setuptools ~= 42.0" "setuptools_scm[toml] >= 3.4" "pip>=10.0.1"
192-
- run:
193-
name: Install wheel into install environment and check version
181+
name: Install on separate environment and check version [wheel]
194182
command: |
183+
python3 -m venv /tmp/install_wheel
195184
source /tmp/install_wheel/bin/activate
196-
THISVERSION=$( python setup.py --version )
185+
python3 -m pip install "setuptools ~= 42.0" wheel "setuptools_scm[toml] >= 3.4" "pip>=10.0.1"
186+
187+
THISVERSION=$( python3 setup.py --version )
197188
THISVERSION=${CIRCLE_TAG:-$THISVERSION}
198-
pip install dist/nitransforms*.whl
199-
INSTALLED_VERSION=$(python -c 'import nitransforms as nit; print(nit.__version__, end="")')
189+
python3 -m pip install dist/nitransforms*.whl
190+
INSTALLED_VERSION=$(python3 -c 'import nitransforms as nit; print(nit.__version__, end="")')
200191
echo "VERSION: \"${THISVERSION}\""
201192
echo "INSTALLED: \"${INSTALLED_VERSION}\""
202193
test "${INSTALLED_VERSION}" = "${THISVERSION}"
@@ -208,26 +199,13 @@ jobs:
208199
steps:
209200
- checkout
210201
- run:
211-
name: Install build depends
212-
command: python3 -m pip install "setuptools ~= 42.0" "setuptools_scm[toml] >= 3.4" "pip>=10.0.1" "twine<2.0" docutils
213-
- run:
214-
name: Build and check
202+
name: Build and upload to Pypi
215203
command: |
216-
python3 setup.py check -r -s
217-
python3 setup.py sdist
204+
python3 -m venv /tmp/buildenv
205+
source /tmp/buildenv/bin/activate
206+
python3 -m pip install "setuptools ~= 42.0" "setuptools_scm[toml] >= 3.4" wheel "pip>=10.0.1" twine docutils
207+
python3 setup.py sdist bdist_wheel
218208
python3 -m twine check dist/*
219-
- run:
220-
name: Validate version
221-
command: |
222-
THISVERSION=$( python setup.py --version )
223-
python3 -m pip install dist/*.tar.gz
224-
mkdir empty
225-
cd empty
226-
INSTALLED=$( python3 -c 'import nitransforms; print(nitransforms.__version__)' )
227-
test "${CIRCLE_TAG:-$THISVERSION}" == "$INSTALLED"
228-
- run:
229-
name: Upload to PyPi
230-
command: |
231209
python3 -m twine upload dist/*
232210
233211
workflows:

setup.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ classifiers =
1010
Programming Language :: Python :: 3.7
1111
Programming Language :: Python :: 3.8
1212
description = NiTransforms -- Neuroimaging spatial transforms in Python.
13-
license = MIT
13+
license = MIT License
1414
long_description = file:README.md
1515
long_description_content_type = text/markdown; charset=UTF-8
1616
provides = nitransforms

0 commit comments

Comments
 (0)