Blubb - An example project with a minimalistic, automatic setup.py file

This example project demonstrates a layout and best practices for a single- script Python package that might contain one or more packages and data files that need installing. The script is made so that it also can be run from source (or installed system-wide).


  1. Only set one value in setup.py (PACKAGE_NAME), rest is automatic

  2. Metadata only defined in one place (lib/<PACKAGE_NAME>/__init__.py)

  3. Known-good module documentation (PYTHONPATH=lib pydoc <PACKAGE_NAME>)

  4. Runnable from a source checkout or from system-wide installation

  5. Standardized option parsing, including --version, --verbose and --help

  6. Manual page can be auto-generated with help2man (sh update_manpage.sh)

  7. Easy building of installation packages (e.g. RPM) (sh build_rpm.sh)

  8. TODO: Integration of testing (unit tests / automatic running / etc..)

    -> use nosetests + lib/<PACKAGE_NAME>/test.py for storing tests

  9. TODO: Use argparse instead of optparse (also for Py3k compat)

    -> also required for update_docs.py below

  1. TODO: Integrate update_docs.py from backuppurge (rst-based README + manpage generation + generate "webpage" of project from README file)

Scripts such as "update_manpage.sh" and "build_rpm.sh" are here only while we design the example project. Ideally all these utilities should be combined into a separate package (something like a "python package assistant" utility).