前置知识: Python

Python与打包发布

1 minIntermediate2026/6/14

PyPI与包发布

1. pyproject.toml

[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"

[project]
name = "my-package"
version = "1.0.0"
dependencies = ["requests>=2.28"]

2. 发布

python -m build
twine upload dist/*