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).
- Only set one value in setup.py (PACKAGE_NAME), rest is automatic
- Metadata only defined in one place (lib/<PACKAGE_NAME>/__init__.py)
- Known-good module documentation (PYTHONPATH=lib pydoc <PACKAGE_NAME>)
- Runnable from a source checkout or from system-wide installation
- Standardized option parsing, including --version, --verbose and --help
- Manual page can be auto-generated with help2man (sh update_manpage.sh)
- Easy building of installation packages (e.g. RPM) (sh build_rpm.sh)
- TODO: Integration of testing (unit tests / automatic running / etc..)
- -> use nosetests + lib/<PACKAGE_NAME>/test.py for storing tests
- TODO: Use argparse instead of optparse (also for Py3k compat)
- -> also required for update_docs.py below
- 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).