forked from valhalla/valhalla
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpyproject.toml
More file actions
110 lines (98 loc) · 3.81 KB
/
pyproject.toml
File metadata and controls
110 lines (98 loc) · 3.81 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
[project]
name = "pyvalhalla"
dynamic = ["version"]
requires-python = ">=3.9.0"
authors = [{ name = "Nils Nolde" }, {name = "Kevin Kreiser"}]
description = "High-level bindings to the Valhalla C++ library"
readme = "src/bindings/python/README.md"
license = "MIT"
license-files = ["COPYING"]
[project.optional-dependencies]
typing = ["numpy>=2.0.0,<3.0.0"] # only needed for .pyi typing
[project.urls]
Homepage = "https://github.com/valhalla/valhalla"
Documentation = "https://valhalla.github.io/valhalla/"
Repository = "https://github.com/valhalla/valhalla"
Issues = "https://github.com/valhalla/valhalla/issues"
Changelog = "https://github.com/valhalla/valhalla/blob/master/CHANGELOG.md"
[project.scripts]
valhalla_service = "valhalla._scripts:run"
valhalla_build_tiles = "valhalla._scripts:run"
valhalla_build_admins = "valhalla._scripts:run"
valhalla_add_predicted_traffic = "valhalla._scripts:run"
valhalla_add_landmarks = "valhalla._scripts:run"
valhalla_ingest_transit = "valhalla._scripts:run"
valhalla_convert_transit = "valhalla._scripts:run"
[build-system]
requires = [
"scikit-build-core>=0.11.0",
"wheel",
"setuptools_scm>=6.2",
"setuptools_scm_git_archive",
# instead of relying on system tools
"cmake",
"ninja",
"nanobind>=2.9.0",
"auditwheel"
]
build-backend = "scikit_build_core.build"
[tool.scikit-build]
# nanobind’s STABLE_ABI feature targets Python >= 3.12
wheel.py-api = "cp312"
# Ask setuptools-scm for the version at build time
metadata.version.provider = "scikit_build_core.metadata.setuptools_scm"
# creates a valhalla directory in the wheel
wheel.install-dir = "valhalla"
# only installs the python cmake COMPONENT
install.components = ["python"]
sdist.include = ["pyproject.toml"]
sdist.exclude = ["test", "test_requests"]
# a few standard build flags for a scikit-build-core build
[tool.scikit-build.cmake.define]
ENABLE_PYTHON_BINDINGS = "ON"
ENABLE_TESTS = "OFF"
ENABLE_SINGLE_FILES_WERROR = "OFF"
CMAKE_BUILD_TYPE = "Release"
[tool.setuptools_scm]
version_file = "src/bindings/python/valhalla/__version__.py"
version_scheme = "no-guess-dev"
# PyPI doesn't accept local hashed version strings
local_scheme = "no-local-version"
[tool.ruff]
line-length = 105
extend-exclude = [
"dist",
"wheelhouse",
"*build*",
"*.egg-info",
]
lint.ignore = ["E731", "F811"]
[tool.cibuildwheel]
# it's enough here to know it's importable, actual test is run on other CI
# mostly to avoid building utrecht tiles within the bindings build
test-command = "python -c \"from valhalla.utils.graph_utils import GraphId; g = GraphId(); assert g.is_valid() == False\""
# find out current defaults: cibuildwheel --print-build-identifiers --platform linux
build = "cp*"
skip = "*musllinux*"
archs = "native"
manylinux-x86_64-image = "ghcr.io/valhalla/manylinux:2_28_valhalla_python"
manylinux-aarch64-image = "ghcr.io/valhalla/manylinux:2_28_valhalla_python"
[tool.cibuildwheel.windows]
# this is v1.11.2
before-all = "pip install \"delvewheel<=2.0.0\""
repair-wheel-command = "delvewheel repair --analyze-existing-exes --add-path build/vcpkg_installed/x64-windows/bin {wheel} -w {dest_dir}"
[tool.cibuildwheel.linux]
# 1. patch auditwheel so that it allows to vendor libraries also linked to libpython
# 2. configure and write the pyproject.toml
before-build = """
python -m pip install -r src/bindings/python/requirements-build.txt
python src/bindings/python/scripts/auditwheel_patch.py libexpat.so.1 libz.so.1
"""
# e.g. geos is both installed to the system and built from source, need to prioritize the latter
environment = { LD_LIBRARY_PATH="/usr/local/lib:/usr/local/lib64" }
[tool.cibuildwheel.macos]
repair-wheel-command = [
'git status',
'DYLD_LIBRARY_PATH=$LIBRARY_PATH delocate-listdeps {wheel}',
'DYLD_LIBRARY_PATH=$LIBRARY_PATH delocate-wheel --require-archs {delocate_archs} -w {dest_dir} {wheel}'
]