-
Notifications
You must be signed in to change notification settings - Fork 784
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
Warn about unknown config keys in PYO3_CONFIG_FILE
#2926
Conversation
556cb2c
to
c94bcf3
Compare
c94bcf3
to
f8e2a26
Compare
bors r=adamreichold |
2926: Warn about unknown config keys in `PYO3_CONFIG_FILE` r=adamreichold a=messense `maturin` also read from `PYO3_CONFIG_FILE` to get `ext_suffix` config, `pyo3-build-config` currently denies unknown config keys makes it inconvenient. See PyO3/maturin#1430 Co-authored-by: messense <messense@icloud.com>
I am sorry, I should have spelled that out: I approved only via the GitHub UI and not via bors to give other interested parties time to have a look and comment before this lands. I often want to attach something to indicate that I reviewed a PR, even though I am not yet confident enough to start merging. |
No problem! bors r- |
Canceled. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks fine to me too!
@messense - just as a double-check before merging, can you confirm that the warning can be seen by the user? I got the impression that cargo hides the warnings except when build fails. Maybe try building one of the examples on this branch with a config file with a typo in it and see what happens?
If the user never sees this warning, it might be more robust to instead keep error-by-default and add an env var to allow unknown keys e.g. PYO3_CONFIG_ALLOW_UNKOWN_KEYS=ext_suffix
Yes. 🍹 Building a mixed python/rust project
🔗 Found pyo3 bindings
🐍 Found CPython 3.12
💻 Using `MACOSX_DEPLOYMENT_TARGET=11.0` for aarch64-apple-darwin by default
Compiling pyo3-build-config v0.18.0 (/Users/messense/Projects/pyo3/pyo3-build-config)
warning: unknown config key `ext_suffix`
Compiling pyo3-ffi v0.18.0 (/Users/messense/Projects/pyo3/pyo3-ffi)
Compiling pyo3 v0.18.0 (/Users/messense/Projects/pyo3)
Compiling word-count v0.1.0 (/Users/messense/Projects/pyo3/examples/word-count)
Finished dev [unoptimized + debuginfo] target(s) in 1.37s
📦 Built wheel for CPython 3.12 to dist/word_count-0.1.0-cp312-cp312-macosx_11_0_arm64.whl |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
bors r+
Great! If you ever want to adjust the UX for maturin here so that the warning doesn't show for |
Build succeeded:
|
maturin
also read fromPYO3_CONFIG_FILE
to getext_suffix
config,pyo3-build-config
currently denies unknown config keys makes it inconvenient.See PyO3/maturin#1430