Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix docs build command on different global and venv python versions #5360

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/basics.rst
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ On Linux, the above example can be compiled using the following command:

.. code-block:: bash

$ c++ -O3 -Wall -shared -std=c++11 -fPIC $(python3 -m pybind11 --includes) example.cpp -o example$(python3-config --extension-suffix)
$ c++ -O3 -Wall -shared -std=c++11 -fPIC $(python3 -m pybind11 --includes) example.cpp -o example$(python3 -m pybind11 --extension-suffix)

.. note::

Expand Down
7 changes: 7 additions & 0 deletions pybind11/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,11 @@ def main() -> None:
action="store_true",
help="Print the pkgconfig directory, ideal for setting $PKG_CONFIG_PATH.",
)
parser.add_argument(
"--extension-suffix",
action="store_true",
help="Print the extension for a Python module",
)
args = parser.parse_args()
if not sys.argv[1:]:
parser.print_help()
Expand All @@ -80,6 +85,8 @@ def main() -> None:
print(quote(get_cmake_dir()))
if args.pkgconfigdir:
print(quote(get_pkgconfig_dir()))
if args.extension_suffix:
print(sysconfig.get_config_var("EXT_SUFFIX"))


if __name__ == "__main__":
Expand Down
Loading