LinuxCommandLibrary

flit

TLDR

Initialize new project

$ flit init
copy
Build package
$ flit build
copy
Install in development mode
$ flit install --symlink
copy
Publish to PyPI
$ flit publish
copy
Check project configuration
$ flit check
copy

SYNOPSIS

flit [options] command [args]

DESCRIPTION

flit is a simple Python packaging tool that uses pyproject.toml for configuration. It handles building wheels and source distributions and publishing to PyPI with minimal setup.
Flit is designed for pure Python packages with simple needs. It reads package metadata from the module's docstring and _version_ attribute, requiring minimal configuration.

PARAMETERS

init

Create pyproject.toml interactively.
build
Build wheel and sdist.
install
Install locally.
--symlink
Symlink for development.
--pth-file
Use .pth file for development.
publish
Upload to PyPI.
--repository name
Target repository (pypi, testpypi).
check
Validate project configuration.

PYPROJECT.TOML EXAMPLE

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

[project]
name = "mypackage"
authors = [{name = "Me"}]
dynamic = ["version", "description"]

[project.scripts]
mycli = "mypackage:main"
copy

CAVEATS

Best for pure Python packages without complex build requirements. No support for compiled extensions. Requires module docstring for description. Publishing needs PyPI credentials.

HISTORY

flit was created by Thomas Kluyver as a simpler alternative to setuptools for pure Python packages. It helped drive the adoption of pyproject.toml and was an early implementation of PEP 517/518 build standards.

SEE ALSO

pip(1), poetry(1), hatch(1), twine(1)

Copied to clipboard