Minimal project showcasing Pants' Cython support
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
.
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!
.pyx
files