python-packaging
БесплатноЗапускает вложенные скриптыНе проверенCreate and publish distributable scientific Python packages following Scientific Python community best practices. Covers pyproject.toml, src layout…
Об этом скилле
Scientific Python Packaging
Package Structure
my-sci-package/
├── pyproject.toml
├── README.md
├── LICENSE
├── src/
│ └── my_sci_package/
│ ├── __init__.py
│ └── analysis.py
└── tests/
└── test_analysis.py
Use src/ layout — prevents accidental import of uninstalled code, required for Hatchling auto-discovery.
Minimal pyproject.toml
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"
[project]
name = "my-sci-package"
version = "0.1.0"
description = "A scientific Python package"
readme = "README.md"
license = "BSD-3-Clause"
requires-python = ">=3.9"
authors = [
{name = "Your Name", email = "[email protected]"},
]
dependencies = [
"numpy>=1.20",
"scipy>=1.7",
]
[project.urls]
Homepage = "https://github.com/username/my-sci-package"
[dependency-groups]
dev = ["pytest>=7.0", "ruff>=0.1", "mypy>=1.0"]
Full template with classifiers, optional deps, and CI config: assets/pyproject-minimal.toml and assets/pyproject-full-featured.toml.
CLI Entry Point
[project.scripts]
sci-analyze = "my_sci_package.cli:main"
See scripts/cli-example.py for a Click-based CLI implementation.
Publishing Workflow
# 1. Build
python -m build
# 2. Check metadata and distribution
twine check dist/*
# If check fails: fix metadata in [project] section of pyproject.toml and rebuild
# 3. Test on TestPyPI
twine upload --repository testpypi dist/*
pip install --index-url https://test.pypi.org/simple/ <my-sci-package>
# If install fails: check package name availability, verify dist/ contents with tar -tvf dist/*.tar.gz
# 4. Publish to PyPI
twine upload dist/*
For automated publishing on GitHub release: assets/github-actions-publish.yml (uses OIDC Trusted Publishers — no stored tokens needed).
Key Rules
- Use
src/layout — nosetup.py,setup.cfg, orMANIFEST.in - Use Hatchling as build backend (Scientific Python recommendation)
- Set
requires-pythonwith minimum only — no upper cap - Use
>=for dependency lower bounds — avoid upper caps unless absolutely necessary - Test on TestPyPI before production publish
- Verify SDist contents:
tar -tvf dist/*.tar.gz
Pre-Publish Checklist
-
python -m buildsucceeds -
twine check dist/*passes - Installed from wheel in clean virtualenv and imports correctly
-
requires-pythonand dependency versions are correct -
LICENSEfile present;licensefield uses SPDX identifier -
project.urlsincludes repository link
References
- Dependency version constraints, classifiers, optional extras: references/metadata.md
- Package structure patterns, versioning strategies: references/patterns.md
- NumPy-style docstrings: references/docstrings.md
- Import errors, missing files, dependency conflicts: references/common-issues.md
- Scientific Python guidelines: https://learn.scientific-python.org/development/guides/packaging-simple/
Установить python-packaging в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
FAQ
Что делает скилл python-packaging?
Create and publish distributable scientific Python packages following Scientific Python community best practices. Covers pyproject.toml, src layout, Hatchling, metadata, CLI entry points, and PyPI publishing. Use when the user wants to create a new Python package, set up pyproject.toml, configure Hatchling, publish to PyPI, or follow Scientific Python packaging standards.
Как установить скилл python-packaging?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл python-packaging запускает скрипты?
Да, скилл несёт исполняемые скрипты. Проверь исходник перед установкой.
Похожие скиллы
frontend-design
Guidance for distinctive, intentional visual design when building new UI or reshaping an existing one. Helps with aesthetic direction, typography, and making…
от Anthropicwebapp-testing
Toolkit for interacting with and testing local web applications using Playwright. Supports verifying frontend functionality, debugging UI behavior, capturing…
от Anthropicbrand-guidelines
Applies Anthropic's official brand colors and typography to any sort of artifact that may benefit from having Anthropic's look-and-feel. Use it when brand…
от Anthropicweb-artifacts-builder
Suite of tools for creating elaborate, multi-component claude.ai HTML artifacts using modern frontend web technologies (React, Tailwind CSS, shadcn/ui). Use…
от Anthropic