
Bump Python Package Dependency
FreeStreamline dependency management for Home Assistant.
Free ยท Opens the source repo
What Bump Python Package Dependency does
The Bump Python Package Dependency skill is designed specifically for developers working with the Home Assistant Core repository. This skill automates the process of updating package dependencies across various integrations, ensuring that all necessary files are regenerated and that the changes are validated through testing. By following a structured workflow, users can efficiently bump package versions while maintaining the integrity of the codebase.
The skill provides a step-by-step checklist that guides users through the entire process, from identifying the package and version to bump, to executing local changes and validating them with tests. This systematic approach helps prevent errors and ensures that all modifications are properly documented and tested before submitting a pull request. The integrated validation helper script, resolve_dependency.py, is crucial for resolving version details and generating correct comparison links, which can often be a source of confusion due to inconsistencies in GitHub tagging.
Developers who contribute to the Home Assistant Core will find this skill invaluable as it streamlines a typically manual and error-prone process. By automating the generation of pull request templates and ensuring compliance with the project's contribution guidelines, this skill significantly reduces the overhead associated with dependency management. Whether you're a seasoned contributor or new to the project, this skill will enhance your workflow and improve your efficiency in managing package dependencies.
When to use it
Use this skill when you need to update a Python package dependency within the Home Assistant Core integrations and ensure that all related files and tests are correctly handled.
When not to use it
This skill is not suitable for projects outside of the Home Assistant Core repository or for managing dependencies in non-Python environments.
What you can build with it
Updating a Package for a New Release
When a new version of a package is released, use this skill to update the dependency across all relevant integrations.
Preparing for a Code Review
Before submitting your changes, utilize this skill to ensure all modifications are properly validated and documented.
Automating Dependency Management
Streamline your workflow by automating the tedious tasks involved in managing package dependencies in Home Assistant.
How to install Bump Python Package Dependency
View source1. Install with the skills CLI
npx skills add home-assistant/core/bump-dependency --agent claude-code2. Or install it manually
Download the skill folder and drop it into ~/.claude/skills/ for all projects, or .claude/skills/ to scope it to one repo. Restart Claude Code so it picks up the new skill.
Anthropic's agentic coding CLI, and the reference implementation of Agent Skills. Drop a skill folder into ~/.claude/skills and Claude Code loads it automatically whenever a task matches the skill's description. Claude Code docs
Inside SKILL.md
Written by home-assistantBump Python Package Dependency in Home Assistant Core
Follow these systematic steps to successfully bump a python package requirement in the repository, regenerate necessary derivative files, verify the integration, and raise a pull request.
Gotchas & Non-Obvious Constraints
- PR Template Integrity: Follow Home Assistant's Pull Request template (
.github/PULL_REQUEST_TEMPLATE.md) exactly as written, including any instructions inside the template itself. Preserve all sections, comments, and unchecked checkboxes unless the template explicitly says otherwise; the only allowed removal is the Breaking change section when the template instructs you to remove it if not applicable. - GitHub Tag Volatility: Release tags on GitHub are highly inconsistent (e.g.,
v1.2.3vs1.2.3vsrelease-1.2.3). Always use the automated resolverresolve_dependency.pyto check HEAD status for correct tags before hardcoding comparison URLs.
Step-by-Step Workflow Checklist
Phase A: Research and Plan
- 1. Identify Targets: Note the requested target package and target version to bump.
- 2. Discover Codebase References: Search the codebase to find all
manifest.jsonand requirements files referencing the package. - 3. Resolve Version/Tag Details: Run the integrated validation helper script to resolve version details, GitHub repo, release tag format, and formatted PR links:
uv run python3 ./.claude/skills/bump-dependency/scripts/resolve_dependency.py <package> <old_version> [--new-version <new_version>] - 4. Plan-Validate-Execute (Draft Plan): Before modifying any files, write a brief, structured plan outlining the integrations to change, old version, new version, and the resolved comparison link. Show this draft plan to the user.
Phase B: Execute and Validate (Local Changes)
- 5. Check Uncommitted Changes: Check for any uncommitted changes in the repository. If they exist, ask the user whether to stash, commit, or discard them before proceeding.
- 6. Git Branch Setup: Create a clean branch starting from the latest
upstream/dev:git fetch upstream dev git checkout -b bump-<package>-to-<version> upstream/dev - 7. Apply Bump to manifests: Update the version constraint string in all identified
manifest.jsonfiles (e.g., change"package==1.0.0"to"package==1.1.0"). - 8. Regenerate Core Requirements: Run the requirements generator to update all derivative requirements and constraint files:
uv run python3 -m script.gen_requirements_all - 9. Validate Requirements: Check
git diffto ensure that only the targetedmanifest.jsonfiles andrequirements_all.txt(and potentially standard constraints) were modified. No unrelated files must be affected. - 10. Local Venv Verification: Install the exact targeted package version directly inside the virtual environment:
uv pip install "<package>==<version>"
Phase C: Validation Loop (Tests & Lint)
- 11. Run Integration Tests: Execute the pytest suite for all integrations that consume the bumped package:
uv run pytest tests/components/<integration_name>- Validation Loop: If tests fail, analyze the error, apply appropriate fixes, and re-run pytest until all tests pass cleanly.
- 12. Run prek Lint Checks: Run the local prek hooks on modified files:
uv run prek run- Validation Loop: If prek checks report any formatting or linting violations, fix them and repeat
uv run prek rununtil it passes completely without errors.
- Validation Loop: If prek checks report any formatting or linting violations, fix them and repeat
Phase D: User Confirmation & PR Creation
- 13. Commit Changes: Commit the clean changes:
git add <modified_files> git commit -m "Bump <package> to <version>" - 14. Push Branch: Push the local branch to your origin remote:
git push origin bump-<package>-to-<version> - 15. PR Description Preparation: Generate the pull request body from
.github/PULL_REQUEST_TEMPLATE.md:- Proposed change: Describe the package, old version, new version, target/source branches, and insert the resolved PyPI, changelog, and comparison diff links.
- Type of change: Check only 1 box in this section, and mark the
Dependency upgradecheckbox as checked:[x] Dependency upgrade. - Breaking change: You may remove the "Breaking change" section entirely from the template.
- Validation checklists: Mark
The code change is testedcheckbox as checked:[x] The code change is tested. - Keep remaining template intact: Do NOT remove any other commented-out blocks, headers, or unchecked checkboxes in the template.
- 16. Mandatory Review Presentation: Format the PR proposal using the PR Presentation Template below and display it to the user. Stop and wait for the user to review and explicitly confirm/approve the PR template and draft details before creating the PR.
- 17. Raise Pull Request: Once the user approves, create the Pull Request using the GitHub CLI:
gh pr create --repo home-assistant/core --base dev --head <username>:bump-<package>-to-<version> --title "Bump <package> to <version>" --body-file <pr_body_file>
PR Presentation Template
### ๐ Dependency Bump Pull Request Draft Review
- **Package**: `<package_name>` (`<old_version>` โ `<new_version>`)
- **PR Title**: `Bump <package_name> to <new_version>`
- **Target Branch**: `dev`
- **Head Branch**: `<fork_username>:bump-<package_name>-to-<new_version>`
#### ๐ PyPI & GitHub Links
- **PyPI Release**: https://pypi.org/project/<package_name>/<new_version>/
- **Changelog Link**: `<changelog_url>`
- **Comparison Diff**: `<compare_url>`
#### ๐ Modified Files
- `<list_of_modified_files>`
#### ๐ Proposed PR Body
<render the complete filled PR template body here, showing all checks and modifications for user approval>
Frequently asked questions about Bump Python Package Dependency
Similar skills
Turborepo
Optimized build system for JavaScript/TypeScript monorepos.
Azure Pipelines Validation
Streamline your Azure DevOps pipeline changes locally.
Azure Developer CLI
Streamline your Azure project workflows with best practices.
Azure Container Registry CLI
Manage Azure Container Registry resources with ease.
Aspire
Build and orchestrate polyglot distributed applications seamlessly.
Vercel CLI
Manage and deploy Vercel projects from the command line.
