Skip to content

Ruff fails to find itself when installed into an ephemeral venv #23402

@elprans

Description

@elprans

Summary

Easily reproducible:

uv run --isolated --no-project --with=ruff==0.15.1 lint.py

lint.py

import pathlib
import sys
import subprocess

import ruff

for p in sys.path:
    pp = pathlib.Path(p)
    if pp.name == "site-packages":
        bin = pp / ".." / ".." / ".." / "bin"
        maybe_ruff = bin / "ruff"
        if maybe_ruff.is_file():
            print(f"FOUND ruff in {bin}")
        else:
            print(f"no ruff in {bin}")

subprocess.run([sys.executable, "-m", "ruff", "--version"])

Output:

  File "/Users/elvis/.cache/uv/archive-v0/H-OMqLHQrNOQwwJfzdI0Q/lib/python3.14/site-packages/ruff/__main__.py", line 77, in find_ruff_bin
    raise FileNotFoundError(scripts_path)
FileNotFoundError: /Users/elvis/.cache/uv/builds-v0/.tmpK7qO4Q/bin/ruff

Notably, ruff binary is in the archive-v0 overlay, but ruff's find_ruff_bin does not seem to be looking there. Note: this is possibly a uv bug.

Version

uv 0.10.4 (079e3fd05 2026-02-17) / ruff 0.15.1 (a2f11d2 2026-02-12)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions