Split requirements into dev and lint dependencies - #379
Merged
Conversation
The Lint CI job only runs ruff but installed the full requirements file, pulling in homeassistant just to lint. Extract a lint-only requirements_lint.txt (pip + ruff) that the Lint workflow installs, and rename the former requirements.txt to requirements_dev.txt to reflect its dev/test purpose (a HA custom component declares runtime deps in manifest.json). requirements_dev.txt includes requirements_lint.txt via -r so the ruff pin lives in one place. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01C7aHKodG4TtAS6cgCB2HwZ
Contributor
There was a problem hiding this comment.
Pull request overview
This PR reorganizes Python dependency management by splitting development/testing requirements from lint-only requirements, enabling the Lint CI workflow to install a smaller dependency set.
Changes:
- Introduces
requirements_lint.txtfor lint tooling and updates the Lint workflow to install from it. - Updates
requirements_dev.txtto include lint requirements via-r requirements_lint.txtand removes duplicated entries. - Updates local setup script and README documentation to reflect the new requirements file layout.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
scripts/setup |
Installs dev requirements from requirements_dev.txt for local development setup. |
requirements_lint.txt |
New lint-only dependency list (pip + ruff). |
requirements_dev.txt |
Dev/test dependencies now include lint deps via -r requirements_lint.txt. |
README.md |
Documents the split requirements files and their purposes. |
.github/workflows/lint.yml |
Lint job now installs from requirements_lint.txt. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
setup-python's pip cache defaults to hashing **/requirements.txt, which no longer exists after the rename to requirements_dev.txt. Set cache-dependency-path to the file the job installs so the cache key tracks the actual lint dependencies. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01C7aHKodG4TtAS6cgCB2HwZ
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Move pip>=21.3.1 out of requirements_lint.txt into a dedicated requirements_ci.txt so the lint file holds only the ruff pin. The Lint workflow installs both files explicitly and hashes both in the pip cache key. requirements_dev.txt keeps its own pip>=21.3.1 line so local dev still upgrades pip. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01C7aHKodG4TtAS6cgCB2HwZ
Contributor
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.
Comments suppressed due to low confidence (1)
requirements_dev.txt:4
pip>=21.3.1is duplicated between this file andrequirements_ci.txt, which undermines the stated goal of avoiding duplication and makes it easy for the pip floor to drift between dev and CI. Consider includingrequirements_ci.txtfrom here and removing the duplicated pip entry.
Installing requirements_ci.txt and requirements_lint.txt in one pip invocation can be flaky, since pip may upgrade itself mid-run. Run the pip upgrade first, then install the lint tooling, so the upgraded pip is used for the lint install. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01C7aHKodG4TtAS6cgCB2HwZ
…st in dev The pip pin is common to both the Lint CI job and local dev, so name the file requirements_common.txt. Install it as a separate first pip command in both scripts/setup and the Lint workflow, so any pip self-upgrade completes before the remaining dependencies are installed (guarding dev against the same mid-run upgrade flakiness as CI). Drop the duplicated pip pin from requirements_dev.txt now that scripts/setup installs requirements_common.txt up front. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01C7aHKodG4TtAS6cgCB2HwZ
ludeeus
force-pushed
the
claude/lint-requirements-separation-i67en1
branch
from
July 19, 2026 13:19
a4d14bc to
5e385ee
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Split the single
requirements.txtinto purpose-specific files so the lint CI job installs only what it needs (ruff), the pip pin lives in one shared place, and both CI and local dev upgrade pip before installing anything else.Requirement files
requirements_common.txt(new) —pip>=21.3.1. Shared by both the Lint CI job and local dev; installed first, on its own, so any pip self-upgrade completes before other packages.requirements_lint.txt(new) —ruff==0.15.21only.requirements_dev.txt(renamed fromrequirements.txt) — development/testing packages (colorlog,homeassistant), pulling in the lint tooling via-r requirements_lint.txt.Key Changes
requirements.txt→requirements_dev.txtand extractedrequirements_lint.txt(ruff) andrequirements_common.txt(pip)..github/workflows/lint.yml: installsrequirements_common.txtandrequirements_lint.txtas two separatepip installcommands (pip upgrade first, then ruff), and pinscache-dependency-pathto hash both files so the pip cache key reflects the actual installed dependencies.scripts/setup: installsrequirements_common.txtfirst, thenrequirements_dev.txt, applying the same pip-first ordering to local dev.README.md: documents the three requirement files.Benefits
homeassistanttree — faster, and decoupled from the runtime environment.https://claude.ai/code/session_01C7aHKodG4TtAS6cgCB2HwZ