Uh oh!
There was an error while loading. Please reload this page.
add --version option to pybind11-config - #4526
Conversation
aed312d to
030aefbCompare
henryiii
left a comment
There was a problem hiding this comment.
Didn't realize we didn't already have this!
What about about a -v shortcut? Not as important as -h, as it sometimes is a verbosity flag. Maybe not a good idea for a new flag, just a thought.
9f9ee15 to
5440951Compareeli-schwartz
commented
Feb 23, 2023
BTW, I need this because I'm adding a meson
Yeah, neither did I. :/
I don't think this is necessary, no one currently depends on it and the main use case is for compatibility with classic Unix foobar-config shell scripts, which tend to have --version and not -v. They also tend to use --cflags instead of --includes, but that is not so important, some of them also use |
| def main() -> None: | ||
| parser = argparse.ArgumentParser() | ||
| parser.add_argument("--version", action="version", version=__version__) |
There was a problem hiding this comment.
Could you please add help="Prints version and exits."
(This is almost straight from the argparse docs for actionversion, but I didn't know, and had to look it up.)
There was a problem hiding this comment.
For context, I lazily didn't bother because the argparse default is to autogenerate help text for you: "show program's version number and exit"
However I'm more than happy to make this explicit. I've tweaked your suggested wording to better fit in with the style of __main__.py which consistently uses imperative mood, so "Prints" -> "Print".
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.
5440951 to
27651c9Comparehenryiii
commented
Feb 23, 2023
I'm fine with sticking with |
rwgk
commented
Feb 23, 2023
@henryiii I added a Suggested changelog entry to the PR description, based on my rather superficial understanding, hoping it's a better start than nothing. |
eli-schwartz
commented
Feb 23, 2023
Thanks. For documentation purposes, when I refer to this fix -- should I write that the fix will be in pybind11 2.10.4 or 2.11.0? I'm assuming probably the former? |
Related: do you have an example of the best way to use pybind11 & meson together (probably in the context of meson-python)? A quick search got me to mesonbuild/meson#4677 (comment). I'm guessing this will be nicer with the 2.10.4 depends on if we have enough to make it worth backporting before 2.11. Don't think we are moving very quickly towards 2.11, though, so I'd say it's possible there will be a 2.10.4. I'll let know know if I know more. (If there is a 2.10.4, this should be in it) |
Yes, that has to be added to meson because The idea is that people should be able to just do this: dependency('pybind11')and that will most likely find the pybind11-config installed to $PATH (including to the $PATH of a pip build isolation environment). Although if the global version is installed, it may find the pkg-config or cmake file instead. |
henryiii
commented
Feb 24, 2023
Does the meson.build file in https://github.com/scikit-hep/cookie/pull/124/files look fine? I'm assuming the stuff in the middle of it can become |
eli-schwartz
commented
Feb 24, 2023
I left a comment there. |
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.
henryiii
commented
Mar 9, 2023
There will be a 2.10.4, it's nearly ready except for #4301. |
henryiii
commented
Mar 16, 2023
Released 2.10.4. |
Description
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.
Suggested changelog entry: