Skip to content

Commit

Permalink
add --version option to pybind11-config (#4526)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
eli-schwartz authored Feb 23, 2023
1 parent 438034c commit 3cc7e42
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions pybind11/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import sys
import sysconfig

from ._version import __version__
from .commands import get_cmake_dir, get_include, get_pkgconfig_dir


Expand All @@ -25,6 +26,12 @@ def print_includes() -> None:

def main() -> None:
parser = argparse.ArgumentParser()
parser.add_argument(
"--version",
action="version",
version=__version__,
help="Print the version and exit.",
)
parser.add_argument(
"--includes",
action="store_true",
Expand Down

0 comments on commit 3cc7e42

Please sign in to comment.