htnjack / pants-cython-minimal-example

Minimal project showcasing Pants' Cython support
MIT License
1 stars 1 forks source link

pants-cython-minimal-example

Minimal project showcasing Pants' Cython support

Project Structure

src/python/app contains a minimal Python project. It has a pex_binary target.

src/python/my_extensions contains minimal Cython sources (the code is from their example).

The goal is to use the hello wheel as a dependency of app.

Building the Cython package

Running ./pants package src/python/my_extensions:dist will build a wheel in the dist/ folder.

pip install dist/GENERATED_WHEEL will install the hello package in the current environment.

>>> import hello
>>> hello.say_hello_to("Cython")
# if "NOT COMPILED" is printed here, for some reason the code is interpreted
Hello Cython!

TODO