Repository navigation
Expand file tree
/
Copy pathpyproject.toml
More file actions
69 lines (58 loc) · 3.19 KB
/
Copy pathpyproject.toml
File metadata and controls
69 lines (58 loc) · 3.19 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
[build-system]
requires = ["meson-python>=0.16.0"]
build-backend = "mesonpy"
[project]
name = "ycpp"
description = "Python bindings for ycpp, a C++ implementation of Yjs, mirroring pycrdt"
requires-python = ">=3.12"
dynamic = ["version"]
# anyio: the async API (Doc.events, Provider, Awareness), as pycrdt.
dependencies = ["anyio"]
[project.optional-dependencies]
test = ["pytest", "hypothesis", "pycrdt", "pydantic", "trio"]
parity = ["pycrdt"]
[tool.meson-python]
# abi3: one wheel per platform for CPython 3.12 and later (free-threaded builds stay per version).
limited-api = true
[tool.meson-python.args]
setup = ["-Dpython=enabled", "-Dsimd=sse4.2"]
[tool.pytest.ini_options]
# python/tests/pycrdt_suite/conftest.py aliases sys.modules["pycrdt"] to ycpp for the whole session,
# so the vendored suite runs in a pytest process of its own (see the CI "Python suite" step). In the
# same process it would also compare ycpp with itself in test_random_vs_pycrdt.py and collide with
# the basenames of python/tests/*.py.
norecursedirs = ["*.egg", ".*", "_darcs", "build", "CVS", "dist", "node_modules", "venv", "{arch}", "pycrdt_suite"]
[tool.cibuildwheel]
# cp312 makes the abi3 wheel, which cibuildwheel reuses (and tests) for every later CPython;
# the free-threaded 3.14t/3.15t builds have no stable ABI, so they get their own wheels.
build = "cp312-* cp314t-* cp315t-*"
build-frontend = "build"
# The tests that need node (the Yjs oracle in python/tests/fuzzing) skip themselves when node is not
# on PATH, so the wheel tests need only pytest and hypothesis; pycrdt tests skip without it.
test-command = "python -m pytest {project}/python/tests -q"
test-requires = ["pytest", "hypothesis"]
[tool.cibuildwheel.linux]
manylinux-x86_64-image = "manylinux_2_28"
manylinux-aarch64-image = "manylinux_2_28"
# SSE4.2 (x86-64-v2) is the wheel baseline from docs/superpowers/specs/2026-11-26-ycpp-design.md: pip
# cannot pick a wheel by CPU level, so nothing above SSE4.2 may be required. The aarch64 job overrides
# CXXFLAGS from the workflow, because -msse4.2 does not exist there.
environment = { CXXFLAGS = "-O2 -msse4.2" }
[tool.cibuildwheel.macos]
archs = ["x86_64", "arm64"]
# Same baseline for the Intel wheels. The arm64 job clears the flags in the workflow.
# macOS 11.0: nanobind's aligned new/delete need 10.13+, and arm64 wheels start at 11.0 anyway.
environment = { CXXFLAGS = "-O2 -msse4.2", MACOSX_DEPLOYMENT_TARGET = "11.0" }
[tool.cibuildwheel.windows]
# The runner has MinGW's g++ on PATH, which Meson would pick; --vsenv forces MSVC. Here rather than in
# the workflow's environment, so the free-threaded override below can append to it.
config-settings = { "setup-args" = ["--vsenv"] }
# Free-threaded CPython has no stable ABI, and meson-python refuses `limited-api = true` there before
# 3.15 without this switch (meson.build already builds those without the limited API). The whole
# list each time: an override replaces config-settings' setup-args, so Windows repeats --vsenv.
[[tool.cibuildwheel.overrides]]
select = "*t-*"
config-settings = { "setup-args" = ["-Dpython.allow_limited_api=false"] }
[[tool.cibuildwheel.overrides]]
select = "*t-win*"
config-settings = { "setup-args" = ["--vsenv", "-Dpython.allow_limited_api=false"] }