Python packaging

Process Steps

  1. Develop setup.py and other distribution-related files

  2. Test distribution; should pass all distribution tests

  3. Register project with the Python Package Index (PyPI)

  4. Upload distribution(s) to PyPI

Distribution tests

  • python setup.py sdist does not raise an exception

  • all expected files are included in the distribution tarball

  • python setup.py test works in install environment

  • acceptance tests pass in install environment

  • python setup.py install produces expected footprint in site-packages

  • easy_install works

  • pip install python-pptx works


Distribution user stories

… some notions about who uses these and for what …

Roles

  • naive end-user

Use Cases

Test build before distribution

“Just-works” installation

In order to enable a new capability in my computing environment
As a naive end-user
I would like installation to "just work" and not scare me with error
messages that don't indicate a real problem.

Install as a dependency

Verify installation

In order to verify a new installation
As a python developer
I want to be able to easily run the test suite without having to invest in
any additional discovery or configuration.

Resources