一键导入
python-packaging
Create distributable Python packages with proper project structure, pyproject.toml, and publishing to PyPI.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Create distributable Python packages with proper project structure, pyproject.toml, and publishing to PyPI.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
How agents, skills, and commands work in Claude Code projects.
GitHub conventions -- branch naming, commit format, issue/PR templates, and safe issue/PR referencing in comments.
API error response format -- machine-readable codes, human-readable reasons, status code rules.
Language-agnostic code hygiene -- honest comments, no dead/reinvented/duplicated code, truthful names, real implementations, and scoped (never blanket) diagnostic suppressions.
Language-agnostic structural craft -- decompose on responsibility not size, prefer deep modules over shallow piles, and shape cohesion, coupling, interfaces, error contracts, and data invariants. Sibling to code-hygiene and readable-code.
Documentation writing conventions -- style, structure, tone, and quality standards.
| name | python-packaging |
| description | Create distributable Python packages with proper project structure, pyproject.toml, and publishing to PyPI. |
| when_to_use | Packaging Python libraries, creating CLI tools, or distributing Python code. |
Comprehensive guide to creating, structuring, and distributing Python packages using modern packaging tools, pyproject.toml, and publishing to PyPI.
src/package_name/ (recommended)package_name/ (simpler but less flexible)my-package/
|-- pyproject.toml
|-- README.md
|-- LICENSE
|-- src/
| `-- my_package/
| |-- __init__.py
| `-- module.py
`-- tests/
`-- test_module.py
[build-system]
requires = ["setuptools>=61.0"]
build-backend = "setuptools.build_meta"
[project]
name = "my-package"
version = "0.1.0"
description = "A short description"
authors = [{name = "Your Name", email = "you@example.com"}]
readme = "README.md"
requires-python = ">=3.8"
dependencies = [
"requests>=2.28.0",
]
[project.optional-dependencies]
dev = [
"pytest>=7.0",
"black>=22.0",
]
my-package/
|-- pyproject.toml
|-- README.md
|-- LICENSE
|-- .gitignore
|-- src/
| `-- my_package/
| |-- __init__.py
| |-- core.py
| |-- utils.py
| `-- py.typed # For type hints
|-- tests/
| |-- __init__.py
| |-- test_core.py
| `-- test_utils.py
`-- docs/
`-- index.md
Advantages:
pyproject.toml for source layout:
[tool.setuptools.packages.find]
where = ["src"]
my-package/
|-- pyproject.toml
|-- README.md
|-- my_package/
| |-- __init__.py
| `-- module.py
`-- tests/
`-- test_module.py
Simpler but:
project/
|-- pyproject.toml
|-- packages/
| |-- package-a/
| | `-- src/
| | `-- package_a/
| `-- package-b/
| `-- src/
| `-- package_b/
`-- tests/
Detailed pattern documentation lives in references/details.md. Read that file when the navigation tier above is insufficient. For advanced patterns, see references/advanced-patterns.md.