Skip to content

Commit 1105c13

Browse files
committed
Use common caching actions from repo - bump py314
1 parent 8acfcfa commit 1105c13

File tree

6 files changed

+43
-133
lines changed

6 files changed

+43
-133
lines changed

.github/actions/restore-venv/action.yml

Lines changed: 0 additions & 60 deletions
This file was deleted.

.github/workflows/merge.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
name: Latest release
55

66
env:
7-
CACHE_VERSION: 21
8-
DEFAULT_PYTHON: "3.13"
7+
CACHE_VERSION: 22
8+
DEFAULT_PYTHON: "3.14"
99

1010
# Only run on merges
1111
on:

.github/workflows/verify.yml

Lines changed: 32 additions & 67 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
name: Latest commit
55

66
env:
7-
CACHE_VERSION: 5
8-
DEFAULT_PYTHON: "3.13"
7+
CACHE_VERSION: 6
8+
DEFAULT_PYTHON: "3.14"
99
PRE_COMMIT_HOME: ${{ github.workspace }}/.cache/pre-commit
1010
VENV: venv
1111

@@ -32,30 +32,25 @@ jobs:
3232
uses: actions/setup-python@v6
3333
with:
3434
python-version: ${{ env.DEFAULT_PYTHON }}
35+
- name: Fetch HA pyproject
36+
id: core-version
37+
run: wget -O ha_pyproject.toml "https://raw.githubusercontent.com/home-assistant/core/refs/heads/dev/pyproject.toml"
3538
- name: Compute cache key
3639
id: set-key
37-
run: echo "cache-key=${{ runner.os }}-venv-cache-${{ env.CACHE_VERSION }}-${{ steps.python.outputs.python-version }}-${{ hashFiles('pyproject.toml', 'requirements_commit.txt', 'requirements_test.txt', '.pre-commit-config.yaml') }}" >> "$GITHUB_OUTPUT"
40+
run: echo "cache-key=${{ runner.os }}-venv-cache-${{ env.CACHE_VERSION }}-${{ steps.python.outputs.python-version }}-${{ hashFiles('pyproject.toml', 'requirements_test.txt', '.pre-commit-config.yaml') }}" >> "$GITHUB_OUTPUT"
3841

3942
# Prepare default python version environment
4043
prepare:
4144
runs-on: ubuntu-latest
4245
needs: cache
4346
name: Prepare
4447
steps:
45-
- name: Check out committed code
46-
uses: actions/checkout@v5
47-
- name: Set up Python ${{ needs.cache.outputs.python-version }}
48-
id: python
49-
uses: actions/setup-python@v6
50-
with:
51-
python-version: ${{ needs.cache.outputs.python-version }}
52-
- name: Create or reuse cache
48+
- name: Prepare code checkout and python/pre-commit setup
5349
id: cache-reuse
54-
uses: ./.github/actions/restore-venv
50+
uses: plugwise/gh-actions/prepare-python-and-code@v1
5551
with:
56-
cache-key: ${{ needs.cache.outputs.cache-key }}
57-
fail-on-miss: false # First time create cache (if not already exists)
58-
python-version: ${{ steps.python.outputs.python-version }}
52+
fail-on-miss: false # First time create cache (if not already exists)
53+
python-version: ${{ needs.python.outputs.python-version }}
5954
venv-dir: ${{ env.VENV }}
6055
precommit-home: ${{ env.PRE_COMMIT_HOME }}
6156

@@ -70,20 +65,15 @@ jobs:
7065
uses: actions/checkout@v5
7166
with:
7267
persist-credentials: false
73-
- name: Set up Python ${{ needs.cache.outputs.python-version }}
74-
id: python
75-
uses: actions/setup-python@v6
76-
with:
77-
python-version: ${{ needs.cache.outputs.python-version }}
78-
- name: Create or reuse cache
68+
- name: Restore cached environment
7969
id: cache-reuse
80-
uses: ./.github/actions/restore-venv
70+
uses: plugwise/gh-actions/restore-venv@v1
8171
with:
8272
cache-key: ${{ needs.cache.outputs.cache-key }}
83-
python-version: ${{ steps.python.outputs.python-version }}
73+
python-version: ${{ needs.python.outputs.python-version }}
8474
venv-dir: ${{ env.VENV }}
8575
precommit-home: ${{ env.PRE_COMMIT_HOME }}
86-
- name: Ruff (check)
76+
- name: Ruff (with fix)
8777
run: |
8878
. venv/bin/activate
8979
ruff check plugwise_usb/ tests/
@@ -111,17 +101,12 @@ jobs:
111101
steps:
112102
- name: Check out committed code
113103
uses: actions/checkout@v5
114-
- name: Set up Python ${{ needs.cache.outputs.python-version }}
115-
id: python
116-
uses: actions/setup-python@v6
117-
with:
118-
python-version: ${{ needs.cache.outputs.python-version }}
119-
- name: Create or reuse cache
104+
- name: Restore cached environment
120105
id: cache-reuse
121-
uses: ./.github/actions/restore-venv
106+
uses: plugwise/ghactions/restore-venv@v1
122107
with:
123108
cache-key: ${{ needs.cache.outputs.cache-key }}
124-
python-version: ${{ steps.python.outputs.python-version }}
109+
python-version: ${{ needs.python.outputs.python-version }}
125110
venv-dir: ${{ env.VENV }}
126111
precommit-home: ${{ env.PRE_COMMIT_HOME }}
127112
- name: Verify commit
@@ -131,7 +116,7 @@ jobs:
131116
# - name: Biome lint
132117
# run: |
133118
# . venv/bin/activate
134-
# mkdir -p ./tmp && curl -sL "https://github.com/biomejs/biome/releases/download/%40biomejs%2Fbiome%402.0.0/biome-linux-x64" -o ./tmp/biome && chmod +x ./tmp/biome
119+
# mkdir -p ./tmp && curl -sL "https://github.com/biomejs/biome/releases/latest/download/biome-linux-x64" -o ./tmp/biome && chmod +x ./tmp/biome
135120
# pre-commit run --show-diff-on-failure --color=always --all-files --hook-stage manual biome
136121
- name: Lint markdown files
137122
run: |
@@ -147,22 +132,17 @@ jobs:
147132
- commitcheck
148133
strategy:
149134
matrix:
150-
python-version: ["3.13"]
135+
python-version: ["3.14", "3.13"]
151136
steps:
152137
- name: Check out committed code
153138
uses: actions/checkout@v5
154-
- name: Set up Python ${{ matrix.python-version }}
155-
id: python
156-
uses: actions/setup-python@v6
157-
with:
158-
python-version: ${{ matrix.python-version }}
159-
- name: Create or reuse cache
139+
- name: Restore cached environment
160140
id: cache-reuse
161-
uses: ./.github/actions/restore-venv
141+
uses: plugwise/ghactions/restore-venv@v1
162142
with:
143+
fail-on-miss: false # First time create cache (if not already exists)
163144
cache-key: ${{ needs.cache.outputs.cache-key }}-pytest-matrix-${{ matrix.python-version }}
164-
fail-on-miss: false # First time create cache (if not already exists)
165-
python-version: ${{ steps.python.outputs.python-version }} # Force to installed python minor
145+
python-version: ${{ needs.python.outputs.python-version }} # Force to installed python minor
166146
venv-dir: ${{ env.VENV }}
167147
precommit-home: ${{ env.PRE_COMMIT_HOME }}
168148
- name: Run all tests
@@ -190,17 +170,12 @@ jobs:
190170
uses: actions/checkout@v5
191171
with:
192172
persist-credentials: false
193-
- name: Set up Python ${{ needs.cache.outputs.python-version }}
194-
id: python
195-
uses: actions/setup-python@v6
196-
with:
197-
python-version: ${{ needs.cache.outputs.python-version }}
198-
- name: Create or reuse cache
173+
- name: Restore cached environment
199174
id: cache-reuse
200175
uses: ./.github/actions/restore-venv
201176
with:
202177
cache-key: ${{ needs.cache.outputs.cache-key }}
203-
python-version: ${{ steps.python.outputs.python-version }}
178+
python-version: ${{ needs.python.outputs.python-version }}
204179
venv-dir: ${{ env.VENV }}
205180
precommit-home: ${{ env.PRE_COMMIT_HOME }}
206181
- name: Run mypy
@@ -240,17 +215,12 @@ jobs:
240215
steps:
241216
- name: Check out committed code
242217
uses: actions/checkout@v5
243-
- name: Set up Python ${{ needs.cache.outputs.python-version }}
244-
id: python
245-
uses: actions/setup-python@v6
246-
with:
247-
python-version: ${{ needs.cache.outputs.python-version }}
248-
- name: Create or reuse cache
218+
- name: Restore cached environment
249219
id: cache-reuse
250-
uses: ./.github/actions/restore-venv
220+
uses: plugwise/gh-actions/restore-venv@v1
251221
with:
252222
cache-key: ${{ needs.cache.outputs.cache-key }}
253-
python-version: ${{ steps.python.outputs.python-version }}
223+
python-version: ${{ needs.python.outputs.python-version }}
254224
venv-dir: ${{ env.VENV }}
255225
precommit-home: ${{ env.PRE_COMMIT_HOME }}
256226
- name: Download all coverage artifacts
@@ -333,21 +303,16 @@ jobs:
333303
steps:
334304
- name: Check out committed code
335305
uses: actions/checkout@v5
336-
- name: Set up Python ${{ needs.cache.outputs.python-version }}
337-
id: python
338-
uses: actions/setup-python@v6
339-
with:
340-
python-version: ${{ needs.cache.outputs.python-version }}
341-
- name: Create or reuse cache
306+
- name: Restore cached environment
342307
id: cache-reuse
343-
uses: ./.github/actions/restore-venv
308+
uses: plugwise/gh-actions/restore-venv@v1
344309
with:
345310
cache-key: ${{ needs.cache.outputs.cache-key }}
346-
python-version: ${{ steps.python.outputs.python-version }}
311+
python-version: ${{ needs.python.outputs.python-version }}
347312
venv-dir: ${{ env.VENV }}
348313
precommit-home: ${{ env.PRE_COMMIT_HOME }}
349314
- name: Run complexity report (click to view details)
350315
run: |
351316
. venv/bin/activate
352317
echo "Showing complexity higher or equal to 'C'"
353-
radon cc plugwise/ tests/ -s -nc --no-assert
318+
radon cc plugwise_usb/ tests/ -s -nc --no-assert

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
default_language_version:
22
# force all unspecified python hooks to run python3
3-
python: python3.13
3+
python: python3.14
44

55
repos:
66
# Run manually in CI skipping the branch checks

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Changelog
22

3+
## Ongoing
4+
5+
- Test/validate for Python 3.14
6+
37
## v0.47.1 - 2025-09-27
48

59
- PR [351](https://github.com/plugwise/python-plugwise-usb/pull/351): Avoid unintentional overwrite of nodetype.cache file at start/reload.

pyproject.toml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ classifiers = [
1111
"Development Status :: 5 - Production/Stable",
1212
"Intended Audience :: Developers",
1313
"Operating System :: OS Independent",
14+
"Programming Language :: Python :: 3.14",
1415
"Programming Language :: Python :: 3.13",
1516
"Topic :: Home Automation",
1617
]
@@ -56,7 +57,7 @@ include = ["plugwise_usb*"]
5657
##
5758

5859
[tool.pylint.MAIN]
59-
py-version = "3.13"
60+
py-version = "3.14"
6061
# Use a conservative default here; 2 should speed up most setups and not hurt
6162
# any too bad. Override on command line as appropriate.
6263
jobs = 2
@@ -389,7 +390,7 @@ max-line-length-suggestions = 72
389390

390391

391392
[tool.mypy]
392-
python_version = "3.13"
393+
python_version = "3.14"
393394
show_error_codes = true
394395
follow_imports = "silent"
395396
ignore_missing_imports = true
@@ -419,7 +420,7 @@ omit= [
419420
]
420421

421422
[tool.ruff]
422-
target-version = "py313"
423+
target-version = "py314"
423424

424425
lint.select = [
425426
"B002", # Python does not support the unary prefix increment

0 commit comments

Comments
 (0)