Package And Distribute Python Applications

To "freeze" or to "package"?

To "freeze" or to "package"?

Packaging your code is for distributing libraries or tools to other developers.
Freezing the code is creating a single-file executable file to distribute to end-users, that contains all of your application code as well as the Python interpreter.

Distributing your Python App/Libs

Distributing your Python App/Libs

the pip way: requirements.txt

Requirements files are files containing a list of items to be installed using pip install
Tools:
pip-tools - A set of tools to keep your pinned Python dependencies fresh.

the pipenv way: Pipfile && Pipfile.lock

Managing a requirements.txt file can be problematic, so Pipenv uses Pipfile and Pipfile.lock to separate abstract dependency declarations from the last tested combination
github.com/pypa/pipfile
Using Pipfile for fun and profit by Matt Layman

pipfile

Pipfiles contain information about the dependencies of your project, and supercede the requirements.txt

pipfile.lock

The package name and its version, as well as the list of its dependencies, can be frozen by updating the Pipfile.lock

  		pipenv lock
  	

Live demo

Creating a single-file executables

Creating a single-file executables

Overview

Freezing Your Code @The Hitchhiker's Guide to Python

using pyInstaller to create Windows executable and Linux packages

Creating Built Distributions

Creating Built Distributions

Overview

Creating Built Distributions @python docs

Resources

Resources

Video

YouTube: Glenn Ramsey: Packaging a Python desktop application using PyInstaller

Packaging and distributing projects @packaging.python.org

These slides are based on

customised version of

Hakimel's reveal.js

framework