package
的 带有版本号的压缩文件。pip install
安装Built Distribution
和Source Distribution
.tar.gz
压缩文件,在用户的系统中执行最终的编译和安装python3 setup.py sdist
pip3 install dist/xxx.tar.gz
.so, .dll, .dylib
等二进制文件,压缩文件名称中指定了系统信息和python版本等信息Wheels
和 Eggs
是bdist 包格式。Eggs 是在2004年提出的一种格式。Wheels是在2012年提出的,用于取代egg。所以不要再使用Eggs了。.egg
后缀,Wheels 用.whl
后缀。{dist}-{version}|-{build}|-{python}-{abi}-{platform}.whl
python3 setup.py bdist_wheel
pip3 install dist/xxx.whl
根据 application 包含的代码类型以及其所支持的 python 版本, wheel 格式可细分为三种
python setup.py bdist_wheel --universal
running bdist_wheel
running build
installing to build/bdist.macosx-10.10-intel/wheel
......
running install_scripts
creating build/bdist.macosx-10.10-intel/wheel/packagedemo-2015.09.1.dist-info/WHEEL
$ ls dist
packagedemo-2015.09.1-py2-none-any.whl
采用如下命令可编译成非 universal wheel(即 pure python wheel 或 platform wheel):
$ python setup.py bdist_wheel
running bdist_wheel
running build
installing to build/bdist.macosx-10.10-intel/wheel
......
running install_scripts
creating build/bdist.macosx-10.10-intel/wheel/packagedemo-2015.09.1.dist-info/WHEEL
$ ls dist
packagedemo-2015.09.1-py2.py3-none-any.whl
python setup.py sdist bdist_wheel
可以生成sdist和bdist
Python application 的打包和发布