Skip to content

Commit 8b7db67

Browse files
committed
Add pkgconf-pypi entrypoint
- This allows `pkgconf --cflags pybind11` and similar commands to work as expected if pkgconf is installed from pypi
1 parent 2943a27 commit 8b7db67

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

setup.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,10 @@ def remove_output(*sources: str) -> Generator[None, None, None]:
144144
stderr=sys.stderr,
145145
)
146146

147+
# pkgconf-pypi needs pybind11/share/pkgconfig to be importable
148+
Path("pybind11/share/__init__.py").touch()
149+
Path("pybind11/share/pkgconfig/__init__.py").touch()
150+
147151
txt = get_and_replace(setup_py, version=version, extra_cmd=extra_cmd)
148152
code = compile(txt, setup_py, "exec")
149153
exec(code, {"SDist": SDist})

tools/setup_main.py.in

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ setup(
1818
"pybind11.include.pybind11.detail",
1919
"pybind11.include.pybind11.eigen",
2020
"pybind11.include.pybind11.stl",
21+
"pybind11.share",
2122
"pybind11.share.cmake.pybind11",
2223
"pybind11.share.pkgconfig",
2324
],
@@ -40,7 +41,10 @@ setup(
4041
],
4142
"pipx.run": [
4243
"pybind11 = pybind11.__main__:main",
43-
]
44+
],
45+
"pkg_config": [
46+
"pybind11 = pybind11.share.pkgconfig",
47+
],
4448
},
4549
cmdclass=cmdclass
4650
)

0 commit comments

Comments
 (0)