Deployment

How to package, publish, and run Cowser in production-like environments.

Table of Contents

PyPI publishing

Cowser is distributed on PyPI as cowser. To publish a new release:

# 1. Bump the version in cowser/__init__.py and pyproject.toml
# 2. Add a CHANGELOG.md entry under [Unreleased]
python -m pip install build twine
python -m build
python -m twine upload dist/cowser-X.Y.Z*

The build and twine tools are available via the dev extra.

Single-file binaries

Standalone binaries (no Python required) are built with PyInstaller:

pip install -e ".[binary]"
python scripts/build_binary.py

The binary lands in dist/ (cowser.exe on Windows). Build on the target platform — a Linux binary runs on Linux, a Windows binary on Windows, and so on.

Docker

A multi-stage Dockerfile is provided at the repo root:

docker build -t cowser .
docker run --rm cowser --cow owl "Hello from a container"

The image:

  • builds the wheel in a python:3.12-slim builder stage,
  • installs it into a fresh slim runtime image,
  • runs as the non-root user cowser (uid 1000),
  • exposes cowser as the entry point, and
  • health-checks with cowser --version.

The .dockerignore keeps build caches, site/, .venv/, and git metadata out of the build context.

Release checklist

  1. Bump the version in cowser/__init__.py and pyproject.toml (keep .version in sync).
  2. Add a CHANGELOG.md entry.
  3. Run python -m pytest and python -m mypy cowser.
  4. Commit, push, and publish to PyPI (see above).

← Back to README