mirror of
https://github.com/home-assistant/core.git
synced 2026-12-02 11:33:11 -04:00
Make agents give each git worktree its own venv (#195846)
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
This commit is contained in:
co-authored by
Martin Hjelmare
parent
7448ca656c
commit
80c9e3b4da
@@ -26,7 +26,7 @@ This repository contains the core of Home Assistant, a Python 3 based home autom
|
||||
## Development Commands
|
||||
|
||||
- Run "python3" in current virtual environment to ensure the correct Python version is used for testing.
|
||||
- When entering a new environment or worktree, run `script/setup` to set up the virtual environment with all development dependencies (pylint, pre-commit hooks, etc.). This is required before committing. If uv reports that no download was found for the required Python version, the environment is running an outdated version of uv; upgrade it with `curl -LsSf https://astral.sh/uv/install.sh | sh` and run `script/setup` again.
|
||||
- When entering a new environment or worktree, run `script/setup` to set up the virtual environment with all development dependencies (pylint, pre-commit hooks, etc.). This is required before committing. `script/setup` installs into the active virtual environment when `VIRTUAL_ENV` is set. In a git worktree, run it as `env -u VIRTUAL_ENV script/setup` so it creates the worktree's own `.venv`; otherwise it installs into the main checkout's environment and points that environment's editable installs at the worktree. If uv reports that no download was found for the required Python version, the environment is running an outdated version of uv; upgrade it with `curl -LsSf https://astral.sh/uv/install.sh | sh` and run `script/setup` again.
|
||||
- .vscode/tasks.json contains useful commands used for development.
|
||||
- After finishing a code session, run `base=$(git merge-base HEAD dev) && uv run --no-sync prek run --files $(git diff --name-only --diff-filter=d "$base"; git ls-files --others --exclude-standard)` to check the files changed on the branch (committed, uncommitted and untracked) for linting and formatting issues.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user