Skip to content

Home Assistant manifest.json support#14899

Open
mxr wants to merge 2 commits intodependabot:mainfrom
mxr:home-assistant-manifest.json
Open

Home Assistant manifest.json support#14899
mxr wants to merge 2 commits intodependabot:mainfrom
mxr:home-assistant-manifest.json

Conversation

@mxr
Copy link
Copy Markdown

@mxr mxr commented May 3, 2026

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.json file under the requirements key. For example

{
    "domain": "dhcp",
    "name": "DHCP Discovery",
    # ...
    "requirements": [             # <-- here
        "aiodhcpwatcher==1.2.1",
        "aiodiscover==2.7.1",
        "cached-ipaddress==1.0.1"
    ]
}

This 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, and Pipfile.

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:

  • fetcher detection of custom_components/*/manifest.json and homeassistant/components/*/manifest.json
  • parser handling of requirements in Home Assistant manifests
  • updater rewrite behavior for manifest JSON
  • update checker handling of manifest-backed requirements

Checklist

  • I have run the complete test suite to ensure all tests and linters pass.
    • Having trouble setting up the toolchain but my individual tests pass and rubocop -a passes locally
  • I have thoroughly tested my code changes to ensure they work as expected, including adding additional tests for new functionality.
  • I have written clear and descriptive commit messages.
  • I have provided a detailed description of the changes in the pull request, including the problem it addresses, how it fixes the problem, and any relevant details about the implementation.
  • I have ensured that the code is well-documented and easy to understand.

Copilot AI review requested due to automatic review settings May 3, 2026 14:36
@mxr mxr requested a review from a team as a code owner May 3, 2026 14:36
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.json and homeassistant/components/*/manifest.json.
  • Parse requirements entries 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.

Comment thread python/lib/dependabot/python/file_updater/home_assistant_manifest_updater.rb Outdated
Comment thread python/lib/dependabot/python/file_parser/home_assistant_manifest_parser.rb Outdated
Comment thread python/lib/dependabot/python/update_checker/requirements_updater.rb Outdated
Comment thread python/lib/dependabot/python/file_fetcher.rb
@mxr mxr force-pushed the home-assistant-manifest.json branch 3 times, most recently from 6505b49 to b7f3ae3 Compare May 4, 2026 19:36
@mxr mxr force-pushed the home-assistant-manifest.json branch from b7f3ae3 to 68f5cc4 Compare May 5, 2026 11:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support for manifest.json in home assistant

2 participants