-
Notifications
You must be signed in to change notification settings - Fork 125
Expand file tree
/
Copy pathpyproject.toml
More file actions
160 lines (138 loc) · 5.42 KB
/
pyproject.toml
File metadata and controls
160 lines (138 loc) · 5.42 KB
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
155
156
157
158
159
160
# This file configures wheels compilation for `cibuildwheel` for StringZilla CPython bindings.
# On a good day it will produce:
# - `manylinux` and `musllinux` wheels for Linux on x86_64, aarch64, i686, ppc64le, s390x;
# - `macos` wheels for x86_64 and arm64 (no universal2);
# - `windows` wheels for AMD64, x86, and ARM64.
# - for Python versions from 3.8 to 3.13.
# - running over 30,000 tests on each wheel.
# = meaning 15 platforms * 6 Python versions = 90 builds.
# = meaning over 2,700,000 tests.
[build-system]
requires = ["setuptools>=61", "wheel"]
build-backend = "build_backend"
backend-path = ["."]
[tool.pytest.ini_options]
minversion = "6.0"
addopts = ["-ra", "--showlocals", "--strict-markers", "--strict-config"]
xfail_strict = true
filterwarnings = ["error"]
[tool.black]
line-length = 120
[tool.cibuildwheel]
test-requires = ["pytest", "pytest-repeat"]
before-test = ["python {project}/build_backend.py pull-deps {project}"]
test-command = "python {project}/build_backend.py run-tests {project}"
build-verbosity = 0
# We need to build for all platforms:
# - on Linux: x86_64, aarch64, i686, ppc64le, s390x
# - on MacOS: x86_64, arm64, universal2
# - on Windows: AMD64, x86, ARM64
# https://cibuildwheel.readthedocs.io/en/stable/options/#archs
#
# Important to note, not all those platforms have recent images.
# The `manylinux_2_28` seems to be missing for `i686`.
# The `i686` is 32-bit x86, and `x86_64` is 64-bit x86.
archs = ["all"]
# Add "pp*" to skip PyPy builds, but they should work fine these days :)
# https://cibuildwheel.readthedocs.io/en/stable/options/#build-skip
# https://cibuildwheel.readthedocs.io/en/stable/#what-does-it-do
skip = ["*-macos*_universal2"]
[tool.cibuildwheel.linux]
before-build = ["rm -rf {project}/build"]
repair-wheel-command = "auditwheel repair --lib-sdir . -w {dest_dir} {wheel}"
# Use more recent images for the most popular SIMD-capable CPU architectures, to have access to newer compilers.
# Otherwise, prepare yourself to all kinds of AVX-512 issues and other SIMD-related pain.
# You can keep track of the most recent images on Quay:
# - for `manylinux`: https://quay.io/search?q=manylinux
# - for `musllinux`: https://quay.io/search?q=musllinux
manylinux-x86_64-image = "manylinux_2_28"
manylinux-aarch64-image = "manylinux_2_28"
manylinux-s390x-image = "manylinux_2_28"
manylinux-ppc64le-image = "manylinux_2_28"
musllinux-x86_64-image = "musllinux_1_2"
musllinux-aarch64-image = "musllinux_1_2"
musllinux-s390x-image = "musllinux_1_2"
musllinux-ppc64le-image = "musllinux_1_2"
musllinux-i686-image = "musllinux_1_2"
# Different manylinux images use different package managers.
# Try yum (CentOS/RHEL), dnf (Fedora), or apt-get (Debian/Ubuntu).
before-all = ["""
(yum update -y && yum install -y glibc-devel wget python3-devel) || \
(dnf update -y && dnf install -y glibc-devel wget python3-devel) || \
(apt-get update && apt-get install -y libc6-dev wget python3-dev)
"""]
# With `musl` builds, we obviously don't need the `glibc` and can't use `yum`.
# This may also be handy for using custom dependencies for different Python versions:
# https://cibuildwheel.readthedocs.io/en/stable/options/#overrides
[[tool.cibuildwheel.overrides]]
select = "*-musllinux*"
before-all = "apk add --update wget python3-dev"
[tool.cibuildwheel.macos]
before-build = ["rm -rf {project}/build"]
repair-wheel-command = "delocate-wheel --require-archs {delocate_archs} -w {dest_dir} -v {wheel}"
archs = ["x86_64", "arm64"]
[tool.cibuildwheel.windows]
before-build = ["rd /s /q {project}\\build || echo Done"]
# Detect x86 64-bit builds
[[tool.cibuildwheel.overrides]]
select = "*-win_amd64"
inherit.environment = "append"
environment.SZ_IS_64BIT_X86_ = "1"
environment.SZ_IS_64BIT_ARM_ = "0"
[[tool.cibuildwheel.overrides]]
select = "*-manylinux*_x86_64"
inherit.environment = "append"
environment.SZ_IS_64BIT_X86_ = "1"
environment.SZ_IS_64BIT_ARM_ = "0"
[[tool.cibuildwheel.overrides]]
select = "*-musllinux*_x86_64"
inherit.environment = "append"
environment.SZ_IS_64BIT_X86_ = "1"
environment.SZ_IS_64BIT_ARM_ = "0"
[[tool.cibuildwheel.overrides]]
select = "*-macos*_x86_64"
inherit.environment = "append"
environment.SZ_IS_64BIT_X86_ = "1"
environment.SZ_IS_64BIT_ARM_ = "0"
# Detect ARM 64-bit builds
[[tool.cibuildwheel.overrides]]
select = "*-win_arm64"
inherit.environment = "append"
environment.SZ_IS_64BIT_X86_ = "0"
environment.SZ_IS_64BIT_ARM_ = "1"
[[tool.cibuildwheel.overrides]]
select = "*-manylinux*_aarch64"
inherit.environment = "append"
environment.SZ_IS_64BIT_X86_ = "0"
environment.SZ_IS_64BIT_ARM_ = "1"
[[tool.cibuildwheel.overrides]]
select = "*-musllinux*_aarch64"
inherit.environment = "append"
environment.SZ_IS_64BIT_X86_ = "0"
environment.SZ_IS_64BIT_ARM_ = "1"
[[tool.cibuildwheel.overrides]]
select = "*-macos*_arm64"
inherit.environment = "append"
environment.SZ_IS_64BIT_X86_ = "0"
environment.SZ_IS_64BIT_ARM_ = "1"
# Detect MacOS Universal2 builds
## Per-arch macOS deployment target
[[tool.cibuildwheel.overrides]]
select = "*-macos*_x86_64"
inherit.environment = "append"
environment.MACOSX_DEPLOYMENT_TARGET = "10.13"
environment.SZ_IS_64BIT_X86_ = "1"
environment.SZ_IS_64BIT_ARM_ = "0"
[[tool.cibuildwheel.overrides]]
select = "*-macos*_arm64"
inherit.environment = "append"
environment.MACOSX_DEPLOYMENT_TARGET = "11.0"
environment.SZ_IS_64BIT_X86_ = "0"
environment.SZ_IS_64BIT_ARM_ = "1"
[tool.ruff]
target-version = "py38"
line-length = 120
extend-select = [
"E", # pycodestyle errors
"F", # pyflakes
]