Skip to content

Cython Support #14752

@htnjack

Description

@htnjack

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 custom setup.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

Metadata

Metadata

Assignees

No one assigned

    Labels

    backend: PythonPython backend-related issuesenhancementstaleThis issue has not received activity in a while

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions