Linux command
flit 命令
文本
复制后可按需替换文件名、目录或参数。
常用示例
Initialize new project
flit init
Build package
flit build
Install in development mode
flit install --symlink
Publish to PyPI
flit publish
Publish to TestPyPI
flit publish --repository testpypi
Install only dependencies
flit install --only-deps
Check project configuration
flit check
说明
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.
参数
- init
- Create pyproject.toml interactively.
- build
- Build wheel and sdist.
- install
- Install locally.
- install --symlink
- Symlink module into site-packages for development.
- install --pth-file
- Use .pth file for development (works on Windows).
- install --deps _DEPS_
- Which dependencies to install: all, production, develop, or none (default: all).
- install --only-deps
- Install dependencies only, not the package itself.
- install --python _PATH_
- Install for a different Python interpreter.
- publish
- Upload to PyPI.
- publish --repository _name_
- Target repository (pypi, testpypi).
- check
- Validate project configuration.
FAQ
What is the flit command used for?
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.
How do I run a basic flit example?
Run `flit init` in a terminal, then adjust file names, paths, flags, or remote targets for your system.
What does init do in flit?
Create pyproject.toml interactively.