Require new HA version for device class sync script#810
Conversation
Home Assistant is only pulled in for the device snapshot tests. It was unpinned, so uv could resolve it as far back as 0.7.0 whose sdist fails to build, breaking from-scratch resolves (e.g. Dependabot). Newer HA can't be used on Python 3.12/3.13: 2025.1.0-2026.2.x pin an exact, older uv that conflicts with our uv>=0.11.16, and HA >=2026.3.0 requires Python >=3.14.2. So gate the dependency to Python 3.14.2+ and floor it at the current latest (2026.6.4). The snapshot tooling only imports HA (tools/compare_constants.py), so this doesn't affect the CI test run on older Python.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## dev #810 +/- ##
=======================================
Coverage 97.29% 97.29%
=======================================
Files 55 55
Lines 10933 10933
=======================================
Hits 10637 10637
Misses 296 296 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Pull request overview
This PR prevents dependency resolvers (notably Dependabot) from selecting extremely old, unbuildable homeassistant sdists by making the homeassistant test extra conditional on Python ≥ 3.14.2 and flooring it to a modern Home Assistant release. This keeps dependency resolution stable on Python 3.12/3.13 while still enabling the device-class/constant sync maintenance workflow on newer Python.
Changes:
- Add a Python-version marker to the
homeassistantentry in thetestingextra so it is only considered on Python ≥ 3.14.2. - Floor
homeassistantto>=2026.7.0to avoid backtracking to ancient, broken sdists. - Add an inline comment explaining why
homeassistantis gated.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Note: This is only used in the
testinggroup. ZHA doesn't requirehomeassistant, of course.This is only used for one sync-script. We'll have a better way to sync device classes, similar to ESPHome, in the future.
Problem
Dependabot fails to build dependencies with:
This surfaced only after #807 unblocked the earlier resolution cycle. The
homeassistanttest dependency was unbounded, so a from-scratch resolve (e.g. Dependabot backtracking) could descend all the way tohomeassistant==0.7.0, whose sdist reads arequirements.txtthat isn't shipped and therefore fails to build.Why we can't just raise the floor a little
Newer Home Assistant simply can't be installed on Python 3.12/3.13:
uv(uv==0.9.6,0.9.17,0.9.26, …), which conflicts with ouruv>=0.11.16.So on Python 3.12/3.13 the newest installable HA is
2024.9.3. You can reproduce the conflict yourself:uv lock --upgrade-package 'homeassistant>=2025.1.0'Fix
Gate the dependency to Python 3.14.2+ and floor it at the current latest:
"homeassistant>=2026.7.0; python_full_version >= '3.14.2'",2026.7.0) is used where it can be (Python 3.14.2+).Verified: a tagless from-scratch
uv lockresolves cleanly andhomeassistant 0.7.0never appears.Does this affect CI?
No.
homeassistantis not imported by the test suite — the only importer istools/compare_constants.py(a maintenance script). So dropping it on the 3.12/3.13 CI jobs doesn't change pytest; it only means that script needs Python 3.14.2+.Follow-up: we likely want to drop this dependency entirely
Since
homeassistantis only used bytools/compare_constants.py, it probably shouldn't be a declared test dependency at all. The plan is to add an automatic workflow that syncs the HA device classes, and have that workflow installhomeassistantmanually rather than carrying it inpyproject.toml. This PR is the minimal fix to unblock Dependabot in the meantime.