chore(dev): move the dev tools from .venv to .venv-dev #516

Closed
opened 2026-12-04 20:20:01 +00:00 by Claude · 0 comments
Owner

Part of #499

Problem

scripts/dev-setup.sh installs the contributor tools (pre-commit, ansible-lint and the rest of requirements-dev.lock) into .venv. apm will be pinned with uv, and uv uses .venv as its project environment: uv sync --frozen removes every package that is not in uv.lock, so it would remove the tools the git hooks need. The dev tools need their own directory first.

Out of scope: adding pyproject.toml or uv.lock, and changing any tool version.

Proposal

  • scripts/dev-setup.sh creates and uses .venv-dev, and the git hooks put .venv-dev/bin first on PATH.
  • Re-running the script in a clone that was set up earlier switches its hooks to .venv-dev. It leaves an existing .venv alone.
  • Everything that ignores or skips .venv also covers .venv-dev, and keeps covering .venv, which uv will use. Find the places with git grep -nF .venv.
  • Messages and docs that tell a contributor where the tools are name .venv-dev.
  • Leave the comments in requirements-dev.txt and images/ci/Dockerfile as they are. Both are inputs of the ci image, and the ticket that pins apm with uv changes that image anyway.

Acceptance criteria

  • In a fresh clone, scripts/dev-setup.sh creates .venv-dev and no .venv, and pre-commit run --all-files passes with the tools from .venv-dev/bin.
  • In a clone set up before this change, re-running scripts/dev-setup.sh makes the git hooks use .venv-dev/bin and no longer .venv/bin. A test in tests/scripts/test_dev_setup.py covers it.
  • With both directories present, git status is clean and the Collection tarball contains neither (scripts/check_tarball.py passes on a build).
  • python3 -m unittest discover -s tests/scripts passes.
  • docs/contributing/setup.md names .venv-dev.
Part of #499 ## Problem `scripts/dev-setup.sh` installs the contributor tools (pre-commit, ansible-lint and the rest of `requirements-dev.lock`) into `.venv`. apm will be pinned with uv, and uv uses `.venv` as its project environment: `uv sync --frozen` removes every package that is not in `uv.lock`, so it would remove the tools the git hooks need. The dev tools need their own directory first. Out of scope: adding `pyproject.toml` or `uv.lock`, and changing any tool version. ## Proposal - `scripts/dev-setup.sh` creates and uses `.venv-dev`, and the git hooks put `.venv-dev/bin` first on `PATH`. - Re-running the script in a clone that was set up earlier switches its hooks to `.venv-dev`. It leaves an existing `.venv` alone. - Everything that ignores or skips `.venv` also covers `.venv-dev`, and keeps covering `.venv`, which uv will use. Find the places with `git grep -nF .venv`. - Messages and docs that tell a contributor where the tools are name `.venv-dev`. - Leave the comments in `requirements-dev.txt` and `images/ci/Dockerfile` as they are. Both are inputs of the `ci` image, and the ticket that pins apm with uv changes that image anyway. ## Acceptance criteria - [ ] In a fresh clone, `scripts/dev-setup.sh` creates `.venv-dev` and no `.venv`, and `pre-commit run --all-files` passes with the tools from `.venv-dev/bin`. - [ ] In a clone set up before this change, re-running `scripts/dev-setup.sh` makes the git hooks use `.venv-dev/bin` and no longer `.venv/bin`. A test in `tests/scripts/test_dev_setup.py` covers it. - [ ] With both directories present, `git status` is clean and the Collection tarball contains neither (`scripts/check_tarball.py` passes on a build). - [ ] `python3 -m unittest discover -s tests/scripts` passes. - [ ] `docs/contributing/setup.md` names `.venv-dev`.
Claude added the Kind/Enhancement
Status
Ready for Agent
labels 2026-12-04 20:20:01 +00:00
Claude added a new dependency 2026-12-04 20:20:06 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Reference: Mortis/Kamino#516