-
-
Notifications
You must be signed in to change notification settings - Fork 11
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
Add support for free-threaded builds #70
base: main
Are you sure you want to change the base?
Conversation
358801e
to
8285b78
Compare
@tacaswell so I tried to apply @minrk's changes and it's all red: https://github.com/hynek/argon2-cffi-bindings/actions/runs/11229954729
cc @henryiii |
Can check tomorrow (ping me if I forget), but see python-cffi/cffi#104 in the meantime. |
Thanks!
That's rather discouraging and implies the |
python-cffi/cffi#125 will be in the next version. Maybe try cffi from git? |
At the danger of embarrassing myself, I have no idea how to do that: pin a git rev in build-requires? And even worse, I haven't found an easy way to get a free-threaded Python on my Mac? For now, I'm extremely excited for astral-sh/python-build-standalone#336 to ship. |
For reference: uv's issue tracking free-threaded installs: astral-sh/uv#8019 |
Yeah, you can do that. Perhaps not appropriate for publication, but you can use a git archive URL as a dependency: [build-system]
requires = [
"setuptools>=45",
"setuptools_scm[toml]>=6.2",
"wheel",
"cffi>=1.0.1",
# or a specific commit instead of HEAD
"https://github.com/python-cffi/cffi/archive/HEAD.tar.gz; python_version >= '3.13'",
] as done here. |
Due to changes in setuptools (pypa/setuptools#4647) if you extend bdist_wheel from the wheel package the install will fail. I'm not 100% sure what the support windows of diff --git a/setup.py b/setup.py
index 7510937..3a402e3 100644
--- a/setup.py
+++ b/setup.py
@@ -11,9 +11,12 @@ cmdclass = {}
if platform.python_implementation() == "CPython":
try:
- import wheel.bdist_wheel
+ try:
+ from setuptools.command.bdist_wheel import bdist_wheel
+ except ImportError:
+ from wheel.bdist_wheel import bdist_wheel
- class BDistWheel(wheel.bdist_wheel.bdist_wheel):
+ class BDistWheel(bdist_wheel):
def finalize_options(self):
# Free-threaded CPython doesn't support limited API.
if sysconfig.get_config_var("Py_GIL_DISABLED"):
@@ -21,7 +24,7 @@ if platform.python_implementation() == "CPython":
else:
self.py_limited_api = f"cp3{sys.version_info[1]}"
- wheel.bdist_wheel.bdist_wheel.finalize_options(self)
+ super().finalize_options()
cmdclass["bdist_wheel"] = BDistWheel
except ImportError:
|
ffe98ff
to
f859acd
Compare
The floor on setuptools is 70.1, although I think upstream added a workaround so you can probably ignore my last comment. |
I'd still recommend using the correct one, the workaround is just to keep from blowing up for now, but uv supports free-threaded now. |
Co-authored-by: Min RK <[email protected]>
fixes #67