python-packaging
Build and publish Python packages with PyPI
Également disponible depuis: wshobson,ActiveInferenceInstitute
Python developers struggle with complex packaging workflows and inconsistent project structures. This skill provides complete guidance for creating professional Python packages using modern standards like pyproject.toml and setuptools.
Télécharger le ZIP du skill
Importer dans Claude
Allez dans Paramètres → Capacités → Skills → Importer un skill
Activez et commencez à utiliser
Tester
Utilisation de "python-packaging". Create a pyproject.toml for a package named 'data-utils' with Click and pandas dependencies, pytest for dev, and a CLI entry point
Résultat attendu:
A complete pyproject.toml with build-system configuration, project metadata, dependencies with version constraints, optional dev dependencies, CLI script entry points, and tool configurations for black, ruff, and pytest.
Utilisation de "python-packaging". How do I publish my package to TestPyPI first?
Résultat attendu:
Step-by-step instructions: (1) Install twine, (2) Build package with python -m build, (3) Validate with twine check, (4) Upload to TestPyPI with twine upload --repository testpypi, (5) Test installation from TestPyPI, (6) Publish to production PyPI when ready.
Audit de sécurité
Risque faibleThis skill consists entirely of markdown documentation teaching Python packaging best practices. Static analyzer flagged 118 patterns (backticks, URLs, config examples) that are documentation content, not executable code. All findings are false positives from code examples in fenced markdown blocks. No actual security risks detected.
Problèmes à risque moyen (1)
Problèmes à risque faible (2)
Facteurs de risque
⚙️ Commandes externes (4)
🌐 Accès réseau (3)
📁 Accès au système de fichiers (1)
Score de qualité
Ce que vous pouvez construire
Library Author Publishing
Create a new Python library for distribution on PyPI with proper project structure, metadata, and automated publishing workflows.
CLI Tool Distribution
Package command-line tools with entry points, making them easily installable via pip with executable commands.
Enterprise Package Management
Set up private package indexes and namespace packages for organizing code across multiple teams and repositories.
Essayez ces prompts
Help me create a new Python package called 'my-tool' with a src layout, pyproject.toml using setuptools, and a basic module structure. I want to include pytest for testing.
I have an existing Python package with utility functions. Show me how to add CLI entry points using Click so users can run 'mytool' from the command line after installation.
Create a GitHub Actions workflow that builds and publishes my Python package to PyPI when I create a new release. Include package validation and TestPyPI testing steps.
I need to split my company's codebase into multiple packages (company-core, company-api, company-utils) that share a namespace. Show me the complete project structure and pyproject.toml configurations.
Bonnes pratiques
- Use src/ layout to prevent accidental imports from uninstalled source directory
- Define all metadata in pyproject.toml following PEP 621 for modern packaging
- Test package installation in a clean virtual environment before publishing to PyPI
Éviter
- Do not use setup.py as primary configuration - migrate to pyproject.toml
- Avoid flat layout for libraries as it allows importing without installation
- Never commit API tokens or credentials - use environment variables for PyPI authentication