fleetlint Policy for a fleet of repositories
v0.11 (latest)
Getting started

deps/locked-install/python

Installs use the lockfile strictly

Implements deps/locked-install for python.

Severitywarning
Tiers1, 2
Stackspython
Scopeeach
Kindexpr
Sourcelibrary v0.8.0
Selected byfleetlint-recommended@v0.8.0

Requirement

A recipe or CI step installs or verifies with the lockfile enforced: uv sync --locked (or --frozen, or UV_LOCKED set in the workflow), uv lock --check, uv pip sync, poetry install / poetry sync (which refuse a stale poetry.lock), pip install --require-hashes, pip-sync, pdm sync or pdm install --frozen-lockfile, pipenv sync or pipenv install --deploy. No recipe or CI step runs a plain uv sync without those.

Why

An install that quietly re-resolves builds and tests something other than what the lockfile in git says, and the drift shows up only in production.

Check

((taskrunner.recipes.filter(t, !t.matches(r'(?i)update|upgrade|lock|bump|renovate')).map(t, taskrunner.recipes[t]).flatten()
    + params.runners.filter(f, file(f)).map(f, lines(f)).flatten()
    + workflows().map(w, steps(w).map(s, s.run.split("\n")).flatten()).flatten())
    .filter(l, !l.matches(params.noise)).exists(l, l.matches(r'\buv\s+(sync|run|export)\b[^;&|]*--(locked|frozen)\b|\buv\s+lock\b[^;&|]*--(check|locked)\b|\buv\s+pip\s+sync\b|\bpoetry\s+(install|sync|check\s+--lock)\b|--require-hashes\b|\bpip-sync\b|\bpdm\s+(sync|install\b[^;&|]*--(frozen-lockfile|check))\b|\bpipenv\s+(sync|verify|install\b[^;&|]*--deploy)\b'))
 || workflows().exists(w, text(w).matches(r'\bUV_(LOCKED|FROZEN):\s*["\x27]?(1|true)')))
&& !(taskrunner.recipes.filter(t, !t.matches(r'(?i)update|upgrade|lock|bump|renovate')).map(t, taskrunner.recipes[t]).flatten()
    + workflows().map(w, steps(w).map(s, s.run.split("\n")).flatten()).flatten())
    .filter(l, !l.matches(params.noise)).exists(l, l.matches(r'\buv\s+sync\b') && !l.matches(r'--(locked|frozen)\b') && !(taskrunner.file != "" && text(taskrunner.file).matches(r'UV_(LOCKED|FROZEN)'))
     && !workflows().exists(w, text(w).matches(r'\bUV_(LOCKED|FROZEN):')))

Parameters

  • noise: ^\s*[@+-]*\s*(\{\{[^}]*\}\}\s*|\$[({][A-Za-z_]+[)}]\s*)?(#|//|echo\b|printf\b)
  • runners: [../Makefile ../justfile ../Justfile ../Taskfile.yml ../Taskfile.yaml ../../Makefile ../../justfile ../../Justfile ../../Taskfile.yml ../../Taskfile.yaml ../../../Makefile ../../../justfile ../../../Justfile ../../../Taskfile.yml ../../../Taskfile.yaml]

Fix

Use uv sync --locked in CI and the check targets.

Agent instruction (from deps/locked-install): Switch the CI and task-runner installs to the package manager’s locked mode; if that fails, regenerate the lockfile in a separate commit rather than relaxing the install.

Sources


Generated by fleetlint docs from catalog v0.8.0.