legout/skills

modern-python

Configures Python projects with modern tooling (uv, ruff, ty).

Quelltext ansehen

Verwendung

  1. Installationsbefehl kopieren und das Quellpaket vor der Installation in der eigenen Agentenumgebung prüfen.
  2. Benötigte Werkzeuge, Zugangsdaten und Hosts im Original prüfen.
  3. Eingabe und gewünschtes Ergebnis beschreiben und die Ausgabe mit den Quellen abgleichen.
npx skills add https://github.com/legout/skills --skill modern-python

Vor dem Start

  • Die Installation umfasst weder Modellabo noch API-Kontingent oder Dateizugriffsrechte.
  • Sterne und Installationen zeigen Aktivität, keine unabhängige Qualitäts- oder Sicherheitsprüfung.
Originales Skill-Dokument

Aus dem Quell-Repository gerendert; Überschriften, Beispiele, Code, Tabellen, Links und Bilder bleiben erhalten.

Modern Python

Before changing a project, read its instructions and current configuration, preserve supported Python versions, and run installed CLI help. Do not replace a working toolchain unless the user requests migration and the replacement reaches validation parity.

Route

Defaults for new work

  • Manage dependencies with uv add, uv remove, and uv sync; run commands with uv run.
  • Use dependency groups for development tools.
  • Use Ruff for lint and format, ty for type checks, and pytest for tests unless project constraints require otherwise.
  • Prefer uv_build for ordinary new packages.
  • Never manually activate or manage a virtualenv.

Minimal project

bash
uv init myproject
cd myproject
uv add requests
uv add --group dev pytest ruff ty
uv run ruff check .
uv run ty check
uv run pytest

For repository documentation, follow its existing system. If it uses Zensical, validate with uv run zensical build; use uv run zensical serve only for interactive preview.

Verification

Run the project's existing checks plus Ruff, ty, and tests when configured. During migration, compare old and new validation results before deleting legacy configuration. Hand versioning or publication to make-release.

Source

Adapted under CC-BY-SA-4.0 from Trail of Bits' `modern-python` package, pinned to commit d3323cefbcf645678b8dc481de204b02ad3d02dc. See sources.json and THIRD_PARTY_NOTICES.md.

aus demselben Repository

Weitere Skills

Alle Skills