name: python-packaging description: | Python package creation and PyPI distribution via pyproject.toml and entry points version: 1.9.8 triggers: - python - packaging - pyproject.toml - uv - pip - pypi - distribution - publishing a package or setting up build configuration metadata: {"openclaw": {"homepage": "https://github.com/athola/claude-night-market/tree/master/plugins/parseltongue", "emoji": "\ud83e\udd9e"}} source: claude-night-market source_plugin: parseltongue
Night Market Skill — ported from claude-night-market/parseltongue. For the full experience with agents, hooks, and commands, install the Claude Code plugin.
Modern Python packaging with pyproject.toml, uv, and best practices for distribution.
# Create new project with uv
uv init my-package
cd my-package
# Add dependencies
uv add requests click
# Build package
uv build
# Publish to PyPI
uv publish
Verification: Run the command with --help flag to verify availability.
# Source layout (recommended)
src/my_package/
__init__.py
module.py
# Flat layout (simple)
my_package/
__init__.py
module.py
Verification: Run the command with --help flag to verify availability.
Source layout benefits: - Clear separation of source and tests - Prevents accidental imports of uninstalled code - Better for packages with complex structure
Minimal Project:
**Verification:** Run `pytest -v` to verify tests pass.
my-project/
├── pyproject.toml
├── README.md
├── src/
│ └── my_package/
│ └── __init__.py
└── tests/
└── test_init.py
Verification: Run pytest -v to verify tests pass.
Complete Project:
**Verification:** Run the command with `--help` flag to verify availability.
my-project/
├── pyproject.toml
├── README.md
├── LICENSE
├── .gitignore
├── src/
│ └── my_package/
│ ├── __init__.py
│ ├── cli.py
│ ├── core.py
│ └── utils.py
├── tests/
│ ├── conftest.py
│ └── test_core.py
└── docs/
└── index.md
Verification: Run pytest -v to verify tests pass.
See modules for detailed information:
这是一个相当实用的 Python 打包技能,涵盖项目创建、依赖管理、发布等关键环节,示例清晰易懂,能帮助开发者快速上手。文档质量整体不错,但有些小瑕疵需要注意:部分内容存在重复或格式小问题,版本号标注也不够统一。虽然不影响核心使用,但对于追求严谨的用户来说略显遗憾。总体瑕不掩瑜,是值得参考的好资源。