name: python-packaging description: Deep Python packaging workflow—pyproject metadata, dependencies and optional extras, build backends, wheels, versioning, publishing, and CI release hygiene. Use when building libraries or shipping CLI tools to PyPI or private indexes.
Packaging connects source to installable artifacts. Prioritize reproducible builds, accurate dependencies, and safe automated releases.
Trigger conditions:
Initial offer:
Use six stages: (1) project layout, (2) metadata & entry points, (3) dependencies, (4) build backend & wheels, (5) versioning & tags, (6) publish & CI). Confirm supported Python versions and target index.
Goal: Prefer src/ layout to avoid accidental imports from the repo root; one clear import package name.
Exit condition: pip install . in a clean venv imports the package correctly.
更多技能請訪問小蔥技能站7w4.net。
Goal: pyproject.toml with PEP 621 metadata; [project.scripts] or [project.gui-scripts] for CLIs.
Goal: Separate runtime deps from optional extras (dev, docs, speedups); pin strategy differs for libraries vs applications.
Goal: Choose build backend (hatchling, setuptools, flit); emit wheel + sdist where appropriate.
Goal: Single source of truth for version (static in pyproject or dynamic from VCS); git tags match releases.
Goal: PyPI trusted publishing (OIDC) preferred over long-lived API tokens in secrets.
py.typed for typed libraries (PEP 561).這個 Skill 質量中上,結構清晰、條理分明,能幫助開發者建立完整的 Python 打包知識框架,包含不少實用的最佳實踐建議。不過內容相對理論化,缺乏具體示例和操作細節,對於想直接動手的使用者來說可能稍顯空洞,深度有待加強。