-
Notifications
You must be signed in to change notification settings - Fork 5
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
Failed getting this to work #45
Comments
Can you show examples of configuration that you have tried? |
Appreciate the time to detail your use case, much appreciated. As @ofek mentioned, a config reference would be helpful - if I'm understanding your use case properly though, your aim is to compile the python files only specified by what you declare in the configuration? At this time, there is only an exclude implementation; that being said I'm happy to implement / accept PRs if it's a needed feature 👍 |
Yes, an explicit (It's a common use case for Python packages to have multiple Cython extensions, so the config format should probably be modeled using that abstract model. The current config model seems very global?) |
Agreed - will set up a tracking issue for this one.
Hmm, this one I support less but am open if there's a strong technical reason to support - I'm not in particular against this, but in those use cases I think it's a project design consideration vs how this library should function. I don't want to tell anyone else how to structure their projects, but IMO the best approach to needing multiple Cython extensions is to take a rust-style monorepo approach where each submodule has it's own |
Hey @itamarst - v0.6.0rc0 is released, feel free to try it out. Let me know if there are any issues with the build & will work to have the final v0.6.0 suit the needs of your use case. Based on the above, you'll want a config like: # hatch.toml
[build.targets.wheel]
macos-max-compat = false
packages = ["twisted"]
[build.hooks.cython]
dependencies = [
"hatch-cython>=0.6.0rc0"
]
[build.hooks.cython.options]
src = "twisted"
[build.hooks.cython.options.files]
aliases = {"twisted.internet._deferred_base" = "twisted.internet._deferred_cython"}
targets = ["*/internet/_deferred_base.py"] |
I was very glad to see this existed but I cannot figure how to use it.
I want to have a
.py
file that is both importable from Python and compiled via Cython (so we can distribute source-only wheel as fallback). With setuptools I would try something like this (untested):Unfortunately I can't figure how one would do this with the current config format. I am particularly confused by the fact that there's no way to list which files an extension should have, or at least no documented way. My initial attempts resulted in every single
.py
file being compiled as an extension, which is probably not ideal 😁Any help would be appreciated.
The text was updated successfully, but these errors were encountered: