如何在pypi上为多个版本的Python分发Windows的预编译扩展模块? [英] How do I distribute precompiled extension modules for Windows on pypi for multiple versions of Python?
问题描述
我想分发一个针对32位和64位版本的Python 2.6和Python 2.7的预编译C扩展模块.我应该如何在pypi上构建和分发它?我应该只使用bdist_egg吗?我可以保持与pip的兼容性吗?
I would like to distribute a precompiled C extension module for Python 2.6 and Python 2.7 for 32- and 64-bit versions of Python. How should I build and distribute that on pypi? Should I just use bdist_egg? Can I retain compatibility with pip?
我注意到普通的bdist只会创建一个不包含Python版本的.zip
,尽管内部文件夹结构包含了.这个.zip
是否可以仅包含例如一个Python26和Python27子目录?
I notice ordinary bdist just creates a .zip
that does not include the Python version, although the internal folder structure does. Can this .zip
just contain e.g. a Python26 and Python27 subdirectory?
推荐答案
通常,您需要在需要支持的每个Python版本中运行bdist_something. bdist_egg确实可以与PIP afaik配合使用(您可以轻松对其进行测试).
You generally need to run bdist_something with each version of Python you need to support. bdist_egg does indeed work with PIP afaik (you can easily test it).
Zope工具包具有多个适用于Windows的二进制发行版,并且正在使用二进制鸡蛋: http://pypi.python.org/pypi/zope.interface
The Zope Toolkit has several binary distributions for Windows, and it's using binary eggs: http://pypi.python.org/pypi/zope.interface
这篇关于如何在pypi上为多个版本的Python分发Windows的预编译扩展模块?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!