如何将未更改的 C 扩展打包为新 Python 包的一部分?
我已经向 pypi 发布了新版本的 Python 包,而没有更改 C 扩展名。由于我只更改了Python代码,没有更改C代码,那么如何将我为多个平台编译的共享库打包而不需要重新编译呢?
I've released a new version of a Python package to pypi without changing the C extension. Since I have only changed the Python code, not the C code, how do I package the shared libraries I have compiled for several platforms without having to recompile?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
作为一个名为“somelib”的库的示例,其编译库位于两个子目录 lib-i386 和 lib-amd64 中:
MANIFEST.in 包含以下内容:
setup.py 包含(我省略了对版本控制问题不必要的行):
All库对象位于包内,但仅安装特定于“arch”的库对象。
HTH。
As an example for a library called 'somelib' with compiled libraries in two subdirectories, lib-i386 and lib-amd64:
MANIFEST.in contains the following:
setup.py contains (I've omitted lines unessential to the versioning issue):
All the library objects are inside the package, but only the ones specific to 'arch' are installed.
HTH.