Python, pip and virtualenv ... and chef/opscode
This will be edited frequently over time. It's an attempt to piece together an understanding of python packaging with an emphasis on current mainline tools and some history.
Virtualenv allows relatively safe experimentation within isolated local environments. But it is also possible to use "pip install --user $packagename" to install to ~/.local/packagename instead of systemwide.
Python package tools frontends:
=========================
easy_install is very basic and only used for bootstrapping if at all
pip keeps a list of what it has installed, allows easy querying and removal of installed versions. It uses pypi (which used to be called cheeseshop) as a "package index". Other package indices can be used, see for example the end of http://guide.python-distribute.org/pip.html
Distutils versus setuptools
http://peak.telecommunity.com/DevCenter/setuptools
setuptools is an enhancement of distutils
virtualenv provides a local copy (e.g. not /usr/lib/python2.7/site-packages or /usr/lib/python2.7/dist-packages) of python, python stdlibs, site-packages and pip)
http://dabapps.com/blog/introduction-to-pip-and-virtualenv-python/
virtualenv $namemyenvironment
Then either run all pip/python commands using the explicit path "env/bin/python env/bin/pip" or else use set the paths using:
Hitchhiker's Guide is essential reading
http://guide.python-distribute.org/pip.html
Sort of multi-platform make/installer which describes itself to "distutils" http://docs.python.org/2/distutils/introduction.html.
What is a module versus a package?
=============================
A package is a module that references/bundles other modules. A module should have a setup script, typically named setup.py. (Look for examples named something else). cd into the module's source directory and "python setup.py install" should install it manually.
A way of zipping up python source file with a "setup.py" script which specificies its dependencies, name and other data
http://peak.telecommunity.com/DevCenter/PythonEggs
http://mrtopf.de/blog/en/a-small-introduction-to-python-eggs/
Wheels are a zipped format which are the apparent successors to eggs. Their docs suggest that they have advantages in eliminating repeated rebuilding from source and are thus an ideal fit for working with virtualenv. The earlier egg format seemed to couple/conflate build and install and this decouples them.
http://wheel.readthedocs.org/en/latest/#wheel
http://www.python.org/dev/peps/pep-0427/
How to specify dependencies?:
=========================
http://pythonhosted.org/setuptools/setuptools.html#declaring-dependencies
What is the difference between requirements.txt and setup.py?
=================================================
https://caremad.io/blog/setup-vs-requirement/
https://wiki.python.org/moin/Distutils/Tutorial
There used to be "setuptools". A fork named "distribute" implemented some nice new ideas. Now distribute is merged into current setuptools>=0.8.
https://github.com/poise/python
This cookbook's python::pip recipe runs wget to install pip via a script
https://github.com/poise/python/blob/master/recipes/pip.rb
They moved from "distribute" to "setuptools" some time ago
https://github.com/poise/python/pull/48
Check which packages are outdated with pip/virtualenv
https://coderwall.com/p/8tagxw
Virtualenv pip interactions:
https://bugs.launchpad.net/tripleo/+bug/1265807
http://stackoverflow.com/questions/5585875/what-is-the-official-preferred-way-to-install-pip-and-virtualenv-systemwide
http://mirnazim.org/writings/python-ecosystem-introduction/
https://pypi.python.org/pypi/setuptools/0.8#using-setuptools-and-easyinstall Good set of links about the internals of python eggs and using the tools