How should I structure a Python package that contains Cython code

后端 未结 10 1834
傲寒
傲寒 2020-12-22 15:11

I\'d like to make a Python package containing some Cython code. I\'ve got the the Cython code working nicely. However, now I want to know how best to package it.

For

10条回答
  •  粉色の甜心
    2020-12-22 15:21

    Including (Cython) generated .c files are pretty weird. Especially when we include that in git. I'd prefer to use setuptools_cython. When Cython is not available, it will build an egg which has built-in Cython environment, and then build your code using the egg.

    A possible example: https://github.com/douban/greenify/blob/master/setup.py


    Update(2017-01-05):

    Since setuptools 18.0, there's no need to use setuptools_cython. Here is an example to build Cython project from scratch without setuptools_cython.

提交回复
热议问题