Home Assistant manifest.json support#14899
Open
mxr wants to merge 2 commits intodependabot:mainfrom
Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Adds Python ecosystem support for updating dependencies declared in Home Assistant manifest.json files (via the requirements array), integrating the feature into the existing Dependabot pip fetch/parse/check/update flow.
Changes:
- Detect and fetch Home Assistant manifests under
custom_components/*/manifest.jsonandhomeassistant/components/*/manifest.json. - Parse
requirementsentries from those manifests as pip dependencies and update them via a JSON writer. - Extend update checking / dependency graphing so manifest-backed requirements participate in the normal pip workflow, with focused specs + fixtures.
Reviewed changes
Copilot reviewed 17 out of 17 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| python/lib/dependabot/python/file_fetcher.rb | Adds manifest discovery/fetching for Home Assistant layouts and updates required-files detection/message. |
| python/lib/dependabot/python/file_parser.rb | Wires in Home Assistant manifest parsing and required-files checks. |
| python/lib/dependabot/python/file_parser/home_assistant_manifest_parser.rb | New parser for Home Assistant manifest.json requirements. |
| python/lib/dependabot/python/file_updater.rb | Routes updates to a new Home Assistant manifest updater and adjusts required-files checks. |
| python/lib/dependabot/python/file_updater/home_assistant_manifest_updater.rb | New updater that rewrites pinned requirements inside manifest JSON. |
| python/lib/dependabot/python/update_checker.rb | Allows manifest-backed requirements to be considered when determining current requirement strings. |
| python/lib/dependabot/python/update_checker/requirements_updater.rb | Treats manifest requirements like requirements.txt requirements for update-strategy rewriting. |
| python/lib/dependabot/python/dependency_grapher.rb | Considers a Home Assistant manifest as a relevant dependency file for pip graphing. |
| python/spec/dependabot/python/file_fetcher_spec.rb | Adds fetcher detection + GitHub contents stubs for Home Assistant layout; adds Base64 helper usage. |
| python/spec/dependabot/python/file_parser_spec.rb | Adds parsing/error behavior specs for Home Assistant manifests. |
| python/spec/dependabot/python/file_updater_spec.rb | Adds routing spec ensuring FileUpdater delegates to the manifest updater. |
| python/spec/dependabot/python/file_updater/home_assistant_manifest_updater_spec.rb | New unit spec for JSON rewrite behavior. |
| python/spec/dependabot/python/update_checker_spec.rb | Adds spec coverage for manifest-backed requirements update checking. |
| python/spec/fixtures/home_assistant/manifest.json | Fixture manifest containing pinned requirements. |
| python/spec/fixtures/github/contents_home_assistant_*.json | GitHub API fixtures for directory layouts used by fetcher specs. |
6505b49 to
b7f3ae3
Compare
b7f3ae3 to
68f5cc4
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.
What are you trying to accomplish?
Home Assistant is one of the largest and most popular Python open source projects. Home Assistant integrations (inside its monorepo or otherwise) specify Python dependencies in
manifest.jsonfile under therequirementskey. For exampleThis PR adds support for updating these dependencies. They are discovered, parsed, and updated with the same existing Python requirement logic used for
requirements.txt,setup.py,setup.cfg,pyproject.toml, andPipfile.Anything you want to highlight for special attention from reviewers?
Reusing the shared Python requirement update logic and adding a JSON-specific writer for
manifest.json.Resolves #6215
How will you know you've accomplished your goal?
Added focused specs for:
custom_components/*/manifest.jsonandhomeassistant/components/*/manifest.jsonrequirementsin Home Assistant manifestsChecklist
rubocop -apasses locally