-
Notifications
You must be signed in to change notification settings - Fork 13
Expand file tree
/
Copy pathpyproject.toml
More file actions
210 lines (181 loc) · 7.11 KB
/
Copy pathpyproject.toml
File metadata and controls
210 lines (181 loc) · 7.11 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
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
[build-system]
requires = ["scikit-build-core >=0.10", "nanobind >=2.12"]
build-backend = "scikit_build_core.build"
[project]
name = "compas_cgal"
description = "CGAL wrapper for COMPAS."
readme = "README.md"
requires-python = ">=3.9"
authors = [
{ name = "tom van mele", email = "tom.v.mele@gmail.com" },
{ name = "Petras Vestartas", email = "petrasvestartas@gmail.com" },
]
classifiers = [
"License :: OSI Approved :: GNU Lesser General Public License v3 (LGPLv3)",
]
dependencies = [
"numpy>=1.24",
"compas>=2.15,<3",
]
dynamic = ["version"]
[project.urls]
Homepage = "https://github.com/compas-dev/compas_cgal"
# ============================================================================
# replace pytest.ini
# ============================================================================
[tool.pytest.ini_options]
minversion = "6.0"
testpaths = ["tests"]
python_files = ["test_*.py", "*_test.py", "test.py"]
norecursedirs = [
"external/*",
"build/*",
"dist/*",
"*.egg-info",
".git",
".tox",
".env",
".pytest_cache",
".ruff_cache",
]
addopts = [
"-ra",
"--strict-markers",
"--doctest-glob=*.rst",
"--tb=short",
"--import-mode=importlib",
]
doctest_optionflags = [
"NORMALIZE_WHITESPACE",
"IGNORE_EXCEPTION_DETAIL",
"ALLOW_UNICODE",
"ALLOW_BYTES",
"NUMBER",
]
# ============================================================================
# scikit-build
# ============================================================================
[tool.scikit-build]
minimum-version = "build-system.requires"
build-dir = "build/{wheel_tag}"
wheel.py-api = "cp312" # Build all Python currently supported versions.
cmake.version = ">=3.15"
cmake.build-type = "Release"
[tool.scikit-build.metadata.version]
provider = "scikit_build_core.metadata.regex"
input = "src/compas_cgal/__init__.py"
[tool.scikit-build.cmake.define]
CMAKE_POLICY_DEFAULT_CMP0135 = "NEW"
# pixi injects a `pixi-conda-environment` fingerprint into --config-settings on every PyPI
# source build, and scikit-build-core aborts on unrecognized keys (exit 7). Scoped to pixi
# via an override rather than set globally: `strict-config = false` is NOT limited to
# --config-settings — it also stops validation of this project's own [tool.scikit-build]
# table and allows extra keys in [project] metadata, so globally a typo in `wheel.py-api`
# or `cmake.build-type` would yield a silently wrong wheel for pip and cibuildwheel too.
# Gated here, those frontends keep strict validation and only pixi's build relaxes it.
# The value is a regex matched against the variable; `.+` matches presence, which is what is
# meant. Overrides apply before validation exits.
[[tool.scikit-build.overrides]]
if.env.PIXI_PROJECT_NAME = ".+"
strict-config = false
# ============================================================================
# cibuildwheel
# ============================================================================
[tool.cibuildwheel]
# build = ["cp38-*", "cp39-*", "cp31?-*"] # Build for specific Python versions.
build-verbosity = 3
test-requires = ["numpy>=1.24", "compas>=2.15", "pytest", "build"]
test-command = "pip list && pytest {project}/tests"
build-frontend = "pip"
manylinux-x86_64-image = "manylinux_2_28"
skip = ["*_i686", "*-musllinux_*", "*-win32", "pp*"]
macos.environment.MACOSX_DEPLOYMENT_TARGET = "11.00"
macos.archs = ["x86_64", "arm64"]
# ============================================================================
# replace bumpversion.cfg
# ============================================================================
[tool.bumpversion]
current_version = "0.9.5"
message = "Bump version to {new_version}"
commit = true
tag = true
[[tool.bumpversion.files]]
filename = "src/compas_cgal/__init__.py"
search = "{current_version}"
replace = "{new_version}"
[[tool.bumpversion.files]]
filename = "CHANGELOG.md"
search = "Unreleased"
replace = "[{new_version}] {now:%Y-%m-%d}"
# ============================================================================
# replace setup.cfg
# ============================================================================
[tool.ruff]
line-length = 179
indent-width = 4
target-version = "py39"
[tool.ruff.lint]
select = ["E", "F", "I"]
[tool.ruff.lint.per-file-ignores]
"__init__.py" = ["I001"]
"tests/*" = ["I001"]
"tasks.py" = ["I001"]
[tool.ruff.lint.isort]
force-single-line = true
[tool.ruff.lint.pydocstyle]
convention = "numpy"
[tool.ruff.lint.pycodestyle]
max-doc-length = 179
[tool.ruff.format]
docstring-code-format = true
docstring-code-line-length = "dynamic"
# ============================================================================
# pixi — an additive alternative to environment.yml + tasks.py.
# conda and pip workflows are unaffected; nothing above this line changes.
# ============================================================================
[tool.pixi.workspace]
channels = ["conda-forge"]
# Only the platforms this manifest has actually been solved and built on.
platforms = ["osx-arm64", "linux-64"]
# The build backend MUST be a conda dependency, not a PyPI one. compas_cgal has a
# dynamic version, so uv runs prepare_metadata_for_build_wheel at SOLVE time; with
# no-build-isolation there is no ephemeral build env, and the PyPI set is not
# installed yet at that point. pixi installs conda packages first, so only this
# table is populated in time. Moving these two to pypi-dependencies reintroduces
# `No module named 'scikit_build_core'`.
[tool.pixi.dependencies]
python = "3.12.*"
cmake = ">=3.15"
ninja = "*"
nanobind = ">=1.3.2"
scikit-build-core = ">=0.10"
compas = "*"
numpy = "*"
scipy = "*"
[tool.pixi.pypi-dependencies]
compas-cgal = { path = ".", editable = true }
pytest = ">=7"
pytest-cov = ">=4"
ruff = "*"
[tool.pixi.pypi-options]
no-build-isolation = ["compas-cgal"]
# Wheel-tag ceiling, not a preference. conda-forge's CPython reports
# sysconfig.get_platform() == macosx-11.0-arm64, so uv accepts wheels tagged at most
# macosx_11_0_arm64. CMakeLists sets no CMAKE_OSX_DEPLOYMENT_TARGET, so an unpinned
# build inherits the host macOS and produces a tag the interpreter then rejects.
# 11.0 matches what [tool.cibuildwheel] already targets.
[tool.pixi.target.osx-arm64.activation.env]
MACOSX_DEPLOYMENT_TARGET = "11.0"
[tool.pixi.tasks]
# The import alone does NOT rebuild, despite the obvious reading: scikit-build-core's
# editable finder only rebuilds on import when installed with `editable.rebuild` on,
# which this project does not set. `__loader__.rebuild()` is its supported manual
# entry point and runs one CMake pass covering every extension, so naming any built
# module suffices — these are named so a module rename fails loudly here instead of
# silently skipping the rebuild.
_editable-rebuild = '''python -c "from compas_cgal import _geodesics, _isolines; _isolines.__loader__.rebuild()"'''
# SKBUILD_EDITABLE_SKIP stops each pytest process (xdist workers included) from
# starting a competing CMake run. The rebuild above already happened, once.
test = { cmd = "pytest", env = { SKBUILD_EDITABLE_SKIP = "1" }, depends-on = ["_editable-rebuild"] }
lint = "ruff check src/compas_cgal tests"
format-check = "ruff format --check src/compas_cgal tests"