Use uv run --no-sync for agents (#178127)

This commit is contained in:
Martin Hjelmare
2026-08-04 03:53:18 -04:00
committed by GitHub
parent e371b7552e
commit 6593fe9757
3 changed files with 9 additions and 9 deletions
+2 -2
View File
@@ -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 <integration_name>`. 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`.