Skip to content

Commit 8a974d6

Browse files
authored
Merge pull request #1 from CastXML/add-continuous-integration
Add continuous integration for macOS, manylinux and Windows wheels
2 parents 92573b2 + e12ad0f commit 8a974d6

14 files changed

+599
-9
lines changed

.circleci/config.yml

Lines changed: 119 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,119 @@
1+
version: 2
2+
3+
references:
4+
5+
ci_steps: &ci_steps
6+
working_directory: /work
7+
steps:
8+
- checkout
9+
- run:
10+
name: Run CI
11+
command: |
12+
#
13+
# Run CI
14+
#
15+
export MANYLINUX_PYTHON=$(echo ${CIRCLE_JOB} | cut -d"_" -f2)
16+
echo "MANYLINUX_PYTHON [${MANYLINUX_PYTHON}]"
17+
/opt/python/${MANYLINUX_PYTHON}/bin/pip install scikit-ci
18+
/opt/python/${MANYLINUX_PYTHON}/bin/ci
19+
- persist_to_workspace:
20+
root: ./
21+
paths:
22+
- dist
23+
24+
x64_build_job: &x64_build_job
25+
docker:
26+
- image: dockcross/manylinux2014-x64
27+
<<: *ci_steps
28+
29+
# x86_build_job: &x86_build_job
30+
# docker:
31+
# - image: dockcross/manylinux2014-x86
32+
# <<: *ci_steps
33+
34+
no_filters: &no_filters
35+
filters:
36+
tags:
37+
only: /.*/
38+
39+
jobs:
40+
41+
# x64
42+
# manylinux-x64_cp27-cp27mu:
43+
# <<: *x64_build_job
44+
manylinux-x64_cp37-cp37m:
45+
<<: *x64_build_job
46+
47+
# x86
48+
# manylinux-x86_cp27-cp27mu:
49+
# <<: *x86_build_job
50+
# manylinux-x86_cp37-cp37m:
51+
# <<: *x86_build_job
52+
53+
deploy-master:
54+
docker:
55+
- image: circleci/python:3.7.0-stretch
56+
steps:
57+
- attach_workspace:
58+
at: ./
59+
- run:
60+
name: Deploy master
61+
command: |
62+
echo "Deploy master (not implemented)"
63+
64+
deploy-release:
65+
docker:
66+
- image: circleci/python:3.7.0-stretch
67+
steps:
68+
- attach_workspace:
69+
at: ./
70+
- run:
71+
name: Deploy release
72+
command: |
73+
echo "Deploy release"
74+
python -m venv ../venv
75+
. ../venv/bin/activate
76+
pip install twine
77+
ls dist
78+
twine upload -u __token__ -p $PYPI_PASSWORD --skip-existing dist/*
79+
80+
workflows:
81+
version: 2
82+
build-test-deploy:
83+
jobs:
84+
# x64
85+
# - manylinux-x64_cp27-cp27mu:
86+
# <<: *no_filters
87+
- manylinux-x64_cp37-cp37m:
88+
<<: *no_filters
89+
# x86
90+
# - manylinux-x86_cp27-cp27mu:
91+
# <<: *no_filters
92+
# - manylinux-x86_cp37-cp37m:
93+
# <<: *no_filters
94+
95+
- deploy-master:
96+
requires:
97+
# x64
98+
# - manylinux-x64_cp27-cp27mu
99+
- manylinux-x64_cp37-cp37m
100+
# x86
101+
# - manylinux-x86_cp27-cp27mu
102+
# - manylinux-x86_cp37-cp37m
103+
filters:
104+
branches:
105+
only: master
106+
- deploy-release:
107+
requires:
108+
# x64
109+
# - manylinux-x64_cp27-cp27mu
110+
- manylinux-x64_cp37-cp37m
111+
# x86
112+
# - manylinux-x86_cp27-cp27mu
113+
# - manylinux-x86_cp37-cp37m
114+
filters:
115+
tags:
116+
only: /^[0-9]+(\.[0-9]+)*(\.post[0-9]+)?$/
117+
branches:
118+
ignore: /.*/
119+

.coveragerc

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
[run]
2+
branch = True
3+
include = castxml/*.py
4+
omit = castxml/_version.py
5+
6+
[xml]
7+
output = tests/coverage.xml

.travis.yml

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
branches:
2+
only:
3+
- master
4+
- /^[0-9]+(\.[0-9]+)*(\.post[0-9]+)?$/
5+
6+
language: python
7+
8+
matrix:
9+
include:
10+
11+
- os: osx
12+
language: generic
13+
env:
14+
- PYTHON_VERSION=3.7.2
15+
16+
- os: osx
17+
language: generic
18+
env:
19+
- PYTHON_VERSION=2.7.15
20+
21+
cache:
22+
directories:
23+
- $HOME/.pyenv/versions/3.7.2
24+
- $HOME/.pyenv/versions/2.7.15
25+
- $HOME/downloads
26+
27+
before_install:
28+
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then mkdir $HOME/bin; ln -s $(which pip2) $HOME/bin/pip; ln -s $(which python2) $HOME/bin/python; fi
29+
- python -m pip install --disable-pip-version-check --upgrade pip
30+
- pip install -U scikit-ci scikit-ci-addons
31+
- ci_addons --install ../addons
32+
33+
install:
34+
- ci install
35+
36+
script:
37+
- ci test
38+
39+
after_success:
40+
- ci after_test
41+
42+
deploy:
43+
# deploy-release
44+
- provider: script
45+
script: pwd && ls dist;echo "deploy-release" && ~/.pyenv/versions/${PYTHON_VERSION}/bin/twine upload -u $PYPI_USER -p $PYPI_PASSWORD --skip-existing dist/*
46+
skip_cleanup: true
47+
on:
48+
repo: ${TRAVIS_REPO_SLUG}
49+
tags: true
50+
# deploy-master
51+
- provider: script
52+
script: pwd && ls dist;echo "deploy-master" && echo "not implemented"
53+
skip_cleanup: true
54+
on:
55+
repo: ${TRAVIS_REPO_SLUG}
56+
branch: master
57+
58+
env:
59+
global:
60+
# PYPI_PASSWORD
61+
- secure: "KGHel2nKEcPM6VAYgBdwPEKghrUfylvtAXsXm2kjxzTT2zCiOYWTy0pb1grKlvcasRcvSViuiGL6x/tyTT2mh5Qf74S5WgIbgo2VEFIP9XekNRiYFOp4UEfup0Roa4tL3Yvb+xkcF5kIe4mhf4hddAweJN0KWZt+Vk6Q6udJ4c+WyIWFaXIpl1/QyAeGs6tSpYKQiE40aGUYcRgKrZf1ydPqLJ1SKul13nurnZ3CsH7GcezsVbmdV0QvUcfPwefMSO+pMMMirQmKj977dPRz7CI0hlw0sJTGIOLxHIQNYBMBYu6G81yjyNHh2BKjAXv7V4K5Rc9TmCdAQYSmkhRQVBsaLxIYMuux5w8ms+ldd0oXd38UoFLhZyu4QZBAROEsTRPWLugzsJWgPJRQazv2ENZE5QykzIMJJf4VpTGWQfhbCgUA7GIHUYYKFiJ6Jr33Fzv1HKVhUabSB2yWYiMYoy54rosvxiwSacrC0aWEFGiB9D6sbEQ9rKdHY2ivmT1u/iFw+Qb59uaWy0lm1qoYiLbBt5tpJr5epdc+rOo9i0QB81KhU7/4Hf4kr+QRGxIp/jXEpbrKqgG6YCTzxEMZ2PV3uzV2Z3ZUqupRdcihmouhy7TnbIG7vhm7fVtold9Wwmoiv46/FT2v0EjjiMunhgEhk7t5Lia+qwJgPzrx5xw="

CMakeLists.txt

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,9 @@ message(STATUS "CastXML Python Distribution")
4444
message(STATUS "")
4545
message(STATUS " ARCHIVE_DOWNLOAD_DIR : ${ARCHIVE_DOWNLOAD_DIR}")
4646
message(STATUS "")
47-
message(STATUS " src_archive : ${src_archive}")
48-
message(STATUS " <src_archive>_url : ${${src_archive}_url}")
49-
message(STATUS " <src_archive>_sha256 : ${${src_archive}_sha512}")
47+
message(STATUS " binary_archive : ${binary_archive}")
48+
message(STATUS " <binary_archive>_url : ${${binary_archive}_url}")
49+
message(STATUS " <binary_archive>_sha512 : ${${binary_archive}_sha512}")
5050
message(STATUS "")
5151
message(STATUS "*********************************************")
5252

@@ -61,5 +61,5 @@ FetchContent_Populate(castxmlrelease
6161
set(CASTXML_RELEASE_DIR ${castxmlrelease_SOURCE_DIR})
6262

6363
set(castxml_executable ${CASTXML_RELEASE_DIR}/bin/castxml${CMAKE_EXECUTABLE_SUFFIX})
64-
65-
install(PROGRAMS ${castxml_executable} DESTINATION castxml/data/bin)
64+
install(PROGRAMS ${castxml_executable} DESTINATION bin)
65+
install(DIRECTORY ${CASTXML_RELEASE_DIR}/share/ DESTINATION share)

appveyor.yml

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
branches:
2+
only:
3+
- master
4+
- /^[0-9]+(\.[0-9]+)*(\.post[0-9]+)?$/
5+
6+
version: "0.0.1.{build}"
7+
8+
environment:
9+
matrix:
10+
11+
# - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
12+
# PYTHON_DIR: "C:\\Python27"
13+
# PYTHON_VERSION: "2.7.x"
14+
# PYTHON_ARCH: "32"
15+
# BLOCK: "0"
16+
17+
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
18+
PYTHON_DIR: "C:\\Python27-x64"
19+
PYTHON_VERSION: "2.7.x"
20+
PYTHON_ARCH: "64"
21+
BLOCK: "0"
22+
23+
# - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
24+
# PYTHON_DIR: "C:\\Python37"
25+
# PYTHON_VERSION: "3.7.x"
26+
# PYTHON_ARCH: "32"
27+
# BLOCK: "0"
28+
29+
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
30+
PYTHON_DIR: "C:\\Python37-x64"
31+
PYTHON_VERSION: "3.7.x"
32+
PYTHON_ARCH: "64"
33+
BLOCK: "0"
34+
35+
PYPI_USER:
36+
secure: j/nubIi1eucjCtYuwpykWg==
37+
PYPI_PASSWORD:
38+
secure: qDoPKmtLMdcKUKRHuTlfaajjzO4Q4yu25FM5JuB7z84=
39+
40+
cache:
41+
- C:\\cmake-3.6.2
42+
43+
init:
44+
- python -m pip install -U scikit-ci scikit-ci-addons
45+
- python -m ci_addons --install ../addons
46+
47+
- ps: ../addons/appveyor/rolling-build.ps1
48+
49+
install:
50+
- python -m ci install
51+
52+
build_script:
53+
- python -m ci build
54+
55+
test_script:
56+
- python -m ci test
57+
58+
after_test:
59+
- python -m ci after_test
60+
61+
on_finish:
62+
- ps: ../addons/appveyor/enable-worker-remote-access.ps1 -check_for_block
63+
64+
deploy_script:
65+
- ps: |
66+
if ($env:appveyor_repo_tag -eq $true -and $env:appveyor_repo_tag_name –match "^[0-9]+(\.[0-9]+)*(\.post[0-9]+)?$") {
67+
Write-Host "deploy release"
68+
$env:PATH="$env:PYTHON_DIR/Scripts/;$env:PATH"
69+
twine upload -u $env:PYPI_USER -p $env:PYPI_PASSWORD --skip-existing dist/*
70+
} elseif ($env:appveyor_repo_branch -eq "master") {
71+
Write-Host "deploy master (not implemented)"
72+
} else {
73+
Write-Host "nothing to deploy"
74+
}
75+
76+
matrix:
77+
fast_finish: false

castxml/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,4 +37,4 @@ def _program(name, args):
3737

3838

3939
def castxml():
40-
raise SystemExit(_program('castxml', sys.argv[1:]))
40+
raise SystemExit(_program('castxml', sys.argv[1:]))

requirements-dev.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
cmake
2+
coverage>=4.2
3+
flake8>=3.0.4
24
pytest>=4.5.0
5+
pytest-cov>=2.4.0
36
pytest-runner>=5.1
47
pytest-virtualenv>=1.7.0
58
scikit-build>=0.10.0

scikit-ci.yml

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
schema_version: "0.5.0"
2+
3+
before_install:
4+
5+
appveyor:
6+
environment:
7+
PATH: $<PYTHON_DIR>;$<PYTHON_DIR>\\Scripts;$<PATH>
8+
commands:
9+
- python ../addons/appveyor/patch_vs2008.py
10+
11+
circle:
12+
environment:
13+
PATH: /opt/python/$<MANYLINUX_PYTHON>/bin:$<PATH>
14+
# Required to build cryptography wheel from source for cp37-cp37 when using manylinux-x86
15+
CFLAGS: -I/usr/local/ssl/include -L/usr/local/ssl/lib
16+
17+
travis:
18+
osx:
19+
environment:
20+
PATH: $<HOME>/.pyenv/versions/$<PYTHON_VERSION>/bin:$<PATH>
21+
SETUP_BDIST_WHEEL_ARGS: --plat-name macosx-10.6-x86_64
22+
commands:
23+
- python ../addons/travis/install_pyenv.py
24+
25+
install:
26+
commands:
27+
- python -c "import sys; print(sys.version)"
28+
- python -m pip install --disable-pip-version-check --upgrade pip
29+
- pip install git+https://github.com/jcfr/wheeltools.git@wheeltools-2018-10-28-a2f174d0e
30+
- pip install -U -r requirements-dev.txt
31+
32+
before_build:
33+
commands:
34+
- flake8
35+
36+
build:
37+
commands:
38+
# Built distribution (wheel)
39+
- python setup.py --hide-listing bdist_wheel $<SETUP_BDIST_WHEEL_ARGS> -- $<SETUP_CMAKE_ARGS>
40+
41+
circle:
42+
commands:
43+
- |
44+
# Since there are no external shared libraries to bundle into the wheels
45+
# this step will fixup the wheel switching from 'linux' to 'manylinux' tag
46+
for whl in dist/*$(python -c "import wheel.pep425tags as w; print(w.get_platform())").whl; do
47+
auditwheel repair $whl -w ./dist/
48+
rm $whl
49+
done
50+
51+
test:
52+
commands:
53+
# Convert to generic platform wheel
54+
- python: |
55+
import glob, sys
56+
sys.path.insert(0, "./scripts")
57+
from convert_to_generic_platform_wheel import convert_to_generic_platform_wheel
58+
wheels = glob.glob("dist/*.whl")
59+
for wheel in wheels:
60+
convert_to_generic_platform_wheel(wheel, remove_original=True)
61+
- python setup.py test
62+
63+
#after_test:
64+
# commands:
65+
# - codecov -X gcov --required --file ./tests/coverage.xml

0 commit comments

Comments
 (0)