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-libThis 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
Also Mentioned In
- The uv build backend is now stable
- build: Python Package Build Frontend
- How do uv and Poetry compare?
- pyproject.toml: Python Project Configuration File
- Twine: Python Package Upload Tool
- Understanding uv init Project Types
- What is a build backend?
- What is PEP 517/518 compatibility?
- What is PEP 660?
- Wheel: Python Binary Distribution Format
- Why are there so many Python packaging tools?
- Why Should I Choose pyproject.toml over requirements.txt for managing dependencies?
- Why You Should Try uv if You Use Python
Get Python tooling updates
Subscribe to the newsletter