Commit 3cc7e425 by Eli Schwartz Committed by GitHub

add --version option to pybind11-config (#4526)

Without this, it's impossible to get feature parity between detection
mechanisms. Both the pkg-config file and the cmake config set their
versions, but the python probe script didn't provide an option for this.

So you could print the compiler flags for using it, but you could not
check what you got.
parent 438034c5
...@@ -4,6 +4,7 @@ import argparse ...@@ -4,6 +4,7 @@ import argparse
import sys import sys
import sysconfig import sysconfig
from ._version import __version__
from .commands import get_cmake_dir, get_include, get_pkgconfig_dir from .commands import get_cmake_dir, get_include, get_pkgconfig_dir
...@@ -26,6 +27,12 @@ def print_includes() -> None: ...@@ -26,6 +27,12 @@ def print_includes() -> None:
def main() -> None: def main() -> None:
parser = argparse.ArgumentParser() parser = argparse.ArgumentParser()
parser.add_argument( parser.add_argument(
"--version",
action="version",
version=__version__,
help="Print the version and exit.",
)
parser.add_argument(
"--includes", "--includes",
action="store_true", action="store_true",
help="Include flags for both pybind11 and Python headers.", help="Include flags for both pybind11 and Python headers.",
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment