Skip to content

Commit 662f586

Browse files
committed
CI: Fix Pypi package build, broken by twine 2.0, which does not work with Python <3.6
2 parents ef1941b + 4df3dfd commit 662f586

File tree

1 file changed

+30
-24
lines changed

1 file changed

+30
-24
lines changed

.circleci/config.yml

Lines changed: 30 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -234,22 +234,25 @@ 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+
python -m venv /tmp/sdist
246+
source /tmp/sdist/bin/activate
247+
python -m pip install -U pip
248+
python -m pip install "setuptools>=30.3.0" twine
242249
- run:
243250
name: Build dMRIPrep
244251
command: |
245-
pyenv local 3.5.2
246-
pip install twine # For use in checking distributions
252+
source /tmp/sdist/bin/activate
247253
THISVERSION=$( python get_version.py )
248254
THISVERSION=${THISVERSION%.dirty*}
249255
THISVERSION=${CIRCLE_TAG:-$THISVERSION}
250-
virtualenv --python=python build
251-
source build/bin/activate
252-
pip install --upgrade "pip>=19.1" numpy
253256
echo "${CIRCLE_TAG:-$THISVERSION}" > dmriprep/VERSION
254257
python setup.py sdist
255258
pip wheel --no-deps -w dist/ .
@@ -258,14 +261,11 @@ jobs:
258261
- run:
259262
name: Check sdist distribution
260263
command: |
261-
pyenv local 3.5.2
264+
source /tmp/sdist/bin/activate
262265
THISVERSION=$( python get_version.py )
263266
THISVERSION=${THISVERSION%.dirty*}
264267
THISVERSION=${CIRCLE_TAG:-$THISVERSION}
265268
twine check dist/dmriprep*.tar.gz
266-
virtualenv --python=python sdist
267-
source sdist/bin/activate
268-
pip install --upgrade "pip>=19.1" numpy
269269
pip install dist/dmriprep*.tar.gz
270270
which dmriprep | grep sdist\\/bin
271271
INSTALLED_VERSION=$(dmriprep --version)
@@ -277,13 +277,14 @@ jobs:
277277
- run:
278278
name: Check wheel distribution
279279
command: |
280-
pyenv local 3.5.2
280+
python -m venv /tmp/wheel
281+
source /tmp/wheel/bin/activate
282+
python -m pip install -U pip
283+
python -m pip install "setuptools>=30.3.0" twine
281284
THISVERSION=$( python get_version.py )
282285
THISVERSION=${THISVERSION%.dirty*}
283286
THISVERSION=${CIRCLE_TAG:-$THISVERSION}
284287
twine check dist/dmriprep*.whl
285-
virtualenv --python=python wheel
286-
source wheel/bin/activate
287288
pip install dist/dmriprep*.whl
288289
which dmriprep | grep wheel\\/bin
289290
INSTALLED_VERSION=$(dmriprep --version)
@@ -296,27 +297,32 @@ jobs:
296297
path: /tmp/src/dmriprep/dist
297298

298299
deploy_pypi:
299-
machine:
300-
image: circleci/classic:201711-01
300+
docker:
301+
- image: circleci/python:3.7.4
301302
working_directory: /tmp/src/dmriprep
302303
steps:
303304
- checkout
305+
- run:
306+
name: Start virtual environment
307+
command: |
308+
python -m venv /tmp/sdist
309+
source /tmp/sdist/bin/activate
310+
python -m pip install -U pip
311+
python -m pip install "setuptools>=30.3.0" twine
304312
- run:
305313
name: Build dMRIPrep
306314
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
315+
source /tmp/sdist/bin/activate
310316
THISVERSION=$( python get_version.py )
317+
THISVERSION=${THISVERSION%.dirty*}
318+
THISVERSION=${CIRCLE_TAG:-$THISVERSION}
311319
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
320+
python setup.py sdist
321+
pip wheel --no-deps -w dist/ .
315322
- run:
316323
name: Upload packages to PyPI
317324
command: |
318-
pyenv local 3.5.2
319-
pip install twine
325+
source /tmp/sdist/bin/activate
320326
twine upload dist/dmriprep*
321327
322328
deployable:

0 commit comments

Comments
 (0)