-
Notifications
You must be signed in to change notification settings - Fork 525
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
Make setup.py work with Cython 3 and Cython 0.29 #729
Make setup.py work with Cython 3 and Cython 0.29 #729
Conversation
By calling Cythonize directly we can make setup.py work for both versions of Cython.
This change will likely break existing workflows because it elevates Cython to a hard build dependency. In its current form, Cython is optional. It also injects the hard dependency in a way that makes automatic dependency resolution impossible; users who don't already have Cython installed will just have their builds fail. Making this change also essentially obviates all if the custom build and extension stuff altogether, so a fix like this ought to just remove all of that extra complexity. If this is meant as a quick hack, just do this instead. This preserves the full spirit of the original flow and just forces Cython 3 to use what was the default for |
@ahesford the |
The fact that it's in |
@ahesford ok, didn't know about this. Could you be more specific about the vestiges? Otherwise I think a try-catch would do here to only cythonize if possible. But like I said if your solution works for Cython 3, I'm not against using that instead. Is Cython guaranteeing that it will keep this Can you open a PR with your changes or add them here? |
Almost all of #731 is my minimal fix that is backwards compatible and will continue to work with subsequent Cython 3 releases until they decide to remove |
Closing in favor of #731, please apply the fix to the |
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.
@SoftwareApe: This is sort of a cool solution as it totally gets around cython_sources
(and the need for Cython.Distutils.old_build_ext
or Cthon.Distutils.build_ext
), however, it seems to always require Cython breaking with_cython
which allowed for installing prebuilt wheels without needing Cython. It seems like this solution could be improved to fix that.
It would be nice to use this solution but only at build time and not at install time. For example doing something more like Distributing Cython modules from the Cython documentation (which uses USE_CYTHON
vs. with_cython
) seems like a better solution.
@nitzmahone: It seems like the real solution is to avoid the deprecated |
By calling Cythonize directly we can make setup.py work for both versions of Cython.
This fixes #601 for PyYAML 5.4.1, it probably also works with PyYAML 6.0.1. But please apply this patch to version 5. We desperately need a fix here, since we can't just change all of Ubuntu Jammy to be compatible with PyYAML 6.