Skip to content

Commit 8017bdb

Browse files
authored
Merge pull request #788 from JoostJM/circle-ci-mac-os
Fix errors in continuous integration
2 parents 06bea71 + d2f8102 commit 8017bdb

24 files changed

+353
-420
lines changed

.circleci/config.yml

Lines changed: 164 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# docker pull circleci/picard
33
# docker run -it --rm -v /var/run/docker.sock:/var/run/docker.sock -v $(pwd):$(pwd) -v ~/.circleci/:/root/.circleci --workdir $(pwd) circleci/picard circleci build
44

5-
version: 2
5+
version: 2.1
66
jobs:
77
test-notebooks:
88
working_directory: /pyradiomics
@@ -32,10 +32,72 @@ jobs:
3232
command: |
3333
jupyter nbconvert --ExecutePreprocessor.kernel_name=python3 --ExecutePreprocessor.timeout=-1 --to notebook --output-dir /tmp --execute notebooks/helloRadiomics.ipynb notebooks/helloFeatureClass.ipynb notebooks/PyRadiomicsExample.ipynb
3434
35-
build-3.5: &build_template
35+
build-mac-37: &build_mac_template
36+
working_directory: ~/pyradiomics
37+
macos:
38+
xcode: 12.5.1
39+
environment:
40+
PYTHON_VERSION: 3.7.10
41+
PYTHON_SHORT_VERSION: 3.7
42+
steps:
43+
- run:
44+
name: Setup MAC OS environment
45+
# Workaround the following error occurring because python installation is cached but gettext dependency is not
46+
# dyld: Library not loaded: /usr/local/opt/gettext/lib/libintl.8.dylib
47+
# Referenced from: /Users/travis/.pyenv/versions/3.7.2/bin/python
48+
# Reason: Incompatible library version: python requires version 11.0.0 or later, but libintl.8.dylib provides version 10.0.0
49+
# See https://github.com/scikit-build/cmake-python-distributions/issues/112 and
50+
# https://github.com/scikit-build/cmake-python-distributions/pull/113
51+
command: |
52+
echo "HOMEBREW_NO_AUTO_UPDATE=1" >> $BASH_ENV
53+
brew install gettext
54+
brew install pyenv
55+
echo 'export PATH=$HOME/.pyenv/versions/$PYTHON_VERSION/bin:$HOME/bin:$PATH' >> $BASH_ENV
56+
mkdir -p $HOME/bin
57+
ln -s $(which pip3) $HOME/bin/pip
58+
ln -s $(which python3) $HOME/bin/python
59+
pyenv install --list
60+
pyenv install $PYTHON_VERSION
61+
- run:
62+
name: Setup SciKit-CI
63+
command: |
64+
pip install scikit-ci scikit-ci-addons
65+
ci_addons --install ../addons
66+
- run:
67+
name: Setup PyEnv
68+
command: python ../addons/travis/install_pyenv.py
69+
- checkout
70+
- attach_workspace:
71+
at: ~/pyradiomics
72+
- run:
73+
name: Install
74+
command: ci install
75+
- run:
76+
name: Test
77+
command: ci test
78+
- run:
79+
name: Build Distribution
80+
command: ci after_test
81+
- persist_to_workspace:
82+
root: .
83+
paths: [dist]
84+
85+
build-mac-38:
86+
<<: *build_mac_template
87+
environment:
88+
PYTHON_VERSION: 3.8.10
89+
PYTHON_SHORT_VERSION: 3.7
90+
91+
build-mac-39:
92+
<<: *build_mac_template
93+
environment:
94+
PYTHON_VERSION: 3.9.5
95+
PYTHON_SHORT_VERSION: 3.9
96+
97+
build-37: &build_template
3698
working_directory: /pyradiomics
3799
docker:
38-
- image: circleci/python:3.5-jessie
100+
- image: cimg/python:3.7
39101
user: root
40102
steps:
41103
- checkout
@@ -57,43 +119,89 @@ jobs:
57119
command: ci after_test
58120
- persist_to_workspace:
59121
root: .
60-
paths: dist
122+
paths: [dist]
61123

62-
build-3.6:
124+
build-38:
63125
<<: *build_template
64126
docker:
65-
- image: circleci/python:3.6-jessie
127+
- image: cimg/python:3.8
66128
user: root
67129

68-
build-3.7:
130+
build-39:
69131
<<: *build_template
70132
docker:
71-
- image: circleci/python:3.7
72-
user: root
133+
- image: cimg/python:3.9
134+
user: root
135+
136+
test_deploy:
137+
working_directory: /pyradiomics
138+
docker:
139+
- image: cimg/python:3.8
140+
user: root
141+
steps:
142+
- run:
143+
name: Check Repo User
144+
command: if [[ $CIRCLE_PROJECT_USERNAME != "AIM-Harvard" ]]; then circleci step halt; fi
145+
- checkout
146+
- run:
147+
name: Setup SciKit-CI
148+
command: |
149+
pip install scikit-ci scikit-ci-addons
150+
ci_addons --install ../addons
151+
- run:
152+
name: Install
153+
command: ci install
154+
- run:
155+
name: Install patchelf auditwheel, twine
156+
command: |
157+
apt update
158+
apt-get install patchelf # needed to run auditwheel
159+
python -m pip install "auditwheel<3.2.0"
160+
python -m pip install twine
161+
# only attach the workspace at this point to prevent the removal of source distributions
162+
- attach_workspace:
163+
at: /pyradiomics
164+
- run:
165+
name: Create sdist
166+
command: python setup.py sdist
167+
- run:
168+
name: Fix Distribution Wheels
169+
command: |
170+
ls ./dist/*-linux_$(uname -m).whl # This will prevent further deployment if no wheels are found
171+
# Since there are no external shared libraries to bundle into the wheels
172+
# this step will fixup the wheel switching from 'linux' to 'manylinux1' tag
173+
for whl in $(ls ./dist/*-linux_$(uname -m).whl); do
174+
python -m auditwheel repair $whl -w ./dist/
175+
rm $whl
176+
done
177+
- run:
178+
name: Deploy source and linux wheels
179+
command: python -m twine upload ./dist/*.whl ./dist/*.tar.gz -u $PYPI_TEST_USER -p $PYPI_TEST_PASSWORD -r testpypi
73180

74181
deploy:
75182
working_directory: /pyradiomics
76183
docker:
77-
- image: circleci/python:3.6-jessie
184+
- image: cimg/python:3.6
78185
user: root
79186
steps:
80187
- run:
81188
name: Check Repo User
82-
command: if [[ $CIRCLE_PROJECT_USERNAME != "Radiomics" ]]; then circleci step halt; fi
189+
command: if [[ $CIRCLE_PROJECT_USERNAME != "AIM-Harvard" ]]; then circleci step halt; fi
83190
- checkout
84191
- run:
85192
name: Setup SciKit-CI
86193
command: |
87-
pip install scikit-ci==0.13.0 scikit-ci-addons==0.11.0
194+
pip install scikit-ci scikit-ci-addons
88195
ci_addons --install ../addons
89196
- run:
90197
name: Install
91198
command: ci install
92199
- run:
93200
name: Install patchelf auditwheel, twine
94201
command: |
202+
apt update
95203
apt-get install patchelf # needed to run auditwheel
96-
python -m pip install auditwheel
204+
python -m pip install "auditwheel<3.2.0"
97205
python -m pip install twine
98206
# only attach the workspace at this point to prevent the removal of source distributions
99207
- attach_workspace:
@@ -108,22 +216,22 @@ jobs:
108216
# Since there are no external shared libraries to bundle into the wheels
109217
# this step will fixup the wheel switching from 'linux' to 'manylinux1' tag
110218
for whl in $(ls ./dist/*-linux_$(uname -m).whl); do
111-
auditwheel repair $whl -w ./dist/
219+
python -m auditwheel repair $whl -w ./dist/
112220
rm $whl
113221
done
114222
- run:
115223
name: Deploy source and linux wheels
116-
command: twine upload ./dist/*.whl ./dist/*.tar.gz -u $PYPI_USER -p $PYPI_PASSWORD
224+
command: python -m twine upload ./dist/*.whl ./dist/*.tar.gz -u $PYPI_USER -p $PYPI_PASSWORD
117225

118226
deploy_conda:
119227
working_directory: /pyradiomics
120228
docker:
121-
- image: circleci/python:3.6-jessie
229+
- image: cimg/python:3.8
122230
user: root
123231
steps:
124232
- run:
125233
name: Check Repo User
126-
command: if [[ $CIRCLE_PROJECT_USERNAME != "Radiomics" ]]; then circleci step halt; fi
234+
command: if [[ $CIRCLE_PROJECT_USERNAME != "AIM-Harvard" ]]; then circleci step halt; fi
127235
- checkout
128236
- run:
129237
name: Install Miniconda
@@ -141,9 +249,10 @@ jobs:
141249
name: Build Conda packages
142250
command: |
143251
mkdir /conda-bld
144-
conda build ./conda --python=3.5 --croot /conda-bld
145252
conda build ./conda --python=3.6 --croot /conda-bld
146253
conda build ./conda --python=3.7 --croot /conda-bld
254+
conda build ./conda --python=3.8 --croot /conda-bld
255+
conda build ./conda --python=3.9 --croot /conda-bld
147256
- run:
148257
name: Deploy Conda packages
149258
command: |
@@ -153,31 +262,53 @@ workflows:
153262
version: 2
154263
build_and_deploy:
155264
jobs:
156-
- build-3.5: &build_job_template
265+
- build-mac-37: &build_job_template
157266
filters:
158267
tags:
159268
only:
160-
- /^v?[0-9]+(\.[0-9]+)*(rc[0-9]+)?/
161-
- build-3.6:
269+
- /^v?[0-9]+(\.[0-9]+)*((a|b|rc)[0-9]+)?/
270+
- build-mac-38:
162271
<<: *build_job_template
163-
- build-3.7:
272+
- build-mac-39:
164273
<<: *build_job_template
165-
- test-notebooks:
166-
requires:
167-
- build-3.5
168-
- build-3.6
169-
- build-3.7
170-
- deploy: &deploy_template
274+
- build-37:
275+
<<: *build_job_template
276+
- build-38:
277+
<<: *build_job_template
278+
- build-39:
279+
<<: *build_job_template
280+
- test-notebooks: &requires_template
171281
requires:
172-
- build-3.5
173-
- build-3.6
174-
- build-3.7
282+
- build-37
283+
- build-38
284+
- build-39
285+
- build-mac-37
286+
- build-mac-38
287+
- build-mac-39
288+
- test_deploy:
289+
<<: *requires_template
175290
filters:
176291
branches:
177292
ignore:
178293
- /.*/
179294
tags:
180295
only:
181-
- /^v?[0-9]+(\.[0-9]+)*(rc[0-9]+)?/
296+
- /^v?[0-9]+(\.[0-9]+)*((a|b|rc)[0-9]+)/
297+
- deploy:
298+
<<: *requires_template
299+
filters:
300+
branches:
301+
ignore:
302+
- /.*/
303+
tags:
304+
only:
305+
- /^v?[0-9]+(\.[0-9]+)*/
182306
- deploy_conda:
183-
<<: *deploy_template
307+
<<: *requires_template
308+
filters:
309+
branches:
310+
ignore:
311+
- /.*/
312+
tags:
313+
only:
314+
- /^v?[0-9]+(\.[0-9]+)*((a|b|rc)[0-9]+)?/

.travis.yml

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

MANIFEST.in

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ include requirements-dev.txt
66
include requirements-setup.txt
77
include versioneer.py
88

9-
recursive-include radiomics *
9+
recursive-include src/radiomics *
1010

1111
recursive-include data/baseline *
1212
recursive-include data *_image.nrrd
@@ -24,4 +24,3 @@ recursive-include bin *.py
2424

2525
recursive-exclude * __pycache__
2626
recursive-exclude * *.py[cod]
27-
recursive-exclude * nosetests.xml

0 commit comments

Comments
 (0)