Skip to content

Commit

Permalink
Merge pull request #788 from JoostJM/circle-ci-mac-os
Browse files Browse the repository at this point in the history
Fix errors in continuous integration
  • Loading branch information
JoostJM authored May 17, 2023
2 parents 06bea71 + d2f8102 commit 8017bdb
Show file tree
Hide file tree
Showing 24 changed files with 353 additions and 420 deletions.
197 changes: 164 additions & 33 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# docker pull circleci/picard
# 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

version: 2
version: 2.1
jobs:
test-notebooks:
working_directory: /pyradiomics
Expand Down Expand Up @@ -32,10 +32,72 @@ jobs:
command: |
jupyter nbconvert --ExecutePreprocessor.kernel_name=python3 --ExecutePreprocessor.timeout=-1 --to notebook --output-dir /tmp --execute notebooks/helloRadiomics.ipynb notebooks/helloFeatureClass.ipynb notebooks/PyRadiomicsExample.ipynb
build-3.5: &build_template
build-mac-37: &build_mac_template
working_directory: ~/pyradiomics
macos:
xcode: 12.5.1
environment:
PYTHON_VERSION: 3.7.10
PYTHON_SHORT_VERSION: 3.7
steps:
- run:
name: Setup MAC OS environment
# Workaround the following error occurring because python installation is cached but gettext dependency is not
# dyld: Library not loaded: /usr/local/opt/gettext/lib/libintl.8.dylib
# Referenced from: /Users/travis/.pyenv/versions/3.7.2/bin/python
# Reason: Incompatible library version: python requires version 11.0.0 or later, but libintl.8.dylib provides version 10.0.0
# See https://github.com/scikit-build/cmake-python-distributions/issues/112 and
# https://github.com/scikit-build/cmake-python-distributions/pull/113
command: |
echo "HOMEBREW_NO_AUTO_UPDATE=1" >> $BASH_ENV
brew install gettext
brew install pyenv
echo 'export PATH=$HOME/.pyenv/versions/$PYTHON_VERSION/bin:$HOME/bin:$PATH' >> $BASH_ENV
mkdir -p $HOME/bin
ln -s $(which pip3) $HOME/bin/pip
ln -s $(which python3) $HOME/bin/python
pyenv install --list
pyenv install $PYTHON_VERSION
- run:
name: Setup SciKit-CI
command: |
pip install scikit-ci scikit-ci-addons
ci_addons --install ../addons
- run:
name: Setup PyEnv
command: python ../addons/travis/install_pyenv.py
- checkout
- attach_workspace:
at: ~/pyradiomics
- run:
name: Install
command: ci install
- run:
name: Test
command: ci test
- run:
name: Build Distribution
command: ci after_test
- persist_to_workspace:
root: .
paths: [dist]

build-mac-38:
<<: *build_mac_template
environment:
PYTHON_VERSION: 3.8.10
PYTHON_SHORT_VERSION: 3.7

build-mac-39:
<<: *build_mac_template
environment:
PYTHON_VERSION: 3.9.5
PYTHON_SHORT_VERSION: 3.9

build-37: &build_template
working_directory: /pyradiomics
docker:
- image: circleci/python:3.5-jessie
- image: cimg/python:3.7
user: root
steps:
- checkout
Expand All @@ -57,43 +119,89 @@ jobs:
command: ci after_test
- persist_to_workspace:
root: .
paths: dist
paths: [dist]

build-3.6:
build-38:
<<: *build_template
docker:
- image: circleci/python:3.6-jessie
- image: cimg/python:3.8
user: root

build-3.7:
build-39:
<<: *build_template
docker:
- image: circleci/python:3.7
user: root
- image: cimg/python:3.9
user: root

test_deploy:
working_directory: /pyradiomics
docker:
- image: cimg/python:3.8
user: root
steps:
- run:
name: Check Repo User
command: if [[ $CIRCLE_PROJECT_USERNAME != "AIM-Harvard" ]]; then circleci step halt; fi
- checkout
- run:
name: Setup SciKit-CI
command: |
pip install scikit-ci scikit-ci-addons
ci_addons --install ../addons
- run:
name: Install
command: ci install
- run:
name: Install patchelf auditwheel, twine
command: |
apt update
apt-get install patchelf # needed to run auditwheel
python -m pip install "auditwheel<3.2.0"
python -m pip install twine
# only attach the workspace at this point to prevent the removal of source distributions
- attach_workspace:
at: /pyradiomics
- run:
name: Create sdist
command: python setup.py sdist
- run:
name: Fix Distribution Wheels
command: |
ls ./dist/*-linux_$(uname -m).whl # This will prevent further deployment if no wheels are found
# Since there are no external shared libraries to bundle into the wheels
# this step will fixup the wheel switching from 'linux' to 'manylinux1' tag
for whl in $(ls ./dist/*-linux_$(uname -m).whl); do
python -m auditwheel repair $whl -w ./dist/
rm $whl
done
- run:
name: Deploy source and linux wheels
command: python -m twine upload ./dist/*.whl ./dist/*.tar.gz -u $PYPI_TEST_USER -p $PYPI_TEST_PASSWORD -r testpypi

deploy:
working_directory: /pyradiomics
docker:
- image: circleci/python:3.6-jessie
- image: cimg/python:3.6
user: root
steps:
- run:
name: Check Repo User
command: if [[ $CIRCLE_PROJECT_USERNAME != "Radiomics" ]]; then circleci step halt; fi
command: if [[ $CIRCLE_PROJECT_USERNAME != "AIM-Harvard" ]]; then circleci step halt; fi
- checkout
- run:
name: Setup SciKit-CI
command: |
pip install scikit-ci==0.13.0 scikit-ci-addons==0.11.0
pip install scikit-ci scikit-ci-addons
ci_addons --install ../addons
- run:
name: Install
command: ci install
- run:
name: Install patchelf auditwheel, twine
command: |
apt update
apt-get install patchelf # needed to run auditwheel
python -m pip install auditwheel
python -m pip install "auditwheel<3.2.0"
python -m pip install twine
# only attach the workspace at this point to prevent the removal of source distributions
- attach_workspace:
Expand All @@ -108,22 +216,22 @@ jobs:
# Since there are no external shared libraries to bundle into the wheels
# this step will fixup the wheel switching from 'linux' to 'manylinux1' tag
for whl in $(ls ./dist/*-linux_$(uname -m).whl); do
auditwheel repair $whl -w ./dist/
python -m auditwheel repair $whl -w ./dist/
rm $whl
done
- run:
name: Deploy source and linux wheels
command: twine upload ./dist/*.whl ./dist/*.tar.gz -u $PYPI_USER -p $PYPI_PASSWORD
command: python -m twine upload ./dist/*.whl ./dist/*.tar.gz -u $PYPI_USER -p $PYPI_PASSWORD

deploy_conda:
working_directory: /pyradiomics
docker:
- image: circleci/python:3.6-jessie
- image: cimg/python:3.8
user: root
steps:
- run:
name: Check Repo User
command: if [[ $CIRCLE_PROJECT_USERNAME != "Radiomics" ]]; then circleci step halt; fi
command: if [[ $CIRCLE_PROJECT_USERNAME != "AIM-Harvard" ]]; then circleci step halt; fi
- checkout
- run:
name: Install Miniconda
Expand All @@ -141,9 +249,10 @@ jobs:
name: Build Conda packages
command: |
mkdir /conda-bld
conda build ./conda --python=3.5 --croot /conda-bld
conda build ./conda --python=3.6 --croot /conda-bld
conda build ./conda --python=3.7 --croot /conda-bld
conda build ./conda --python=3.8 --croot /conda-bld
conda build ./conda --python=3.9 --croot /conda-bld
- run:
name: Deploy Conda packages
command: |
Expand All @@ -153,31 +262,53 @@ workflows:
version: 2
build_and_deploy:
jobs:
- build-3.5: &build_job_template
- build-mac-37: &build_job_template
filters:
tags:
only:
- /^v?[0-9]+(\.[0-9]+)*(rc[0-9]+)?/
- build-3.6:
- /^v?[0-9]+(\.[0-9]+)*((a|b|rc)[0-9]+)?/
- build-mac-38:
<<: *build_job_template
- build-3.7:
- build-mac-39:
<<: *build_job_template
- test-notebooks:
requires:
- build-3.5
- build-3.6
- build-3.7
- deploy: &deploy_template
- build-37:
<<: *build_job_template
- build-38:
<<: *build_job_template
- build-39:
<<: *build_job_template
- test-notebooks: &requires_template
requires:
- build-3.5
- build-3.6
- build-3.7
- build-37
- build-38
- build-39
- build-mac-37
- build-mac-38
- build-mac-39
- test_deploy:
<<: *requires_template
filters:
branches:
ignore:
- /.*/
tags:
only:
- /^v?[0-9]+(\.[0-9]+)*(rc[0-9]+)?/
- /^v?[0-9]+(\.[0-9]+)*((a|b|rc)[0-9]+)/
- deploy:
<<: *requires_template
filters:
branches:
ignore:
- /.*/
tags:
only:
- /^v?[0-9]+(\.[0-9]+)*/
- deploy_conda:
<<: *deploy_template
<<: *requires_template
filters:
branches:
ignore:
- /.*/
tags:
only:
- /^v?[0-9]+(\.[0-9]+)*((a|b|rc)[0-9]+)?/
88 changes: 0 additions & 88 deletions .travis.yml

This file was deleted.

3 changes: 1 addition & 2 deletions MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ include requirements-dev.txt
include requirements-setup.txt
include versioneer.py

recursive-include radiomics *
recursive-include src/radiomics *

recursive-include data/baseline *
recursive-include data *_image.nrrd
Expand All @@ -24,4 +24,3 @@ recursive-include bin *.py

recursive-exclude * __pycache__
recursive-exclude * *.py[cod]
recursive-exclude * nosetests.xml
Loading

0 comments on commit 8017bdb

Please sign in to comment.