modern-python

Solid

Configures Python projects with modern tooling (uv, ruff, ty). Use when creating projects, writing standalone scripts, or migrating from pip/Poetry/mypy/black.

Data & Documents 8,273 stars 715 forks Updated 6 days ago CC-BY-SA-4.0

Install

View on GitHub

Quality Score: 90/100

Stars 20%
100
Recency 20%
100
Frontmatter 20%
70
Documentation 15%
100
Issue Health 10%
50
License 10%
100
Description 5%
100

Skill Content

# Modern Python Guide for modern Python tooling and best practices, based on [trailofbits/cookiecutter-python](https://github.com/trailofbits/cookiecutter-python). ## When to Use This Skill - Creating a new Python project or package - Setting up `pyproject.toml` configuration - Configuring development tools (linting, formatting, testing) - Writing Python scripts with external dependencies - Migrating from legacy tools (when user requests it) ## When NOT to Use This Skill - **User wants to keep legacy tooling**: Respect existing workflows if explicitly requested - **Python < 3.11 required**: These tools target modern Python - **Non-Python projects**: Mixed codebases where Python isn't primary ## Anti-Patterns to Avoid | Avoid | Use Instead | |-------|-------------| | `[tool.ty]` python-version | `[tool.ty.environment]` python-version | | `uv pip install` | `uv add` and `uv sync` | | Editing pyproject.toml manually to add deps | `uv add <pkg>` / `uv remove <pkg>` | | `hatchling` build backend | `uv_build` (simpler, sufficient for most cases) | | Poetry | uv (faster, simpler, better ecosystem integration) | | requirements.txt | PEP 723 for scripts, pyproject.toml for projects | | mypy / pyright | ty (faster, from Astral team) | | `[project.optional-dependencies]` for dev tools | `[dependency-groups]` (PEP 735) | | Manual virtualenv activation (`source .venv/bin/activate`) | `uv run <cmd>` | | pre-commit | prek (faster, no Python runtime needed) | **Key principles:** - Al...

Details

Author
trailofbits
Repository
trailofbits/skills
Created
10 months ago
Last Updated
6 days ago
Language
Python
License
CC-BY-SA-4.0

Similar Skills

Semantically similar based on skill content — not just same category

AI & Automation Listed

python-engineering

Modern Python engineering standards and best practices. Use this skill whenever a user wants to: scaffold a Python project, configure tooling (uv, ruff, ty, mypy, structlog, pytest, hypothesis, pydantic-settings, opentelemetry, pip-audit), set up pyproject.toml, src-layout, pre-commit, CI/CD, Docker — for an existing, inherited, or legacy project as much as a greenfield one (assessing and modernizing current setup, not just scaffolding new) — or asks about Python architecture, packaging, testing, type checking, observability, security, async patterns, typing.Protocol, dependency injection, CLAUDE.md, or Cursor rules. Covers hexagonal architecture, functional core/imperative shell, property-based testing, snapshot testing, testcontainers, Trusted Publishers, and Sigstore.

2 Updated today
grimaldost
AI & Automation Listed

loom-python

Python language expertise for idiomatic, production-quality code.

66 Updated today
cosmix
AI & Automation Listed

python-best-practices

Writes, reviews and scaffolds modern Python (3.14 and newer): strict type hints with PEP 695 generics, uv projects with pyproject.toml and a src layout, ruff lint and format, mypy or pyright in strict mode, dataclasses versus Pydantic v2, asyncio with TaskGroup and timeouts, and pytest with fixtures and parametrize. Use when writing or reviewing a .py file, starting a Python project or package, choosing between a dataclass and a Pydantic model, configuring ruff, mypy, pyright or pytest, or fixing blocking calls in async code. Not for Python Dockerfiles (docker-kubernetes), CI workflows (ci-cd-pipelines), SQLAlchemy schema design (database-design) or other languages.

1 Updated 2 days ago
mahdy-gribkov