Mon Dec 8 17:02:20 EST 2008

PyPI, easy_install and setuptools

Ok, I need to make some quick notes regarding how to make egg distributions for python packages (there’s an earlier post on this too).

First, you MUST have in your setup.py file the following line (this is embarrassing):

packages = find_packages()

Without it, your egg will have nothing in it. I wonder what, exactly everyone was downloading from PyPI? And not a single complaint.

I added a ChangeLog to my package using the emacs ChangeLog mechanism. So now I have two sets of logs – one in svn which is file based and another in the ChangeLog which is module based. Hopefully this won’t be too hard to maintain but I see no other way of tracking things.

To upgrade a package you've installed using easy_install:

sudo easy_install --upgrade packagename

To create source and egg distributions and upload them to PyPI:

python setup.py sdist bdist_egg upload

Also, To add a ChangeLog to my package I created the file using emacs, added it to my subversion repository with:

svn add ChangeLog
svn ci

Then when I built my distributions it was included automatically. This fact, that to include python modules in your package you must use the findpackages() command in setup.py but to include any other files they must simply be part of your subversion checkout, is what confused me before and lead me to omit the findpackages() entry.


Posted by vschmidt | Permanent link