-
-
Notifications
You must be signed in to change notification settings - Fork 643
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
Cython Support #14752
Comments
Thanks for the example!
I haven't thought this through too much on how that plugin could be made "correct", but I think some internal Pants functionality would need to be exposed. Currently, Pants allows setting custom To give an idea of what that looks like for This plugin requires a custom Pants fork with this added functionality: 9f9cbe0 I think if custom |
I've seen your For my use case, I am fine with writing my own Something that @benjyw mentioned is that it would be fairly easy and extremely helpful to have a I'd be happy to try setting up a plugin for this issue, what would be a good reference? Should this be in this repo, or in a dedicated one? Just note that I'd be focusing on my use cases, so I'm hoping to get enough interest and contributions to build a proper generic plugin. |
Hey @houtenjack, no problem! Happy to help! For creating a custom plugin, the two main options are forking Pants and then just working in that repo. I find that a bit overwhelming personally, because there is so much stuff when I'm jumping around files. The other option is an in-source plugin (which is what my pants-plugins repo does). This is a bit tighter to navigate through, and easier to make example apps - however, if you need to make modifications to the Pants source, then you'll need to use My workflow is to write in-repo plugins, and then if there is a PR - perform that after everything works. |
Is your feature request related to a problem? Please describe.
I've been trying to integrate a project that depends on some
cython
extensions to a monorepo. It was pretty hard and time consuming for me as I don't know much about Cython and I couldn't find minimal examples online.After trying many approaches (including plugin development) I found that
pants
and the PEP-517 support allows to build Wheel distributions "natively" using a customsetup.py
to compile.pyx
files.Describe the solution you'd like
I'd like to have full cython support integrated with pants, or at least have a plugin for cython support. Ideally, both
.pyx
compilation and Pure Python mode should be supported.Describe alternatives you've considered
I considered developing a plugin for my specific use-case, however it's a daunting task for me and it would be very time consuming.
I know some people have done so, and @sureshjoshi has interest in prototyping it (sureshjoshi/pants-plugins#14). I'm not sure how popular Cython is right now and how much interest there is for this feature, but I'm willing to spend some time looking into this.
Additional context
I whipped up a minimal example that should showcase Cython support. At the moment it can build a wheel using a
python_distribution
target.You can find it at https://github.com/houtenjack/pants-cython-minimal-example
The text was updated successfully, but these errors were encountered: