Quick and handy wheel package format for Python applications
New Python package format that solves some problems and makes installing packages much faster
Python packaging needs some help. A solution to at least some problems may be wheel - a new format for fast and efficient software installation and distribution. It's described in few PEPs and now it's starting to take shape. It was showcased recently on PyCon PL 2013.
There is nearly no wheels on pypi but we can use them locally to make local installations faster (handy for continuous integration systems and alike that build a project from scratch often).
You will need a recent version of pip and distribute (as described in the documentation). In old virtualenvs or systems execute:
pip install --upgrade pip distribute
Then install wheel:
pip install wheel
To build wheels out of existing pypi packages you need to specify the packages and a local path for wheels:
pip wheel --wheel-dir=/wheel/folder PACKAGE_NAME
To install from local wheel folder just use:
pip install --use-wheel --no-index --find-links=/wheel/folder PACKAGE_NAME
If you have your own local Python package you can build a wheel from setup.py:
python setup.py bdist_wheel
It works with distribute (but not with distutils). As a result you will get "whl" packages like those:
Pillow is binary so it has the arch for which it have been built.
As an extra you also get "wheel" command that can operate on wheel packages (see "wheel help").
Django doesn't require compilation but it also doesn't install instantly. I've excluded download (pip install --no-install django) and measured install time (pip install --no-download django) on my computer:
Installing from wheel:
For Pillow compilation takes some time:
But with wheel it's a snap:
Even packages like Django can take advantage of the new package format. All binary packages will just install without the need of waiting for compilation to end. Nowadays it's mostly handy for build-testing (like continuous integration repeating tasks) and maybe deploying also.