-
Notifications
You must be signed in to change notification settings - Fork 21
/
Copy pathcibuildwheel.toml
87 lines (74 loc) · 2.76 KB
/
cibuildwheel.toml
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
[tool.cibuildwheel]
build-frontend = "build"
linux.manylinux-x86_64-image = "manylinux_2_28"
linux.manylinux-aarch64-image = "manylinux_2_28"
linux.musllinux-x86_64-image = "musllinux_1_2"
linux.musllinux-aarch64-image = "musllinux_1_2"
# Don't build 32-bit wheels / PyPy / musllinux arm64
skip = [
"*-manylinux_i686",
"*-musllinux_i686",
"*-win32",
"pp*",
"*-musllinux_aarch64",
]
# Python 3.8 can't be tested on macOS arm64
test-skip = "cp38-macosx_arm64"
build-verbosity = 1
linux.before-all = [
"yum install -y llvm-toolset || yum -v install -y llvm-toolset",
]
before-test = [
"pip install -r {project}/mypy/test-requirements.txt",
]
# pytest looks for configuration files in the parent directories of where the tests live.
# since we are trying to run the tests from their installed location, we copy those into
# the venv. Ew ew ew.
# We don't run external mypyc tests since there's some issue with compilation on the
# manylinux image we use.
test-command = """ \
( \
DIR=$(python -c 'import mypy, os; dn = os.path.dirname; print(dn(dn(mypy.__path__[0])))') \
&& cp '{project}/mypy/pyproject.toml' '{project}/mypy/conftest.py' $DIR \
\
&& MYPY_TEST_DIR=$(python -c 'import mypy.test; print(mypy.test.__path__[0])') \
&& MYPYC_TEST_DIR=$(python -c 'import mypyc.test; print(mypyc.test.__path__[0])') \
\
&& MYPY_TEST_PREFIX='{project}/mypy' pytest $MYPY_TEST_DIR $MYPYC_TEST_DIR -k 'not test_external' \
)
"""
# I ran into some flaky tests on windows, so only run testcheck. it looks like we
# previously didn't run any tests on windows wheels, so this is a net win.
windows.test-command = """ \
bash -c "( \
DIR=$(python -c 'import mypy, os; dn = os.path.dirname; print(dn(dn(mypy.__path__[0])))') \
&& cp '{project}/mypy/pyproject.toml' '{project}/mypy/conftest.py' $DIR \
\
&& MYPY_TEST_DIR=$(python -c 'import mypy.test; print(mypy.test.__path__[0])') \
&& MYPY_TEST_PREFIX='{project}/mypy' pytest $MYPY_TEST_DIR/testcheck.py \
)"
"""
[tool.cibuildwheel.config-settings]
--build-option = "--use-mypyc"
[tool.cibuildwheel.environment]
MYPYC_OPT_LEVEL = "3"
MYPYC_DEBUG_LEVEL = "0"
[tool.cibuildwheel.windows.environment]
MYPYC_OPT_LEVEL = "2"
MYPYC_DEBUG_LEVEL = "0"
[tool.cibuildwheel.linux.environment]
# Add llvm paths to environment to eliminate scl usage (like manylinux image does for gcc toolset).
MYPYC_OPT_LEVEL = "3"
MYPYC_DEBUG_LEVEL = "0"
PATH="$PATH:/opt/rh/llvm-toolset-17.0/root/usr/bin"
LD_LIBRARY_PATH="$LD_LIBRARY_PATH:/opt/rh/llvm-toolset-17.0/root/usr/lib64"
CC="clang"
[[tool.cibuildwheel.overrides]]
select = "*musllinux*"
before-all = [
"apk add --no-cache clang",
]
before-test = [
"pip install -r {project}/mypy/test-requirements.txt",
]
environment = { MYPYC_OPT_LEVEL="3", MYPYC_DEBUG_LEVEL="0", CC="clang" }