At some point, your software is finished and you want to push it to production. This chapter shows you how to ship your software!
How you ship depends on who’s going to run it. A desktop tool for colleagues who don’t have Python needs something different from a web application on a server, or a library other Python developers will install. The articles in this chapter cover the most common cases:
- PyInstaller: bundle your program into a single executable that anyone can run, without installing Python first. Ideal for sharing a tool with non-programmers.
- Python-based Docker containers: package your application with all its dependencies into an image that runs the same everywhere. It’s a great way to ship your software to many different cloud providers.
- CI/CD: once you know how to create a Docker image, let a pipeline test, build, and deploy your Python software automatically every time you push a change.
- Guerrilla scaling: grow a web application from a single cheap server to millions of users, without spending millions of dollars.
Writing a library instead of an application? Then you ship it as a package that others install with pip or uv. Modern Python packages describe themselves in a pyproject.toml file, and tools like uv (uv build) and Poetry build and publish them to PyPI for you.