forked from unum-cloud/usearch
-
Notifications
You must be signed in to change notification settings - Fork 0
/
pyproject.toml
85 lines (74 loc) · 3.75 KB
/
pyproject.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
# This file configures wheels compilation for `cibuilwheel` for StringZilla CPython bindings.
# On a good day it will produce:
# - `macos` wheels for x86_64, arm64, and universal2;
# - `windows` wheels for AMD64, and ARM64. But not x86.
# - `manylinux` and `musllinux` wheels for Linux on x86_64, aarch64. But not i686, ppc64le, s390x;
# * for CPython versions from 3.7 to 3.12.
# * for PyPy versions from 3.7 to 3.10.
# = meaning 7 platforms * 10 Python versions = 70 builds.
[build-system]
requires = ["setuptools>=42", "wheel", "cmake>=3.22", "pybind11", "numpy"]
build-backend = "setuptools.build_meta"
[tool.pytest.ini_options]
minversion = "6.0"
addopts = "-ra --showlocals --strict-markers --strict-config -s -x -p no:warnings"
xfail_strict = true
filterwarnings = ["error"]
# Avoid running tests, as everything is happening in a super slow container
# We have already run all the relavent Python tests in `prerelease.yml`
# test-requires = ["pytest", "numpy"]
# test-command = "pytest {project}/python/scripts"
[tool.cibuildwheel]
test-requires = []
test-command = ""
build-verbosity = 0
# 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 = []
[tool.cibuildwheel.linux]
archs = ["x86_64", "aarch64"]
before-build = [
"rm -rf {project}/CMakeCache.txt {project}/build {project}/build_debug {project}/CMakeFiles.txt {project}/_deps {project}/.pytest_cache",
"mkdir -p build/usearch",
"git submodule update --init --recursive",
]
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"
musllinux-x86_64-image = "musllinux_1_2"
musllinux-aarch64-image = "musllinux_1_2"
# On CentOS we have to use `yum`.
# The healthy version would be: `apt-get update && apt-get install -y libc6-dev wget python3-dev`.
before-all = ["yum update -y && yum install -y glibc-devel wget python3-devel"]
# 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]
archs = ["x86_64", "universal2", "arm64"]
before-build = [
"rm -rf {project}/CMakeCache.txt {project}/build {project}/build_debug {project}/CMakeFiles.txt {project}/_deps {project}/.pytest_cache",
"mkdir -p build/usearch",
"git submodule update --init --recursive",
]
repair-wheel-command = "delocate-wheel --require-archs {delocate_archs} -w {dest_dir} -v {wheel}"
[tool.cibuildwheel.windows]
archs = ["AMD64", "ARM64"]
before-build = [
"rd /s /q {project}\\CMakeCache.txt {project}\\build {project}\\build_debug {project}\\CMakeFiles.txt {project}\\_deps {project}\\.pytest_cache || echo Done",
"md build\\usearch",
"git submodule update --init --recursive",
]
# Configuration options for the Black formatter:
# https://black.readthedocs.io/en/latest/usage_and_configuration/the_basics.html#where-black-looks-for-the-file
[tool.black]
line-length = 120 # Set line length to the same value as in `.clang-format` for modern wide screens
target-version = ['py36', 'py312']