forked from scikit-build/cmake-python-distributions
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathscikit-ci.yml
154 lines (141 loc) · 6.2 KB
/
scikit-ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
schema_version: "0.5.0"
before_install:
appveyor:
environment:
PATH: $<PYTHON_DIR>;$<PYTHON_DIR>\\Scripts;$<PATH>
commands:
- python ../addons/appveyor/patch_vs2008.py
circle:
environment:
PATH: /opt/python/$<MANYLINUX_PYTHON>/bin:$<PATH>
SETUP_CMAKE_ARGS: -DCMAKE_JOB_POOL_COMPILE:STRING=compile -DCMAKE_JOB_POOL_LINK:STRING=link '-DCMAKE_JOB_POOLS:STRING=compile=4;link=3'
commands:
- |
if [[ ${DEFAULT_DOCKCROSS_IMAGE} == *"manylinux2014-aarch64"* ]]; then
./scripts/manylinux2014-aarch64-build-and-install-openssl.sh
fi
- python: |
import ci, os
image_name=os.environ["DEFAULT_DOCKCROSS_IMAGE"].split(":")[0].split("/")[1]
print("image_name [%s]" % image_name)
manylinux_version=image_name.split("-")[0]
arch=image_name.split("-")[1]
manylinux_arch = {"x86": "i686", "x64": "x86_64"}.get(arch, arch)
print("arch [%s]" % arch)
print("manylinux_version [%s]" % manylinux_version)
print("manylinux_arch [%s]" % manylinux_arch)
# Support using older manylinux images explicitly setting AUDITWHEEL_* environment variables
os.environ["AUDITWHEEL_ARCH"] = manylinux_arch
os.environ["AUDITWHEEL_PLAT"] = manylinux_version + "_" + manylinux_arch
# CFLAGS
if arch == "x86":
# Required to build cryptography wheel from source for cp37-cp37 when using manylinux-x86
os.environ["CFLAGS"] = "-I/usr/local/ssl/include -L/usr/local/ssl/lib"
# SETUP_CMAKE_ARGS
if arch in ["x86", "x64"]:
os.environ["SETUP_CMAKE_ARGS"] = "-DOPENSSL_ROOT_DIR:PATH=/usr/local/ssl " + os.environ["SETUP_CMAKE_ARGS"]
# SETUP_BDIST_WHEEL_ARGS
if arch == "aarch64":
os.environ["SETUP_BDIST_WHEEL_ARGS"] = "--plat-name %s" % os.environ["AUDITWHEEL_PLAT"]
setup_cmake_args = []
# Remove this after addressing https://github.com/dockcross/dockcross/issues/431
setup_cmake_args.append("-DOPENSSL_ROOT_DIR:PATH=/tmp/openssl-install")
setup_cmake_args.append("-DSTRIP_EXECUTABLE:FILEPATH=" + os.environ["CROSS_ROOT"] + "/" + os.environ["CROSS_TRIPLE"] + "/bin/strip")
os.environ["SETUP_CMAKE_ARGS"] = " ".join(setup_cmake_args) + " " + os.environ["SETUP_CMAKE_ARGS"]
ci.driver.Driver.save_env(os.environ)
travis:
osx:
environment:
PATH: $<HOME>/.pyenv/versions/$<PYTHON_VERSION>/bin:$<PATH>
SETUP_BDIST_WHEEL_ARGS: --plat-name macosx-10.6-x86_64
commands:
- python ../addons/travis/install_pyenv.py
- python scripts/ssl-check.py
- python ../addons/travis/install_cmake.py 3.12.0
linux:
commands:
- python: |
import os
import ci
import platform
os.environ["SETUP_BDIST_WHEEL_ARGS"] = "--plat-name %s" % os.environ["AUDITWHEEL_PLAT"]
setup_cmake_args = []
setup_cmake_args.append("-DSTRIP_EXECUTABLE:FILEPATH=/opt/rh/devtoolset-9/root/usr/" + "/bin/strip")
if platform.machine() == "aarch64":
# Remove this after addressing https://github.com/dockcross/dockcross/issues/431
setup_cmake_args.append("-DOPENSSL_ROOT_DIR:PATH=/tmp/openssl-install")
os.environ["SETUP_CMAKE_ARGS"] = " ".join(setup_cmake_args)
os.environ["SETUP_MAKE_ARGS"] = "-j$(nproc)"
ci.driver.Driver.save_env(os.environ)
install:
commands:
- python -c "import sys; print(sys.version)"
- python -m pip install --disable-pip-version-check --upgrade pip
- pip install pytest-virtualenv -f https://github.com/jcfr/pytest-plugins/releases/tag/v1.7.0.dev15 --pre
- pip install git+https://github.com/jcfr/wheeltools.git@wheeltools-2018-10-28-a2f174d0e
- pip install -r requirements-dev.txt
before_build:
commands:
- flake8
build:
commands:
# Source distribution
- python setup.py --hide-listing sdist
# Built distribution (wheel)
- python setup.py --hide-listing bdist_wheel $<SETUP_BDIST_WHEEL_ARGS> -- $<SETUP_CMAKE_ARGS> -- $<SETUP_MAKE_ARGS>
# Cleanup
- python: |
import glob, os
if os.environ.get("UPLOAD_SDIST", "") == "":
sdist=(glob.glob("dist/*.tar.gz") + glob.glob("dist/*.zip"))[0]
print("Deleting [%s]" % sdist)
os.remove(sdist)
travis:
linux:
commands:
- |
# Since there are no external shared libraries to bundle into the wheels
# this step will fixup the wheel switching from 'linux' to 'manylinux' tag
for whl in dist/*linux*_$(arch).whl; do
auditwheel repair --plat ${AUDITWHEEL_PLAT} $whl -w ./dist
done
circle:
commands:
- |
arch=${AUDITWHEEL_ARCH}
if [[ ${arch} == "aarch64" ]]; then
exit
fi
# Since there are no external shared libraries to bundle into the wheels
# this step will fixup the wheel switching from 'linux' to 'manylinux' tag
for whl in dist/*linux_${arch}.whl; do
auditwheel repair --plat ${AUDITWHEEL_PLAT} $whl -w ./dist/
rm $whl
done
test:
commands:
# Convert to generic platform wheel
- python: |
import glob, sys
sys.path.insert(0, "./scripts")
from convert_to_generic_platform_wheel import convert_to_generic_platform_wheel
wheels = glob.glob("dist/*.whl")
for wheel in wheels:
convert_to_generic_platform_wheel(wheel, remove_original=True)
appveyor:
commands:
- python setup.py test
circle:
commands:
- |
if [[ ${AUDITWHEEL_ARCH} == "aarch64" ]]; then
exit
fi
python setup.py test
travis:
osx:
commands:
- python setup.py test
#after_test:
# commands:
# - codecov -X gcov --required --file ./tests/coverage.xml