Skip to content

Flit: Python Package Build and Publish Tool

Flit is a Python packaging tool designed to be simple to use. Flit provides flit init to create a new package, flit publish for publishing to PyPI, automatically includes data files in the package, and fetches the package version number from the __init__.py file.

Flit does not support advanced packaging functionality like building C extensions. It also doesn’t provide a CLI for managing virtual environments or dependencies; the user creates their own virtualenv and adds dependencies to the pyproject.toml file manually.

flit-core build backend

flit-core is Flit’s build backend, distributed as a lightweight separate package with zero dependencies. It can be used independently of the flit CLI in any Python project, including uv projects:

uv init --build-backend flit my-lib

This generates a pyproject.toml with flit-core as the build backend:

[build-system]
requires = ["flit_core>=3.4"]
build-backend = "flit_core.buildapi"

flit-core handles pure Python packages only (no C extensions). Its minimal footprint makes it a good choice when build speed matters and the package has no compiled code.

See the flit-core documentation for configuration options.

Pros

  • Simple and easy to use
  • Supports PEP 621

Cons

  • Limited functionality (intentionally so)
  • No built-in support for managing virtual environments or dependencies

Learn More

Get Python tooling updates

Subscribe to the newsletter
Last updated on

Please submit corrections and feedback...