Skip to content

Honor uv-managed project venvs in setup and check #896

@codeforester

Description

@codeforester

Problem

Base now supports uv-managed projects through explicit python.manager: uv and command-level runner: uv, but the setup / check project artifact path still requires the historical Base-managed project virtualenv at:

~/.base.d/<project>/.venv

That conflicts with the uv support contract, where uv-managed projects should use the project-local environment:

<project-root>/.venv

Current behavior

A fresh uv-managed project with:

python:
  manager: uv

test:
  command: pytest
  runner: uv

and with pyproject.toml / uv.lock present can be resolved by basectl test --dry-run and basectl run --list, which correctly show uv run -- ....

However, basectl check --manifest <path> fails before uv diagnostics with:

BASE-P050 project_virtualenv: Virtual environment is missing at '~/.base.d/<project>/.venv'

basectl setup --manifest <path> --dry-run also plans to create ~/.base.d/<project>/.venv and install bootstrap packages before reaching the uv setup path.

Desired behavior

When a manifest declares python.manager: uv:

  • basectl check and basectl doctor should use the uv project venv contract before applying the historical Base project-venv health gate.
  • basectl setup should not create or require ~/.base.d/<project>/.venv solely to support a uv-managed project.
  • uv diagnostics (BASE-P150 through BASE-P153) should still run and report missing uv, missing pyproject.toml, missing uv.lock, and stale historical Base venvs.
  • Existing non-uv projects should keep the current Base-managed project venv behavior.
  • Existing project command behavior for runner: uv should remain unchanged.

Scope

  • Teach the Bash setup/check/doctor preflight path to detect python.manager: uv from the resolved manifest.
  • Route uv-managed project venv checks to <project-root>/.venv unless BASE_PROJECT_VENV_DIR is explicitly set.
  • Avoid the project bootstrap artifact path for uv-managed projects when it only exists to seed the historical Base project venv.
  • Keep the Python base_setup uv diagnostics and artifact filtering behavior intact.

Acceptance criteria

  • A fresh uv-managed project with pyproject.toml and uv.lock, but no ~/.base.d/<project>/.venv, can reach uv diagnostics through basectl check --manifest <path>.
  • basectl setup --manifest <path> --dry-run for a uv-managed project shows uv sync and does not plan to create ~/.base.d/<project>/.venv.
  • A uv-managed project with no project-local .venv reports the uv-oriented setup guidance rather than --recreate-venv guidance for the historical Base venv.
  • Non-uv project setup/check behavior remains unchanged.
  • Tests cover fresh uv project setup/check, non-uv project setup/check, stale Base venv diagnostics, and command runner behavior.

Validation

  • Focused BATS coverage for basectl setup / check uv manifest behavior.
  • Focused Python tests for any manifest/diagnostic helpers touched.
  • env -u BASE_HOME ./bin/base-test
  • git diff --check

Metadata

Metadata

Assignees

Labels

bugSomething is not working

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions