Freedom251 › Python Package Managers
Flit

What Flit is
Flit is a free packaging and publishing tool for Python modules and packages intended for PyPI. It focuses on pure Python projects that do not need build steps, packaging one importable module or package at a time. Running flit init prompts for module information and creates a pyproject.toml file. Flit build then creates wheel and source distribution files, with either format available separately, while flit publish builds distributions and uploads them to PyPI, TestPyPI, or another configured package index. Subpackages and package data files are included automatically, and the package version is read from the module’s __version__ attribute. Flit uses pip for installation and requires Python 3, including Python 3’s pip to install it. It works on Linux and Windows. Dependencies are not managed automatically and must be entered in pyproject.toml. Flit cannot handle projects requiring build steps such as compiling C code or bundling JavaScript. Upload credentials can use keyring or environment variables, with password prompts when keyring is unavailable.
Who it suits
Flit suits Python developers publishing pure Python packages without build steps. It is less suitable when projects require compiled or other build processes, or automatic dependency management.
What it does well
- Creates pyproject.toml through an interactive init command
- Builds wheels and source distributions
- Publishes to PyPI and other configured indexes
- Includes subpackages and package data automatically
- Supports reproducible wheel output from identical sources
What to know first
- Cannot package projects requiring build steps
- Dependencies must be added manually
- Requires Python 3 and Python 3’s pip
Verdict
Flit provides a focused route from a simple Python package to build artifacts and PyPI publication. Its narrow scope keeps the workflow direct, but projects needing build steps or automatic dependency handling need another approach.
Facts from Flit's own pages
- Automated publishing
- Flit supports configuring upload servers and credentials through environment variables for automated releases, while warning that environment variables can expose passwords to other scripts and libraries in the environment. · flit.pypa.io, 9 Oct 2026
- Build
- The `flit build` command builds wheel and source distribution files. · flit.pypa.io, 8 Oct 2026
- Builds
- The `flit build` command builds a wheel and source distribution, with an option to build either format alone. · flit.pypa.io, 9 Oct 2026
- Credential handling
- Flit tries to store upload passwords securely using the keyring library; without keyring, it prompts for a password for each upload. · flit.pypa.io, 9 Oct 2026
- Integrations
- Flit uses pip for installation and supports uploading to PyPI, TestPyPI, or another configured package index. · flit.pypa.io, 9 Oct 2026
- Intended use
- Flit focuses on pure Python packages with no build steps, such as compiling C code or bundling JavaScript. · flit.pypa.io, 9 Oct 2026
- Limit: build steps
- Flit cannot be used for packages that require a build step. · flit.pypa.io, 8 Oct 2026
- Limit: dependencies
- Flit does not manage dependencies, which must be added to `pyproject.toml` by hand. · flit.pypa.io, 8 Oct 2026
- Notable limitation
- Flit cannot be used for packages that need a build step and does not manage dependencies automatically; dependencies must be added to `pyproject.toml` by hand. · flit.pypa.io, 9 Oct 2026
- Package contents
- Flit automatically includes subpackages and data files within a package. · flit.pypa.io, 8 Oct 2026
- Packaging
- Flit packages one importable module or package at a time and automatically includes its subpackages and package data files. · flit.pypa.io, 9 Oct 2026
- Publishing
- The `flit publish` command builds and uploads packages to PyPI or another configured package repository. · flit.pypa.io, 9 Oct 2026
- Purpose
- Flit is a simple way to put Python packages and modules on PyPI, aiming to reduce packaging effort and common mistakes. · flit.pypa.io, 9 Oct 2026
- Python requirement
- The Flit command line tool requires Python 3. · flit.pypa.io, 9 Oct 2026
- Reproducible builds
- Flit says wheels built from the same source code can be byte-for-byte identical, with file timestamps noted as a caveat that can be overridden using `SOURCE_DATE_EPOCH`. · flit.pypa.io, 9 Oct 2026
- Setup
- The `flit init` command helps set up package information in a `pyproject.toml` file. · flit.pypa.io, 9 Oct 2026
- Target packages
- Flit focuses on pure Python packages that have no build steps. · flit.pypa.io, 8 Oct 2026
- Version metadata
- Flit can obtain a package’s version from its `__version__` attribute. · flit.pypa.io, 9 Oct 2026
- Windows support
- The `--pth-file` install option works on Windows, where symlinks typically are not allowed. · flit.pypa.io, 8 Oct 2026
Where Flit stands on Freedom251
- Python Package Managers#16 of 27