Skip to content

A minimal cython project with instructions for building wheel files

License

Notifications You must be signed in to change notification settings

gastoneb/cython-wheel-hello-world

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

cython-wheel-hello-world

cython-wheel-hello-world aims to demonstrate a minimal correct project structure and wheel file build procedure for cython projects. Python packaging has evolved with PEP 517 and PEP 518 (etc.) and the introduction of the many packaging tools listed by the Python Packaging Authority, and meanwhile there is a lot of outdated or incorrect guidance online.

This small cython project generates wheel files using setuptools (including setup.py to configure the cython extensions), pyproject.toml (to configure a virtual env for building the wheel file), MANIFEST.in (so the compiled cython code is packaged with the wheel file), and using either build or cibuildwheel to build the wheel files.

Instructions

The wheel file for this project can be built using build:

python -m build

Or alternatively, using cibuildwheel (note: if using Windows or Mac OS, docker is required if the platform option is set to linux):

cibuildwheel --platform=linux --output-dir=dist

The wheel file can then be installed:

pip install dist/cython_wheel_hello_world[versioning_info].whl

Finally, the code can be run:

> from cython_wheel_hello_world import hello_world
> hello_world()
Hello, world!

Further information

About

A minimal cython project with instructions for building wheel files

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published