Skip to content

Commit 4df3dfd

Browse files
committed
CI: Fix Pypi package build, broken by twine 2.0, which does not work with Python <3.6
1 parent ef1941b commit 4df3dfd

File tree

1 file changed

+20
-24
lines changed

1 file changed

+20
-24
lines changed

.circleci/config.yml

Lines changed: 20 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -234,22 +234,23 @@ jobs:
234234
fi
235235
236236
test_deploy_pypi:
237-
machine:
238-
image: circleci/classic:201711-01
237+
docker:
238+
- image: circleci/python:3.7.4
239239
working_directory: /tmp/src/dmriprep
240240
steps:
241241
- checkout
242+
- run:
243+
name: Start virtual environment
244+
command: |
245+
sudo python -m pip install "setuptools>=30.3.0" "pip>=10.0.1" twine
246+
python -m venv /tmp/venv
247+
source /tmp/venv/bin/activate
242248
- run:
243249
name: Build dMRIPrep
244250
command: |
245-
pyenv local 3.5.2
246-
pip install twine # For use in checking distributions
247251
THISVERSION=$( python get_version.py )
248252
THISVERSION=${THISVERSION%.dirty*}
249253
THISVERSION=${CIRCLE_TAG:-$THISVERSION}
250-
virtualenv --python=python build
251-
source build/bin/activate
252-
pip install --upgrade "pip>=19.1" numpy
253254
echo "${CIRCLE_TAG:-$THISVERSION}" > dmriprep/VERSION
254255
python setup.py sdist
255256
pip wheel --no-deps -w dist/ .
@@ -258,14 +259,10 @@ jobs:
258259
- run:
259260
name: Check sdist distribution
260261
command: |
261-
pyenv local 3.5.2
262262
THISVERSION=$( python get_version.py )
263263
THISVERSION=${THISVERSION%.dirty*}
264264
THISVERSION=${CIRCLE_TAG:-$THISVERSION}
265265
twine check dist/dmriprep*.tar.gz
266-
virtualenv --python=python sdist
267-
source sdist/bin/activate
268-
pip install --upgrade "pip>=19.1" numpy
269266
pip install dist/dmriprep*.tar.gz
270267
which dmriprep | grep sdist\\/bin
271268
INSTALLED_VERSION=$(dmriprep --version)
@@ -277,13 +274,10 @@ jobs:
277274
- run:
278275
name: Check wheel distribution
279276
command: |
280-
pyenv local 3.5.2
281277
THISVERSION=$( python get_version.py )
282278
THISVERSION=${THISVERSION%.dirty*}
283279
THISVERSION=${CIRCLE_TAG:-$THISVERSION}
284280
twine check dist/dmriprep*.whl
285-
virtualenv --python=python wheel
286-
source wheel/bin/activate
287281
pip install dist/dmriprep*.whl
288282
which dmriprep | grep wheel\\/bin
289283
INSTALLED_VERSION=$(dmriprep --version)
@@ -296,27 +290,29 @@ jobs:
296290
path: /tmp/src/dmriprep/dist
297291

298292
deploy_pypi:
299-
machine:
300-
image: circleci/classic:201711-01
293+
docker:
294+
- image: circleci/python:3.7.4
301295
working_directory: /tmp/src/dmriprep
302296
steps:
303297
- checkout
298+
- run:
299+
name: Start virtual environment
300+
command: |
301+
sudo python -m pip install "setuptools>=30.3.0" "pip>=10.0.1" twine
302+
python -m venv /tmp/venv
303+
source /tmp/venv/bin/activate
304304
- run:
305305
name: Build dMRIPrep
306306
command: |
307-
sudo setfacl -d -m group:$(id -gn):rwx /tmp/src/dmriprep
308-
sudo setfacl -m group:$(id -gn):rwx /tmp/src/dmriprep
309-
pyenv local 3.5.2
310307
THISVERSION=$( python get_version.py )
308+
THISVERSION=${THISVERSION%.dirty*}
309+
THISVERSION=${CIRCLE_TAG:-$THISVERSION}
311310
echo "${CIRCLE_TAG:-$THISVERSION}" > dmriprep/VERSION
312-
docker run --rm=false --entrypoint=/bin/bash -v `pwd`:/io -w /io python:3.6.9 -c "pip install numpy && python setup.py sdist"
313-
docker run --rm=false -e PLAT='manylinux1_x86_64' -e PKGNAME='dmriprep' -v `pwd`:/io \
314-
quay.io/pypa/manylinux1_x86_64 /io/.circleci/pypi_wheel/build-wheels.sh
311+
python setup.py sdist
312+
pip wheel --no-deps -w dist/ .
315313
- run:
316314
name: Upload packages to PyPI
317315
command: |
318-
pyenv local 3.5.2
319-
pip install twine
320316
twine upload dist/dmriprep*
321317
322318
deployable:

0 commit comments

Comments
 (0)