Skip to content

Commit 5088054

Browse files
ci: track Home Assistant's Python version with Renovate (#167)
Add a Renovate custom datasource that reads .python-version from home-assistant/core's master branch (the latest stable release) and a regex manager that updates workflow python-version pins marked with "# renovate: ha-python". Only major.minor is tracked. Release age is skipped because the plain datasource has no timestamps, and the updates are not automerged. Claude-Session: https://claude.ai/code/session_01WX2DCUzh4HYLBRxv7AyWbm Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
1 parent afce9a8 commit 5088054

4 files changed

Lines changed: 29 additions & 0 deletions

File tree

‎.github/workflows/ci.yml‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ jobs:
1515
- uses: astral-sh/setup-uv@68559e99cc807c1eb7e9238fd43a15bba460eec2 # v10.3.3
1616
- uses: actions/setup-python@6d4fd22b20465ccc0f7354476588e8df7c9ca0e0 # v7.1.0
1717
with:
18+
# renovate: ha-python
1819
python-version: "3.13"
1920
- run: uv sync --locked --all-extras --dev
2021
- name: Lint

‎.github/workflows/publish-to-pypi.yml‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ jobs:
2222
- uses: astral-sh/setup-uv@68559e99cc807c1eb7e9238fd43a15bba460eec2 # v10.3.3
2323
- uses: actions/setup-python@6d4fd22b20465ccc0f7354476588e8df7c9ca0e0 # v7.1.0
2424
with:
25+
# renovate: ha-python
2526
python-version: "3.13"
2627
- name: Set dev version for TestPyPI
2728
if: github.event_name == 'push'

‎.github/workflows/release.yml‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ jobs:
3333
- uses: actions/setup-python@6d4fd22b20465ccc0f7354476588e8df7c9ca0e0 # v7.1.0
3434
if: steps.release.outputs.pr && !steps.release.outputs.release_created
3535
with:
36+
# renovate: ha-python
3637
python-version: "3.13"
3738
- name: Update uv.lock
3839
if: steps.release.outputs.pr && !steps.release.outputs.release_created

‎renovate.json‎

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,33 @@
99
"minimumReleaseAgeBehaviour": "timestamp-required",
1010
"automerge": true,
1111
"minimumReleaseAge": "3 days",
12+
"customDatasources": {
13+
"ha-python": {
14+
"description": "Python version of the latest stable Home Assistant release (HA core's master branch tracks stable)",
15+
"defaultRegistryUrlTemplate": "https://raw.githubusercontent.com/home-assistant/core/master/.python-version",
16+
"format": "plain"
17+
}
18+
},
19+
"customManagers": [
20+
{
21+
"customType": "regex",
22+
"description": "Track the Python version of the latest stable Home Assistant release",
23+
"managerFilePatterns": ["/^\\.github/workflows/.+\\.ya?ml$/"],
24+
"matchStrings": [
25+
"# renovate: ha-python\\s+python-version:\\s*\"(?<currentValue>[^\"]+)\""
26+
],
27+
"depNameTemplate": "ha-python",
28+
"datasourceTemplate": "custom.ha-python"
29+
}
30+
],
1231
"packageRules": [
32+
{
33+
"description": "HA Python: track major.minor only; plain datasource has no timestamps so skip release age; review before merging",
34+
"matchDatasources": ["custom.ha-python"],
35+
"extractVersion": "^(?<version>\\d+\\.\\d+)",
36+
"minimumReleaseAge": null,
37+
"automerge": false
38+
},
1339
{
1440
"description": "Tagged action releases: cooldown, then automerge",
1541
"matchManagers": ["github-actions"],

0 commit comments

Comments
 (0)