6 things I learned about setuptools

While building pyvcs and django-vcs over 4th of July weekend with Alex Gaynor1, there were a few interesting lessons learned, mostly revolving around how setuptools works. As Jacob mentions in his post on buildout, you mostly have to cobble together the usage of setuptools from other setups. This works well at about 90% of the case. There are a few gotchas, however.

  1. findpackages('directory') will look under directory for a list of python modules to install. For our applications, we actually just wanted findpackages()
  2. You can't easily specify multiple authors for a project. We settled on author = "First Author, Second Author"
  3. Its a good idea to version target your requirements. Don't require "pyvcs", require "pyvcs>=0.1".
  4. If your project contains django templates, set the zipsafe property to False.
  5. The register or sdist upload setup.py commands actually check that your project installs. For that, its likely better to use a virtualenv and test the installation.
  6. packagedata is used to includes docs (or in our case, templates) with the project.

Footnotes:

1

You can find the announcement here.

© 2012 - 2023 · Home — Theme Simpleness