-
Notifications
You must be signed in to change notification settings - Fork 766
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
Free-threaded build config fixes #4719
base: main
Are you sure you want to change the base?
Conversation
pyo3-build-config/src/impl_.rs
Outdated
major: 3, | ||
minor: 13, | ||
}; | ||
#[allow(dead_code)] |
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.
this is leftover from a mistaken refactoring that removed the only internal use of this outside tests and should be deleted
pyo3-build-config/src/impl_.rs
Outdated
@@ -1642,24 +1645,33 @@ fn default_lib_name_windows( | |||
debug: bool, | |||
gil_disabled: bool, | |||
) -> String { | |||
if debug { | |||
if debug && version.minor < 10 { |
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.
maybe define a PY310 constant?
👍 thanks, do you want me to review before the above comments are resolved? |
Go ahead. Tiny bit of context: I often look at PRs on my phone since it helps me catch things if I look over code in a different context from where I wrote it. |
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.
Thanks, this seems reasonable to me 👍
pyo3-ffi/build.rs
Outdated
if version < PythonVersion::PY313 { | ||
panic!( |
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.
This should use ensure!
rather than panic!
, it leads to a friendlier presentation of the error to users.
See also PyO3/maturin#2310 (comment), can probably adjust here. |
Along with some changes to maturin on top of PyO3/maturin#2310 (which I'll create a separate PR for) this latest push lets more of the maturin tests pass on my local dev setup. |
Fixes #4709.
Trying to get a library name or build pyo3-ffi against a free-threaded ABI for Python earlier than 3.13 now panics.
Also adds tests for the panics and for the free-threaded library names as followup for #4690 where I ran out of steam to add new tests.
While working on this I noticed that there was code to work around python/cpython#101614 which was fixed in CPython for 3.10 and newer, so I modified the workaround code path to only apply for Python 3.9 and older.