-
-
Notifications
You must be signed in to change notification settings - Fork 16.2k
[CI/Build]: make it possible to build with a free-threaded interpreter #29241
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -10,6 +10,7 @@ | |
| import shutil | ||
| import subprocess | ||
| import sys | ||
| import sysconfig | ||
| from pathlib import Path | ||
| from shutil import which | ||
|
|
||
|
|
@@ -74,9 +75,13 @@ def is_ninja_available() -> bool: | |
| return which("ninja") is not None | ||
|
|
||
|
|
||
| def is_freethreaded(): | ||
| return bool(sysconfig.get_config_var("Py_GIL_DISABLED")) | ||
|
|
||
|
|
||
| class CMakeExtension(Extension): | ||
| def __init__(self, name: str, cmake_lists_dir: str = ".", **kwa) -> None: | ||
| super().__init__(name, sources=[], py_limited_api=True, **kwa) | ||
| super().__init__(name, sources=[], py_limited_api=not is_freethreaded(), **kwa) | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. dumb question: is
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks for the review @ApostaC. Yes, it should be set to False, otherwise |
||
| self.cmake_lists_dir = os.path.abspath(cmake_lists_dir) | ||
|
|
||
|
|
||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.