For most of Python’s existence, there’s been no official standard distribution format. While different distribution tools generally use some common archive format—even the Egg format introduced by setuptools is just a zip file with a different extension—their metadata and package structures are incompatible with each other. This problem was compounded when an official installation standard was finally defined in PEP 376 that was also incompatible with existing formats.
To solve these problems, PEP 427 was written to define a new standard for Python distribution packages called Wheel. The reference implementation of this format is available as a tool, also called Wheel.
Wheel is supported by pip starting with version 1.4. If you’re using setuptools and have the Wheel package installed, it automatically integrates itself as a setuptools command named bdist_wheel. If you don’t have Wheel installed, you can install it using the command pip install wheel
要创建控制盘,请运行以下命令:
$ python setup.py bdist_wheel
The bdist_wheel command creates a .whl file in the dist directory. As with the Egg format, a Wheel archive is just a zip file with a different extension. However, Wheel archives do not require installation—you can load and run your code just by adding a slash followed by the name of your module:
One of the advantages of Wheel is that its naming conventions allow you to specify whether your distribution is intended for a specific architecture and/or Python implementation (CPython, PyPy, Jython, and so on). This is particularly useful if you need to distribute modules written in C.
Wheel is a great format for distributing ready-to-install libraries and applications, so you are encouraged to build and upload them to PyPI as well.
来自伟大的书"Serious Python"
要创建控制盘,请运行以下命令:
相关问题 更多 >
编程相关推荐