ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
Rolling with Wheels, sdists, and Twine for Python Packaging
1. Rolling with the Times
Using Wheels, pbr, and Twine
for Distributing and Installing Software
Doug Hellmann
PyATL Feb 2015
2. Dist Formats
• sdist
• source only
• requires compiler to install C extensions
• egg
• binary importable format
• defacto standard
• wheel
• binary installable format
• follows PyPA team standards
3. Wheel File Names
{distribution}-{version}(-{build tag})?-
{python tag}-{abi tag}-{platform tag}.whl
• distribution – software name
• version-buildtag – version string for distribution
• python tag – version of python
• abitag – C extension application binary interface
• platform tag – CPU architecture
12. Building Wheels of Other
Packages
$ pip wheel cmd2
Collecting cmd2
Using cached cmd2-0.6.8.tar.gz
Collecting pyparsing>=2.0.1 (from cmd2)
Using cached pyparsing-2.0.3-py2.py3-none-any.whl
Saved /Users/dhellmann/.pip/wheelhouse/pyparsing-2.0.3-
py2.py3-none-any.whl
Skipping pyparsing, due to already being wheel.
Building wheels for collected packages: cmd2
Running setup.py bdist_wheel for cmd2
Destination directory: /Users/dhellmann/.pip/wheelhouse
Successfully built cmd2
21. twine
$ twine -h
usage: twine [-h] [--version] {upload}
positional arguments:
{upload}
optional arguments:
-h, --help show this help message and exit
--version show program's version number and exit
22. twine – Uploading Signed
dists
python setup.py sdist
python setup.py bdist_wheel
gpg --detach-sign -a $sdistfile
gpg --detach-sign -a $wheelfile
twine upload $sdistfile $sdistsignfile
$wheelfile $wheelsignfile