11[build-system ]
2- requires = [" setuptools>=42 " , " cmake>=3.18 " , " ninja " ]
3- build-backend = " setuptools.build_meta "
2+ requires = [" scikit-build-core >=0.11.2 " ]
3+ build-backend = " scikit_build_core.build "
44
5+ [project ]
6+ name = " pybind11"
7+ description = " Seamless operability between C++11 and Python"
8+ authors = [{
name =
" Wenzel Jakob" ,
email =
" [email protected] " }]
9+ license = " BSD-3-Clause"
10+ license-files = [" LICENSE" ]
11+ readme = " README.rst"
12+ classifiers = [
13+ " Development Status :: 5 - Production/Stable" ,
14+ " Intended Audience :: Developers" ,
15+ " Topic :: Software Development :: Libraries :: Python Modules" ,
16+ " Topic :: Utilities" ,
17+ " Programming Language :: C++" ,
18+ " Programming Language :: Python :: 3 :: Only" ,
19+ " Programming Language :: Python :: 3.8" ,
20+ " Programming Language :: Python :: 3.9" ,
21+ " Programming Language :: Python :: 3.10" ,
22+ " Programming Language :: Python :: 3.11" ,
23+ " Programming Language :: Python :: 3.12" ,
24+ " Programming Language :: Python :: 3.13" ,
25+ " Programming Language :: Python :: Implementation :: PyPy" ,
26+ " Programming Language :: Python :: Implementation :: CPython" ,
27+ " Programming Language :: C++" ,
28+ " Topic :: Software Development :: Libraries :: Python Modules" ,
29+ ]
30+ keywords = [
31+ " C++11" ,
32+ " Python bindings" ,
33+ ]
34+ dynamic = [" version" , " optional-dependencies" ]
35+ requires-python = " >=3.8"
536
6- [tool .check-manifest ]
7- ignore = [
8- " tests/**" ,
9- " docs/**" ,
10- " tools/**" ,
11- " include/**" ,
12- " .*" ,
13- " pybind11/include/**" ,
14- " pybind11/share/**" ,
15- " CMakeLists.txt" ,
16- " CMakePresets.json" ,
17- " noxfile.py" ,
37+ [project .urls ]
38+ Homepage = " https://github.com/pybind/pybind11"
39+ Documentation = " https://pybind11.readthedocs.io/"
40+ "Bug Tracker" = " https://github.com/pybind/pybind11/issues"
41+ Discussions = " https://github.com/pybind/pybind11/discussions"
42+ Changelog = " https://pybind11.readthedocs.io/en/latest/changelog.html"
43+ Chat = " https://gitter.im/pybind/Lobby"
44+
45+ [project .scripts ]
46+ pybind11-config = " pybind11.__main__:main"
47+
48+ [project .entry-points ."pipx .run" ]
49+ pybind11 = " pybind11.__main__:main"
50+
51+ [project .entry-points .pkg_config ]
52+ pybind11 = " pybind11.share.pkgconfig"
53+
54+
55+ [dependency-groups ]
56+ test = [
57+ " pytest" ,
58+ " build" ,
59+ " tomlkit" ,
1860]
61+ dev = [{ include-group = " test" }]
62+
63+
64+ [tool .scikit-build ]
65+ minimum-version = " build-system.requires"
66+ sdist.exclude = [
67+ " /docs/**" ,
68+ " /.**" ,
69+ ]
70+ wheel.install-dir = " pybind11"
71+ wheel.platlib = false
72+
73+ [tool .scikit-build .cmake .define ]
74+ BUILD_TESTING = false
75+ PYBIND11_NOPYTHON = true
76+ prefix_for_pc_file = " ${pcfiledir}/../../"
77+
78+ [tool .scikit-build .metadata .version ]
79+ provider = " scikit_build_core.metadata.regex"
80+ input = " include/pybind11/detail/common.h"
81+ regex = ''' (?sx)
82+ \#define \s+ PYBIND11_VERSION_MAJOR \s+ (?P<major>\d+) .*?
83+ \#define \s+ PYBIND11_VERSION_MINOR \s+ (?P<minor>\d+) .*?
84+ \#define \s+ PYBIND11_VERSION_PATCH \s+ (?P<patch>\S+)
85+ '''
86+ result = " {major}.{minor}.{patch}"
87+
88+ [tool .scikit-build .metadata .optional-dependencies ]
89+ provider = " scikit_build_core.metadata.template"
90+ result = { global = [" pybind11-global=={project[version]}" ]}
91+
92+ [[tool .scikit-build .generate ]]
93+ path = " pybind11/_version.py"
94+ template = '''
95+ from __future__ import annotations
96+
97+
98+ def _to_int(s: str) -> int | str:
99+ try:
100+ return int(s)
101+ except ValueError:
102+ return s
103+
104+
105+ __version__ = "$version"
106+ version_info = tuple(_to_int(s) for s in __version__.split("."))
107+ '''
108+
19109
20- # Can't use tool.uv.sources with requirements.txt
21110[tool .uv ]
111+ # Can't use tool.uv.sources with requirements.txt
22112index-strategy = " unsafe-best-match"
113+ # This extra confuses uv
114+ override-dependencies = [" pybind11-global" ]
115+
23116
24117[tool .mypy ]
25118files = [" pybind11" ]
@@ -29,7 +122,7 @@ enable_error_code = ["ignore-without-code", "redundant-expr", "truthy-bool"]
29122warn_unreachable = true
30123
31124[[tool .mypy .overrides ]]
32- module = [" ghapi.*" ]
125+ module = [" ghapi.*" , " tomlkit " ] # tomlkit has types, but not very helpful
33126ignore_missing_imports = true
34127
35128
@@ -46,10 +139,10 @@ messages_control.disable = [
46139 " protected-access" ,
47140 " missing-module-docstring" ,
48141 " unused-argument" , # covered by Ruff ARG
142+ " consider-using-f-string" , # triggers in _version.py incorrectly
49143]
50144
51145[tool .ruff ]
52- target-version = " py38"
53146src = [" src" ]
54147
55148[tool .ruff .lint ]
0 commit comments