python-packaging
БесплатноБез исполняемых скриптовНе проверенConfigure Python package metadata, setup.py, and pyproject.toml for distribution using UV or setuptools. Use when setting up Python packages, configuring…
от armanzeroeight★ 30 звёзд на GitHubОб этом скилле
Python Packaging
Configure Python package metadata and build configuration for distribution.
Quick Start
Create pyproject.toml with UV or setuptools configuration for package distribution.
Instructions
Choosing Build System
Use UV with pyproject.toml (recommended) when:
- Starting new projects
- Want fast, modern tooling
- Need dependency management + packaging
- Building libraries for PyPI
- Want PEP 621 compliance
Use setuptools (pyproject.toml + setup.py) when:
- Maintaining existing projects
- Need compatibility with older tools
- Require custom build steps
- Complex C extensions
Use setuptools (pyproject.toml only) when:
- Modern setuptools-only approach
- No custom build logic
- Want declarative configuration
- PEP 621 compliance
UV Configuration (Recommended)
Create pyproject.toml with UV (PEP 621 standard):
[project]
name = "my-package"
version = "0.1.0"
description = "Package description"
readme = "README.md"
requires-python = ">=3.9"
license = {text = "MIT"}
authors = [
{name = "Your Name", email = "[email protected]"}
]
keywords = ["keyword1", "keyword2"]
classifiers = [
"Development Status :: 3 - Alpha",
"Intended Audience :: Developers",
"License :: OSI Approved :: MIT License",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
]
dependencies = [
"requests>=2.28.0",
]
[project.optional-dependencies]
dev = [
"pytest>=7.0.0",
"black>=23.0.0",
"mypy>=1.0.0",
]
[project.scripts]
my-cli = "my_package.cli:main"
[project.urls]
Homepage = "https://github.com/username/my-package"
Repository = "https://github.com/username/my-package"
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"
Key fields:
name: Package name (use hyphens, will be converted to underscores for import)version: Semantic versioning (MAJOR.MINOR.PATCH)requires-python: Python version constraintdependencies: Runtime dependencies with version constraintsoptional-dependencies: Development and optional dependenciesscripts: Console script entry points
Version constraints:
>=2.28.0,<3.0.0: Compatible versions~=2.28.0: >=2.28.0, <2.29.0 (patch updates)>=2.28.0: Minimum version==2.28.0: Exact version
Setuptools Configuration (Modern)
Create pyproject.toml with setuptools (PEP 621):
[build-system]
requires = ["setuptools>=61.0", "wheel"]
build-backend = "setuptools.build_meta"
[project]
name = "my-package"
version = "0.1.0"
description = "Package description"
readme = "README.md"
requires-python = ">=3.9"
license = {text = "MIT"}
authors = [
{name = "Your Name", email = "[email protected]"}
]
keywords = ["keyword1", "keyword2"]
classifiers = [
"Development Status :: 3 - Alpha",
"Intended Audience :: Developers",
"License :: OSI Approved :: MIT License",
"Programming Language :: Python :: 3",
]
dependencies = [
"requests>=2.28.0",
]
[project.optional-dependencies]
dev = [
"pytest>=7.0.0",
"black>=23.0.0",
"mypy>=1.0.0",
]
[project.scripts]
my-cli = "my_package.cli:main"
[project.urls]
Homepage = "https://github.com/username/my-package"
Repository = "https://github.com/username/my-package"
Setuptools Configuration (Legacy)
Create setup.py for projects requiring custom build logic:
from setuptools import setup, find_packages
setup(
name="my-package",
version="0.1.0",
description="Package description",
long_description=open("README.md").read(),
long_description_content_type="text/markdown",
author="Your Name",
author_email="[email protected]",
url="https://github.com/username/my-package",
packages=find_packages(where="src"),
package_dir={"": "src"},
python_requires=">=3.9",
install_requires=[
"requests>=2.28.0",
],
extras_require={
"dev": [
"pytest>=7.0.0",
"black>=23.0.0",
"mypy>=1.0.0",
],
},
entry_points={
"console_scripts": [
"my-cli=my_package.cli:main",
],
},
classifiers=[
"Development Status :: 3 - Alpha",
"Intended Audience :: Developers",
"License :: OSI Approved :: MIT License",
"Programming Language :: Python :: 3",
],
)
When to use setup.py:
- Custom build steps (compiling C extensions)
- Dynamic version from git tags
- Complex package discovery
- Conditional dependencies
Package Structure
Flat layout:
my-package/
├── my_package/
│ ├── __init__.py
│ └── module.py
├── tests/
├── pyproject.toml
└── README.md
Src layout (recommended for libraries):
my-package/
├── src/
│ └── my_package/
│ ├── __init__.py
│ └── module.py
├── tests/
├── pyproject.toml
└── README.md
For src layout, configure package discovery:
**UV/Hatchling (
Установить python-packaging в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
FAQ
Что делает скилл python-packaging?
Configure Python package metadata, setup.py, and pyproject.toml for distribution using UV or setuptools. Use when setting up Python packages, configuring build systems, or preparing projects for PyPI publication.
Как установить скилл python-packaging?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл python-packaging запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
theme-factory
Toolkit for styling artifacts with a theme. These artifacts can be slides, docs, reportings, HTML landing pages, etc. There are 10 pre-set themes with…
от Anthropicaccess
Manage Discord channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…
от Anthropicconfigure
Set up the Discord channel — save the bot token and review access policy. Use when the user pastes a Discord bot token, asks to configure Discord, asks "how…
от Anthropicaccess
Manage iMessage channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…
от Anthropic