-
Notifications
You must be signed in to change notification settings - Fork 11
Update devcontainer setup and tooling configs #707
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR modernizes the development environment setup by transitioning from system-wide Python package installation to a dedicated virtual environment approach, improving isolation and maintainability. The changes enhance the devcontainer configuration, update VS Code tooling settings, and refine build configurations.
Key changes:
- Migrated from system Python to venv-based development with smart dependency caching via hash-based stamp files
- Added automated installation of Home Assistant base component dependencies
- Replaced symlinks with file copying for YAML configs to ensure volume-mount compatibility
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| scripts/setup-devcontainer | Implemented venv-based setup with requirement hash caching, dynamic HA component dependency resolution, and YAML file copying |
| scripts/setup | Updated to use file copying instead of symlinking for YAML configs, matching devcontainer approach |
| rollup.config.js | Configured Babel to target ES modules, avoiding class transpilation issues |
| AGENTS.md | Added documentation about TypeScript rebuild requirements |
| .vscode/tasks.json | Added task to run Home Assistant using the venv Python interpreter |
| .vscode/settings.json | Configured default Python interpreter to use venv path |
| .vscode/launch.json | Updated debugger configuration to use venv Python interpreter |
| .devcontainer/devcontainer.json | Switched to Python base image, added Claude and Rust features, and added postStartCommand |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| "args": ["--debug", "--config", "${workspaceFolder}/.ha"], | ||
| "cwd": "${workspaceFolder}/.ha", | ||
| "python": "${workspaceFolder}/.ha/venv/bin/python", | ||
| "pythonPath": "${workspaceFolder}/.ha/venv/bin/python", |
Copilot
AI
Jan 2, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Both 'python' and 'pythonPath' are specified with the same value. The 'pythonPath' property is deprecated in favor of 'python' in recent versions of the Python debugger extension. Consider removing the 'pythonPath' line to avoid redundancy and use the modern property only.
| "pythonPath": "${workspaceFolder}/.ha/venv/bin/python", |
| "version": "3.13", | ||
| "installTools": false | ||
| } | ||
| "ghcr.io/devcontainers/features/rust:1": {} |
Copilot
AI
Jan 2, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The Rust feature is added but there's no evidence of Rust code in the repository (no Cargo.toml or .rs files). While Rust might be needed to build certain Python packages with native extensions, or for the uv tool itself (which is written in Rust), uv is typically distributed as a prebuilt binary and doesn't require Rust at runtime. Consider whether this feature is actually needed, as it adds unnecessary dependencies to the development container.
scripts/setup-devcontainer
Outdated
|
|
||
| source "${VENV_PATH}/bin/activate" | ||
| if [ ! -f "${STAMP_FILE}" ] || [ "$(cat "${STAMP_FILE}")" != "${REQ_HASH}" ]; then | ||
| python -m pip install --upgrade pip "uv==0.9.6" |
Copilot
AI
Jan 2, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The version of uv is pinned to 0.9.6 here, but requirements_dev.txt specifies uv without a version constraint. This creates an inconsistency - if requirements_dev.txt is updated to require a different version of uv, this hardcoded pin will prevent that update. Consider removing the version pin here and letting requirements_dev.txt control the uv version.
| python -m pip install --upgrade pip "uv==0.9.6" | |
| python -m pip install --upgrade pip uv |
scripts/setup-devcontainer
Outdated
| python -m pip install --upgrade pip "uv==0.9.6" | ||
| uv pip install -r requirements_dev.txt | ||
| echo "${REQ_HASH}" > "${STAMP_FILE}" | ||
| fi | ||
|
|
||
| python - <<'PY' |
Copilot
AI
Jan 2, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This Python script uses 'python' instead of 'python3'. While it should work because the venv is activated at line 60, using 'python3' would be more consistent with the rest of the script (lines 11, 21) and more explicit about the Python version being used.
| python -m pip install --upgrade pip "uv==0.9.6" | |
| uv pip install -r requirements_dev.txt | |
| echo "${REQ_HASH}" > "${STAMP_FILE}" | |
| fi | |
| python - <<'PY' | |
| python3 -m pip install --upgrade pip "uv==0.9.6" | |
| uv pip install -r requirements_dev.txt | |
| echo "${REQ_HASH}" > "${STAMP_FILE}" | |
| fi | |
| python3 - <<'PY' |
| "PIP_BREAK_SYSTEM_PACKAGES": "1" | ||
| }, | ||
| "postCreateCommand": "scripts/setup-devcontainer", | ||
| "postStartCommand": "scripts/setup-devcontainer", |
Copilot
AI
Jan 2, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Adding postStartCommand to run setup-devcontainer will execute this script every time the container starts, not just when it's created. This could lead to unnecessary reinstallation of dependencies and re-running of setup tasks on every container restart. The stamp file mechanism (lines 61-65 in setup-devcontainer) will help skip reinstalls when requirements haven't changed, but other operations like pre-commit install, yarn install, and file copying will still run. Consider whether this is the intended behavior or if postCreateCommand alone is sufficient.
| "postStartCommand": "scripts/setup-devcontainer", |
96b1beb to
b631069
Compare
11425d1 to
65663e9
Compare
65663e9 to
3f10177
Compare
Proposed change
Type of change
Additional information