astral-sh/ruff · error

Dependency installation failed: {}

Error message

Dependency installation failed: {}

What it means

The benchmark harness pins dependency freshness with `uv pip install --exclude-newer <date>` into the cached venv; a nonzero exit raises this error with uv's stderr. Failures come from resolution (unresolvable or yanked deps), the date constraint, or the network.

Source

Thrown at crates/ruff_benchmark/src/real_world_projects.rs:314

    }

    // Install dependencies with date constraint in the isolated environment
    let mut cmd = Command::new("uv");
    cmd.args([
        "pip",
        "install",
        "--python",
        venv_path.to_str().unwrap(),
        "--exclude-newer",
        max_dep_date,
    ])
    .args(dependencies);

    let output = cmd
        .output()
        .context("Failed to execute uv pip install command")?;

    anyhow::ensure!(
        output.status.success(),
        "Dependency installation failed: {}",
        String::from_utf8_lossy(&output.stderr)
    );

    Ok(())
}

/// Install dependencies using uv with date constraints
fn install_dependencies(checkout: &Checkout) -> Result<()> {
    let venv_path = checkout.venv_path();
    let project = checkout.project();
    install_dependencies_to_cache(
        project.name,
        project.dependencies,
        &venv_path,
        project.python_version,
        project.max_dep_date,

View on GitHub (pinned to 672bb4edf0)

Solutions

  1. Read the embedded stderr: resolver errors name the exact package and constraint
  2. Check network/proxy access to PyPI and retry; uv downloads are cached, partial caches can be cleared with `uv cache clean`
  3. Verify max_dep_date is a valid date for uv (YYYY-MM-DD or RFC 3339) and the dependency specifiers are valid requirement strings
  4. If an upstream package broke the pin, update the benchmark's dependency list or date

Example fix

# before
 bench run fails: Dependency installation failed: error: Request to PyPI failed ...

# after
uv cache clean && cargo bench --bench <real-world-bench>
Defensive patterns

Strategy: retry

Validate before calling

date -u -d "$max_dep_date" '+%Y-%m-%d' >/dev/null 2>&1 || {
  echo "max_dep_date '$max_dep_date' is not a valid date" >&2
  exit 1
}
cargo bench --bench "$bench"

Try / catch

for i in 1 2 3; do
  cargo bench --bench "$bench" && break
  echo "dependency install attempt $i failed; clearing uv cache" >&2
  uv cache clean
done

Prevention

When it happens

Trigger: An unreachable PyPI (network/proxy), a dependency that no longer resolves under the pinned max_dep_date, or a malformed date value for --exclude-newer.

Common situations: Proxied or offline CI; upstream deleting/yanking a version that the date-constrained resolver needs; edits to the benchmark dependency table introducing bad names or dates.

Related errors


AI-assisted analysis of astral-sh/ruff@672bb4edf0 (2026-08-16). Data as JSON: /api/errors/c8414c317a07448b. Report an issue: GitHub.