Nm Parseltongue Python Packaging

👤 athola 📦 v1.9.16 ⭐ 4.5 ⬇️ 1.1K 下載
💻 開發程式設計 免費

📖 技能介紹


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.

Table of Contents

Python Packaging

Modern Python packaging with pyproject.toml, uv, and best practices for distribution.

Quick Start

# 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.

When To Use

  • Creating distributable Python libraries
  • Building CLI tools
  • Publishing to PyPI
  • Setting up development environments
  • Managing project dependencies

When NOT To Use

更多技能請訪問小蔥技能站7w4.net。

  • Testing packages - use python-testing instead
  • Optimizing package performance - use python-performance
  • Testing packages - use python-testing instead
  • Optimizing package performance - use python-performance

Core Decisions

1. Layout Choice

# 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

2. Project 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.

Detailed Topics

See modules for detailed information:

Best Practices

  1. Use source layout for anything beyond simple packages
  2. Pin direct dependencies with minimum versions
  3. Use optional dependency groups for dev/docs/test
  4. Include py.typed for type hint support
  5. Add detailed README with usage examples
  6. Use semantic versioning (MAJOR.MINOR.PATCH)
  7. Test on multiple Python versions before publishing

Exit Criteria

  • Modern pyproject.toml configuration
  • Clear dependency specification
  • Proper version management
  • Tests included and passing
  • Build process reproducible
  • Publishing pipeline automated

🤖 AI 評測

這是一個相當實用的 Python 打包技能,涵蓋專案建立、依賴管理、釋出等關鍵環節,示例清晰易懂,能幫助開發者快速上手。文件質量整體不錯,但有些小瑕疵需要注意:部分內容存在重複或格式小問題,版本號標註也不夠統一。雖然不影響核心使用,但對於追求嚴謹的使用者來說略顯遺憾。總體瑕不掩瑜,是值得參考的好資源。

📊 多維度評分

適應性4.1
規範性4.6
有效性4.6
可靠性4.5
可信度4.4

📁 包含檔案 (7 個)

📄 SKILL.md 4.1 KB
📄 _meta.json 152 B
📄 modules/ci-cd-integration.md 2.1 KB
📄 modules/entry-points.md 1.7 KB
📄 modules/pyproject-patterns.md 2.9 KB
📄 modules/uv-workflow.md 1.4 KB
📄 skill-card.md 2.3 KB