很容易将.pyx编译为(.pyd.so)。
easycython的Python项目详细描述
,因为每次编写setup.py都很痛苦。
简介
easycython.py
是一个试图
自动将一个或多个.pyx
文件转换为
相应的编译的.pyd|.so
二进制模块
文件夹。示例:
$ python easycython.py myext.pyx
pip install easycython
将自动创建
在Scripts/
文件夹中的可执行脚本,因此
应该能够简单地:
$ easycython myext.pyx
甚至:
$ easycython *.pyx
您可以键入:
$ easycython -h
要获得以下cli:
usage: easycython.py [-h] [--annotation] [--no-annotation] [--numpy-includes] [--no-numpy-includes] [filenames [filenames ...]] positional arguments: filenames optional arguments: -h, --help show this help message and exit --annotation --no-annotation (default: True) --numpy-includes --no-numpy-includes (default: True)
--annotation
(默认)将发出html cython注释文件。--numpy-includes
(默认)将把numpy头添加到build命令中。- 编译器标志
-O2 -march=native
自动传递给 编译器。我还没有通过生成 使用调试器的C代码。