Skip to content

Commit af974b3

Browse files
authored
Merge pull request #891 from plugwise/pep740
Add PEP 740 and pin GitHub actions
2 parents e9e558f + 7137dfb commit af974b3

3 files changed

Lines changed: 37 additions & 26 deletions

File tree

.github/workflows/merge.yml

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

66
env:
7-
CACHE_VERSION: 11
7+
CACHE_VERSION: 4
88
DEFAULT_PYTHON: "3.14"
99

1010
# Only run on merges
@@ -26,7 +26,7 @@ jobs:
2626
if: github.event.pull_request.merged == true
2727
steps:
2828
- name: Check out committed code
29-
uses: actions/checkout@v7
29+
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0
3030
- name: Prepare uv
3131
run: |
3232
pip install uv
@@ -54,6 +54,9 @@ jobs:
5454
run: |
5555
. venv/bin/activate
5656
uv build
57+
- name: Generate PEP 740 Attestations
58+
if: steps.check_package.outputs.should_publish == 'true'
59+
uses: astral-sh/attest-action@f589a42a7efb6fe400b4f400de60b4bc90390027
5760
- name: Publish distribution 📦 to PyPI
5861
if: steps.check_package.outputs.should_publish == 'true'
5962
run: |

.github/workflows/verify.yml

Lines changed: 27 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
name: Latest commit
55

66
env:
7-
CACHE_VERSION: 3
7+
CACHE_VERSION: 4
88
DEFAULT_PYTHON: "3.14"
99
VENV: venv
1010

@@ -25,10 +25,10 @@ jobs:
2525
python-version: ${{ steps.python.outputs.python-version }} # Ensure all runners use THIS minor version
2626
steps:
2727
- name: Check out committed code
28-
uses: actions/checkout@v7
28+
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0
2929
- name: Set up Python and determine minor version for ${{ env.DEFAULT_PYTHON }}
3030
id: python
31-
uses: actions/setup-python@v6
31+
uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1
3232
with:
3333
python-version: ${{ env.DEFAULT_PYTHON }}
3434
- name: Fetch HA pyproject
@@ -46,7 +46,7 @@ jobs:
4646
steps:
4747
- name: Prepare code checkout and python/prek(pre-commit) setup
4848
id: cache-reuse
49-
uses: plugwise/gh-actions/prepare-python-and-code@v2
49+
uses: plugwise/gh-actions/prepare-python-and-code@9054f02b05e53697300c41df27d0307332dc7cd8
5050
with:
5151
cache-key: ${{ needs.cache.outputs.cache-key }}
5252
fail-on-miss: false # First time create cache (if not already exists)
@@ -62,12 +62,12 @@ jobs:
6262
- prepare
6363
steps:
6464
- name: Check out committed code
65-
uses: actions/checkout@v7
65+
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0
6666
with:
6767
persist-credentials: false
6868
- name: Restore cached environment
6969
id: cache-reuse
70-
uses: plugwise/gh-actions/restore-venv@v2
70+
uses: plugwise/gh-actions/restore-venv@9054f02b05e53697300c41df27d0307332dc7cd8
7171
with:
7272
cache-key: ${{ needs.cache.outputs.cache-key }}
7373
python-version: ${{ needs.cache.outputs.python-version }}
@@ -100,10 +100,10 @@ jobs:
100100
- dependencies_check
101101
steps:
102102
- name: Check out committed code
103-
uses: actions/checkout@v7
103+
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0
104104
- name: Restore cached environment
105105
id: cache-reuse
106-
uses: plugwise/gh-actions/restore-venv@v2
106+
uses: plugwise/gh-actions/restore-venv@9054f02b05e53697300c41df27d0307332dc7cd8
107107
with:
108108
cache-key: ${{ needs.cache.outputs.cache-key }}
109109
python-version: ${{ needs.cache.outputs.python-version }}
@@ -130,15 +130,15 @@ jobs:
130130
python-version: ["3.14", "3.13"]
131131
steps:
132132
- name: Check out committed code
133-
uses: actions/checkout@v7
133+
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0
134134
- name: Set up Python ${{ matrix.python-version }}
135135
id: python
136-
uses: actions/setup-python@v6
136+
uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1
137137
with:
138138
python-version: ${{ matrix.python-version }}
139139
- name: Restore cached environment
140140
id: cache-reuse
141-
uses: plugwise/gh-actions/restore-venv@v2
141+
uses: plugwise/gh-actions/restore-venv@9054f02b05e53697300c41df27d0307332dc7cd8
142142
with:
143143
fail-on-miss: false # First time create cache (if not already exists)
144144
cache-key: ${{ needs.cache.outputs.cache-key }}
@@ -150,7 +150,7 @@ jobs:
150150
. venv-${{ steps.python.outputs.python-version }}/bin/activate
151151
pytest --log-level info tests/*.py --cov='.'
152152
- name: Upload coverage artifact
153-
uses: actions/upload-artifact@v7
153+
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a
154154
with:
155155
name: coverage-${{ steps.python.outputs.python-version }}
156156
path: .coverage
@@ -166,12 +166,12 @@ jobs:
166166
- pytest
167167
steps:
168168
- name: Check out committed code
169-
uses: actions/checkout@v7
169+
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0
170170
with:
171171
persist-credentials: false
172172
- name: Restore cached environment
173173
id: cache-reuse
174-
uses: plugwise/gh-actions/restore-venv@v2
174+
uses: plugwise/gh-actions/restore-venv@9054f02b05e53697300c41df27d0307332dc7cd8
175175
with:
176176
cache-key: ${{ needs.cache.outputs.cache-key }}
177177
python-version: ${{ needs.cache.outputs.python-version }}
@@ -189,17 +189,17 @@ jobs:
189189
runs-on: ubuntu-latest
190190
steps:
191191
- name: Check out committed code
192-
uses: actions/checkout@v7
192+
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0
193193
- name: Run ShellCheck
194-
uses: ludeeus/action-shellcheck@master
194+
uses: ludeeus/action-shellcheck@00cae500b08a931fb5698e11e79bfbd38e612a38
195195

196196
# Check for missing python dependencies
197197
dependencies_check:
198198
runs-on: ubuntu-latest
199199
name: Dependency
200200
steps:
201201
- name: Check out committed code
202-
uses: actions/checkout@v7
202+
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0
203203
- name: Run dependency checker
204204
run: scripts/dependencies_check.sh debug
205205

@@ -213,17 +213,17 @@ jobs:
213213
- mypy
214214
steps:
215215
- name: Check out committed code
216-
uses: actions/checkout@v7
216+
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0
217217
- name: Restore cached environment
218218
id: cache-reuse
219-
uses: plugwise/gh-actions/restore-venv@v2
219+
uses: plugwise/gh-actions/restore-venv@9054f02b05e53697300c41df27d0307332dc7cd8
220220
with:
221221
cache-key: ${{ needs.cache.outputs.cache-key }}
222222
python-version: ${{ needs.cache.outputs.python-version }}
223223
venv-dir: ${{ env.VENV }}
224224
prek-home: ${{ env.PREK_HOME }}
225225
- name: Download all coverage artifacts
226-
uses: actions/download-artifact@v8
226+
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c
227227
with:
228228
pattern: coverage-*
229229
merge-multiple: true
@@ -235,7 +235,7 @@ jobs:
235235
coverage report --fail-under=94
236236
coverage xml
237237
- name: Upload coverage to Codecov
238-
uses: codecov/codecov-action@v7
238+
uses: codecov/codecov-action@fb8b3582c8e4def4969c97caa2f19720cb33a72f
239239
env:
240240
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
241241

@@ -253,7 +253,7 @@ jobs:
253253
- mypy
254254
steps:
255255
- name: Check out committed code
256-
uses: actions/checkout@v7
256+
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0
257257
- name: Prepare uv
258258
run: |
259259
pip install uv
@@ -280,6 +280,9 @@ jobs:
280280
run: |
281281
. venv/bin/activate
282282
uv build
283+
- name: Generate PEP 740 Attestations
284+
if: steps.check_package.outputs.should_publish == 'true'
285+
uses: astral-sh/attest-action@f589a42a7efb6fe400b4f400de60b4bc90390027
283286
- name: Publish distribution 📦 to TestPyPI
284287
if: steps.check_package.outputs.should_publish == 'true'
285288
run: |
@@ -295,10 +298,10 @@ jobs:
295298
- coverage
296299
steps:
297300
- name: Check out committed code
298-
uses: actions/checkout@v7
301+
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0
299302
- name: Restore cached environment
300303
id: cache-reuse
301-
uses: plugwise/gh-actions/restore-venv@v2
304+
uses: plugwise/gh-actions/restore-venv@9054f02b05e53697300c41df27d0307332dc7cd8
302305
with:
303306
cache-key: ${{ needs.cache.outputs.cache-key }}
304307
python-version: ${{ needs.cache.outputs.python-version }}

CHANGELOG.md

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

3+
## Ongoing
4+
5+
- Add PEP 740 digital attestations (workaround until included in `uv publish`)
6+
- Pin GitHub acions including our own from gh-actions
7+
38
## v1.12.0
49

510
- Replace the DHW-comfort-mode switch by a DHW mode selector to match the new HA select or water_heater platform updates, via PR [#883](https://github.com/plugwise/python-plugwise/pull/883)

0 commit comments

Comments
 (0)