Python Packaging

Use when creating or reviewing distributable Python libraries/CLIs, pyproject metadata, wheels, source distributions, dependencies, or package releases.

9 stars 3 forksSoftware Development

Install

skills CLI (Claude Code, Cursor, Codex and more)
npx skills add sandbaseai/workbuddy-skill --skill python-packaging
Manual install
git clone --depth 1 https://github.com/sandbaseai/workbuddy-skill.git /tmp/workbuddy-skill
mkdir -p ~/.claude/skills
cp -r /tmp/workbuddy-skill/skills/python-packaging ~/.claude/skills/python-packaging

Personal skills live in ~/.claude/skills. Use .claude/skills in a project folder to share a skill with your team.

From the SKILL.md

# Python Packaging

把 Python 源码构建成可验证、可复现、可安全安装的 wheel 和 source distribution。打包不仅是写一个 `setup.py`:元数据、依赖、构建后端、命名空间、入口点、许可证、源码内容和发布证据必须一致。

## 使用边界

- 开始前确认 Python 支持版本、包名归属、版本策略、构建后端、依赖来源、许可证、registry、owner 和发布授权。
- 默认只读审查 `pyproject.toml`、源码布局、lockfile、构建日志和历史 artifact;在隔离环境构建,不执行安装包中的未知代码。
- 不擅自发布到 PyPI/私有 registry、覆盖/撤回版本、上传凭据、改变依赖范围或执行 release workflow;这些操作需要明确授权。
- 构建日志、metadata 和源码包不得包含 token、内部路径、环境变量、私有 URL 或敏感测试数据。

## 现代项目结构与元数据

优先 `src/<package_name>/` layout,避免从仓库根目录误导入未安装代码。使用 `pyproject.toml` 声明 PEP 517/518 build system 和 PEP 621 project metadata;保留 README、LICENSE、变更记录、类型标记和支持 Python 版本。包名、导入名、发行版本和 CLI entry point 分开校验。

```toml
[build-system]
requires = ["hatchling==1.27.0"]
build-backend = "hatchling.build"

[project]
name = "example-tool"
version = "0.1.0"
description = "A bounded example CLI"
readme = "README.md"
license = { file = "LICENSE" }
requires-python = ">=3.11"
dependencies = ["httpx>=0.27,<1"]

[project.scripts]
example-tool = "example_tool.cli:main"
```

版本由单一可信来源生成,不能让 tag、metadata、代码常量和发布说明漂移。对 dynamic version、extras、环境标记、optional dependency、namespace package 和 `py.typed` 做构建后检查;避免依赖范围过宽导致不可复现安装。

## 依赖与供应链

锁定直接/间接依赖、Python/平台 markers、build dependencies 和哈希;定期审查许可证、维护状态、已知漏洞、脚本钩子和构建后端。区分 runtime、build、test 和 docs 依赖,避免把测试工具带入生产安装。

构建在干净、无凭据的隔离环境中完成,禁止 setup/build 阶段联网下载未锁定内容或读取 secret。记录源码 commit、lockfile hash、构建器/解释器版本、输入文件清单和 artifact hash,形成可验证 provenance;签名密钥只通过受控 CI 注入。

## 构建与 artifact 检查
Read the full skill on GitHub

Details

Skill name
python-packaging
Path
skills/python-packaging/SKILL.md
License
MIT
Repo updated
8 September 2026

FAQ

What does the Python Packaging skill do?

Use when creating or reviewing distributable Python libraries/CLIs, pyproject metadata, wheels, source distributions, dependencies, or package releases.

How do I install the Python Packaging skill?

skills CLI (Claude Code, Cursor, Codex and more): npx skills add sandbaseai/workbuddy-skill --skill python-packaging. Skills go in ~/.claude/skills (personal) or .claude/skills (project), and Claude loads them automatically when a task matches the description.

Is Python Packaging popular?

It lives in sandbaseai/workbuddy-skill, which has 9 GitHub stars and 3 forks.

Related skills

Browse the most popular Claude skills, all software development skills, or write your own with the skills generator.