From 6593fe97578b5c684b87dbfa1c13de93e5a6460f Mon Sep 17 00:00:00 2001 From: Martin Hjelmare Date: Tue, 4 Aug 2026 09:53:18 +0200 Subject: [PATCH] Use uv run --no-sync for agents (#178127) --- .claude/skills/bump-dependency/SKILL.md | 10 +++++----- .github/copilot-instructions.md | 4 ++-- AGENTS.md | 4 ++-- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/.claude/skills/bump-dependency/SKILL.md b/.claude/skills/bump-dependency/SKILL.md index 77f4c9daa516..8774ad871030 100644 --- a/.claude/skills/bump-dependency/SKILL.md +++ b/.claude/skills/bump-dependency/SKILL.md @@ -19,7 +19,7 @@ Follow these systematic steps to successfully bump a python package requirement - [ ] **2. Discover Codebase References**: Search the codebase to find all `manifest.json` and requirements files referencing the package. - [ ] **3. Resolve Version/Tag Details**: Run the integrated validation helper script to resolve version details, GitHub repo, release tag format, and formatted PR links: ```bash - uv run python3 ./.claude/skills/bump-dependency/scripts/resolve_dependency.py [--new-version ] + uv run --no-sync python3 ./.claude/skills/bump-dependency/scripts/resolve_dependency.py [--new-version ] ``` - [ ] **4. Plan-Validate-Execute (Draft Plan)**: Before modifying any files, write a brief, structured plan outlining the integrations to change, old version, new version, and the resolved comparison link. Show this draft plan to the user. @@ -33,7 +33,7 @@ Follow these systematic steps to successfully bump a python package requirement - [ ] **7. Apply Bump to manifests**: Update the version constraint string in all identified `manifest.json` files (e.g., change `"package==1.0.0"` to `"package==1.1.0"`). - [ ] **8. Regenerate Core Requirements**: Run the requirements generator to update all derivative requirements and constraint files: ```bash - uv run python3 -m script.gen_requirements_all + uv run --no-sync python3 -m script.gen_requirements_all ``` - [ ] **9. Validate Requirements**: Check `git diff` to ensure that only the targeted `manifest.json` files and `requirements_all.txt` (and potentially standard constraints) were modified. No unrelated files must be affected. - [ ] **10. Local Venv Verification**: Install the exact targeted package version directly inside the virtual environment: @@ -44,14 +44,14 @@ Follow these systematic steps to successfully bump a python package requirement ### Phase C: Validation Loop (Tests & Lint) - [ ] **11. Run Integration Tests**: Execute the pytest suite for all integrations that consume the bumped package: ```bash - uv run pytest tests/components/ + uv run --no-sync pytest tests/components/ ``` - *Validation Loop*: If tests fail, analyze the error, apply appropriate fixes, and re-run pytest until all tests pass cleanly. - [ ] **12. Run prek Lint Checks**: Run the local prek hooks on modified files: ```bash - uv run prek run + uv run --no-sync prek run ``` - - *Validation Loop*: If prek checks report any formatting or linting violations, fix them and repeat `uv run prek run` until it passes completely without errors. + - *Validation Loop*: If prek checks report any formatting or linting violations, fix them and repeat `uv run --no-sync prek run` until it passes completely without errors. ### Phase D: User Confirmation & PR Creation - [ ] **13. Commit Changes**: Commit the clean changes: diff --git a/.github/copilot-instructions.md b/.github/copilot-instructions.md index 7d64835dc667..17898f85ba54 100644 --- a/.github/copilot-instructions.md +++ b/.github/copilot-instructions.md @@ -153,7 +153,7 @@ This repository contains the core of Home Assistant, a Python 3 based home autom - 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. - .vscode/tasks.json contains useful commands used for development. -- After finishing a code session, run `uv run prek run --all-files` to check for linting and formatting issues. +- After finishing a code session, run `uv run --no-sync prek run --all-files` to check for linting and formatting issues. ## Python Syntax Notes @@ -163,7 +163,7 @@ This repository contains the core of Home Assistant, a Python 3 based home autom ## Testing -- Use `uv run pytest` to run tests +- Use `uv run --no-sync pytest` to run tests - After modifying `strings.json` for an integration, regenerate the English translation file before running tests: `python3 -m script.translations develop --integration `. Tests load translations from the generated `translations/en.json`, not directly from `strings.json`. - When writing or modifying tests, ensure all test function parameters have type annotations. - Prefer concrete types (for example, `HomeAssistant`, `MockConfigEntry`, etc.) over `Any`. diff --git a/AGENTS.md b/AGENTS.md index 882d266537a9..c71ccde55e45 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -16,7 +16,7 @@ This repository contains the core of Home Assistant, a Python 3 based home autom - 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. - .vscode/tasks.json contains useful commands used for development. -- After finishing a code session, run `uv run prek run --all-files` to check for linting and formatting issues. +- After finishing a code session, run `uv run --no-sync prek run --all-files` to check for linting and formatting issues. ## Python Syntax Notes @@ -26,7 +26,7 @@ This repository contains the core of Home Assistant, a Python 3 based home autom ## Testing -- Use `uv run pytest` to run tests +- Use `uv run --no-sync pytest` to run tests - After modifying `strings.json` for an integration, regenerate the English translation file before running tests: `python3 -m script.translations develop --integration `. Tests load translations from the generated `translations/en.json`, not directly from `strings.json`. - When writing or modifying tests, ensure all test function parameters have type annotations. - Prefer concrete types (for example, `HomeAssistant`, `MockConfigEntry`, etc.) over `Any`.