Skip to content

Ruff, ty and pytest run from one repo-level Python project #204

Open

Description

@ooloth

Current state

Every Python file in the repo gets its tools a different way, so there is no single place that says which versions of ruff, ty and pytest the repo uses. ruff and ty run through uv run --with at versions pinned in scripts/checks/versions.bash, each test file is its own uv script with inline dependencies, and the skills' tests run through a separate uv run --with pytest --with hypothesis --with pydantic. There is no pyproject.toml or uv.lock. tools/bats/Brewfile still installs bats, though no test uses it.

Ideal state

  • A pyproject.toml and uv.lock at the repo root hold ruff, ty and pytest and their settings, and nothing else pins their versions
  • check and CI run ruff, ty and pytest from that project, and still fail when any of them finds a problem
  • Every existing test, including the skills' tests, runs under pytest from that project and still passes
  • tools/bats/ is archived in tools/@archive/

Decisions

Constraints

Open

No open decisions.

Starting points

  • scripts/checks/versions.bash: where ruff and ty are pinned today
  • scripts/checks/tests.bash: how tests are found and run, one uv script at a time
  • ruff.toml: the lint and format settings the project takes over

Activity

  1. ooloth commented on Oct 30, 2026

    @ooloth
    OwnerAuthor

    The design for this issue stopped on 2026-10-29 before it was finished. uv run --locked fails on any machine whose uv is set to a different package index, as the work laptop's is, so the command that starts the repo's Python and how uv.lock is shared between machines are open again in what-command-starts-the-repos-python.md. The design resumes once the work laptop check in that file has been run. What it had measured is in that file's findings, including that one pytest run from the project runs every existing test with the same number of tests per file.

  2. added
    maintenanceUpkeep that changes how the repo is built, not what it does
    on Oct 30, 2026
  3. ooloth commented on Oct 30, 2026

    @ooloth
    OwnerAuthor

    The project this issue sets up will need a minimum uv version. Since 4550de80, scripts/checks/tests.bash passes each test file to uv run --with-requirements, and uv reads a script's inline header that way only from 0.8.16 on (changelog, under 0.8.16).

    Nothing enforces that today. CI's astral-sh/setup-uv@v6 installs the latest uv, and Amp orbs use whichever uv the image ships. I haven't checked what an older uv prints for a .py file passed this way.

  4. ooloth commented on Nov 2, 2026

    @ooloth
    OwnerAuthor

    The work laptop check in what-command-starts-the-repos-python.md has been run, and a shared uv.lock is possible again. The design can resume.

    • The work laptop can reach PyPI. Its managed uv config names a different index, but the network allows PyPI, and that config is only a user-level uv.toml, with no UV_* variables or system-level file.
    • Both ways of sharing a lock work there. uv run --frozen on a lock made against PyPI installs from the PyPI URLs the lock records. With PyPI named as the project's index in pyproject.toml, uv lock and uv run --locked both work with the managed config active, because a project setting outranks a user-level one.
    • The work laptop may use PyPI for this repo. This repo depends only on public packages, so it has no internal package name that a public one could collide with.

    What's still open is the command that starts the repo's Python, and which of the two lock options it uses. Committing no uv.lock is no longer needed, so decision 008 stands.

  5. ooloth commented on Nov 8, 2026

    @ooloth
    OwnerAuthor

    CI's uv no longer floats. #255 moved .github/workflows/check.yml to astral-sh/setup-uv v10.3.3 with version: latest-known, so CI now installs the newest uv whose checksum is built into the pinned action (0.13.6 today), and it changes only when Dependabot bumps that pin. That meets the 0.8.16 floor in the comment above, though nothing states it as a minimum. Amp orbs still use whichever uv the image ships.

    This affects the design here. Once the root pyproject.toml sets [tool.uv] required-version, setup-uv will not read it to choose CI's uv, because an explicit version input wins. The design needs to pick one:

    • (a) Keep version: latest-known and treat required-version as a floor. uv exits with an error when its own version fails required-version, so CI would fail loudly if the pinned action ever fell below it.
    • (b) Drop version: from check.yml so CI's uv follows required-version. Unless required-version is an exact pin, that brings back CI taking each new uv release the day it ships.
  6. ooloth commented on Nov 17, 2026

    @ooloth
    OwnerAuthor

    Evidence from one unattended run on #237: uv run pytest <file> failed with Failed to spawn: pytest in 11 agent transcripts, and three planning agents rebuilt the test command from the prose in CONTRIBUTING.md. With the root project in place, uv run pytest <file> is the command agents reach for first, and it would work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    maintenanceUpkeep that changes how the repo is built, not what it does

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions