Skip to content

Commit 90a76b6

Browse files
committed
Ensure local building, added changelog, black following
1 parent 4de8063 commit 90a76b6

File tree

7 files changed

+58
-39
lines changed

7 files changed

+58
-39
lines changed

.github/workflows/merge.yml

Lines changed: 2 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: 5
7+
CACHE_VERSION: 21
88
DEFAULT_PYTHON: "3.12"
99

1010
# Only run on merges
@@ -22,7 +22,7 @@ jobs:
2222
if: github.event.pull_request.merged == true
2323
steps:
2424
- name: Check out committed code
25-
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
25+
uses: actions/checkout@v4
2626
- name: Set up Python ${{ env.DEFAULT_PYTHON }}
2727
id: python
2828
uses: actions/setup-python@v5

.github/workflows/verify.yml

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

66
env:
7-
CACHE_VERSION: 6
7+
CACHE_VERSION: 22
88
DEFAULT_PYTHON: "3.12"
99
PRE_COMMIT_HOME: ~/.cache/pre-commit
1010

@@ -22,7 +22,7 @@ jobs:
2222
name: Prepare
2323
steps:
2424
- name: Check out committed code
25-
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
25+
uses: actions/checkout@v4
2626
- name: Set up Python ${{ env.DEFAULT_PYTHON }}
2727
id: python
2828
uses: actions/setup-python@v5
@@ -48,8 +48,9 @@ jobs:
4848
pip install virtualenv --upgrade
4949
python -m venv venv
5050
. venv/bin/activate
51-
pip install -U pip setuptools wheel
52-
pip install -r requirements_test.txt -r requirements_commit.txt
51+
pip install uv
52+
uv pip install -U pip setuptools wheel
53+
uv pip install -r requirements_test.txt -r requirements_commit.txt
5354
- name: Restore pre-commit environment from cache
5455
id: cache-precommit
5556
uses: actions/cache@v4
@@ -71,7 +72,7 @@ jobs:
7172
needs: prepare
7273
steps:
7374
- name: Check out committed code
74-
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
75+
uses: actions/checkout@v4
7576
with:
7677
persist-credentials: false
7778
- name: Set up Python ${{ env.DEFAULT_PYTHON }}
@@ -97,7 +98,7 @@ jobs:
9798
- name: Ruff (check)
9899
run: |
99100
. venv/bin/activate
100-
#ruff plugwise_usb/*py tests/*py
101+
#ruff check plugwise_usb/*py tests/*py
101102
echo "***"
102103
echo "***"
103104
echo "Code is not up to par for ruff, skipping"
@@ -107,7 +108,7 @@ jobs:
107108
if: failure()
108109
run: |
109110
. venv/bin/activate
110-
ruff --fix plugwise_usb/*py tests/*py
111+
ruff check --fix plugwise_usb/*py tests/*py
111112
git config --global user.name 'autoruff'
112113
git config --global user.email '[email protected]'
113114
git remote set-url origin https://x-access-token:${{ secrets.PAT_CT }}@github.com/$GITHUB_REPOSITORY
@@ -124,7 +125,7 @@ jobs:
124125
- dependencies_check
125126
steps:
126127
- name: Check out committed code
127-
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
128+
uses: actions/checkout@v4
128129
- name: Set up Python ${{ env.DEFAULT_PYTHON }}
129130
id: python
130131
uses: actions/setup-python@v5
@@ -175,7 +176,7 @@ jobs:
175176
python-version: ["3.12", "3.11", "3.10"]
176177
steps:
177178
- name: Check out committed code
178-
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
179+
uses: actions/checkout@v4
179180
- name: Set up Python ${{ matrix.python-version }}
180181
id: python
181182
uses: actions/setup-python@v5
@@ -199,11 +200,12 @@ jobs:
199200
run: |
200201
python -m venv venv
201202
. venv/bin/activate
202-
pip install -U pip setuptools wheel
203-
#pip install -r requirements_test.txt
203+
pip install uv
204+
uv pip install -U pip setuptools wheel
205+
uv #pip install -r requirements_test.txt
204206
# 20220124 Mimic setup_test.sh
205-
pip install --upgrade -r requirements_test.txt -c https://raw.githubusercontent.com/home-assistant/core/dev/homeassistant/package_constraints.txt -r https://raw.githubusercontent.com/home-assistant/core/dev/requirements_test.txt -r https://raw.githubusercontent.com/home-assistant/core/dev/requirements_test_pre_commit.txt
206-
pip install --upgrade pytest-asyncio
207+
uv pip install --upgrade -r requirements_test.txt -c https://raw.githubusercontent.com/home-assistant/core/dev/homeassistant/package_constraints.txt -r https://raw.githubusercontent.com/home-assistant/core/dev/requirements_test.txt -r https://raw.githubusercontent.com/home-assistant/core/dev/requirements_test_pre_commit.txt
208+
uv pip install --upgrade pytest-asyncio
207209
208210
pytest:
209211
runs-on: ubuntu-latest
@@ -215,7 +217,7 @@ jobs:
215217

216218
steps:
217219
- name: Check out committed code
218-
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
220+
uses: actions/checkout@v4
219221
- name: Set up Python ${{ matrix.python-version }}
220222
id: python
221223
uses: actions/setup-python@v5
@@ -251,7 +253,7 @@ jobs:
251253
needs: pytest
252254
steps:
253255
- name: Check out committed code
254-
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
256+
uses: actions/checkout@v4
255257
with:
256258
persist-credentials: false
257259
- name: Set up Python ${{ env.DEFAULT_PYTHON }}
@@ -291,7 +293,7 @@ jobs:
291293
runs-on: ubuntu-latest
292294
steps:
293295
- name: Check out committed code
294-
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
296+
uses: actions/checkout@v4
295297
- name: Run ShellCheck
296298
uses: ludeeus/action-shellcheck@master
297299

@@ -301,7 +303,7 @@ jobs:
301303
name: Dependency
302304
steps:
303305
- name: Check out committed code
304-
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
306+
uses: actions/checkout@v4
305307
- name: Run dependency checker
306308
run: scripts/dependencies_check.sh debug
307309

@@ -311,7 +313,7 @@ jobs:
311313
needs: pytest
312314
steps:
313315
- name: Check out committed code
314-
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
316+
uses: actions/checkout@v4
315317
- name: Set up Python ${{ env.DEFAULT_PYTHON }}
316318
id: python
317319
uses: actions/setup-python@v5
@@ -356,7 +358,7 @@ jobs:
356358
needs: [coverage, mypy]
357359
steps:
358360
- name: Check out committed code
359-
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
361+
uses: actions/checkout@v4
360362
- name: Set up Python ${{ env.DEFAULT_PYTHON }}
361363
id: python
362364
uses: actions/setup-python@v5
@@ -399,7 +401,7 @@ jobs:
399401
needs: coverage
400402
steps:
401403
- name: Check out committed code
402-
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
404+
uses: actions/checkout@v4
403405
- name: Set up Python ${{ env.DEFAULT_PYTHON }}
404406
id: python
405407
uses: actions/setup-python@v5

CHANGELOG.md

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

3+
## Ongoing
4+
5+
- Ensure CI process remains operational
6+
- Bumped pip to uv
7+
- As for latest HA Core USB team should rework to python 3.12 (not still 3.10)
8+
39
## v0.31.4(a0)
410

511
- Re-add python 3.12 checks and compatibility

pyproject.toml

Lines changed: 20 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,13 @@ authors = [
2323
{ name = "Plugwise device owners"}
2424
]
2525
maintainers = [
26+
{ name = "arnoutd_77" },
2627
{ name = "bouwew"},
2728
{ name = "brefra"},
28-
{ name = "CoMPaTech" }
29+
{ name = "CoMPaTech" },
30+
{ name = "dirixmjm" }
2931
]
30-
requires-python = ">=3.9.0"
32+
requires-python = ">=3.10.0"
3133
dependencies = [
3234
"aiohttp",
3335
"async_timeout",
@@ -50,6 +52,10 @@ include-package-data = true
5052
[tool.setuptools.packages.find]
5153
include = ["plugwise_usb*"]
5254

55+
[tool.black]
56+
target-version = ["py312"]
57+
exclude = 'generated'
58+
5359
[tool.isort]
5460
# https://github.com/PyCQA/isort/wiki/isort-Settings
5561
profile = "black"
@@ -183,7 +189,7 @@ norecursedirs = [
183189
]
184190

185191
[tool.mypy]
186-
python_version = "3.11"
192+
python_version = "3.12"
187193
show_error_codes = true
188194
follow_imports = "silent"
189195
ignore_missing_imports = true
@@ -215,12 +221,13 @@ omit= [
215221
[tool.ruff]
216222
target-version = "py312"
217223

218-
select = [
224+
lint.select = [
219225
"B002", # Python does not support the unary prefix increment
220226
"B007", # Loop control variable {name} not used within loop body
221227
"B014", # Exception handler with duplicate exception
222228
"B023", # Function definition does not bind loop variable {name}
223229
"B026", # Star-arg unpacking after a keyword argument is strongly discouraged
230+
"B904", # Use raise from err or None to specify exception cause
224231
"C", # complexity
225232
"COM818", # Trailing comma on bare tuple prohibited
226233
"D", # docstrings
@@ -235,7 +242,7 @@ select = [
235242
"N804", # First argument of a class method should be named cls
236243
"N805", # First argument of a method should be named self
237244
"N815", # Variable {name} in class scope should not be mixedCase
238-
"PGH001", # No builtin eval() allowed
245+
# "PGH001", # No builtin eval() allowed remapped to S307
239246
"PGH004", # Use specific rule codes when using noqa
240247
"PL", # https://github.com/astral-sh/ruff/issues/7491#issuecomment-1730008111
241248
"PLC0414", # Useless import alias. Import alias does not rename original package.
@@ -275,13 +282,13 @@ select = [
275282
"T20", # flake8-print
276283
"TID251", # Banned imports
277284
"TRY004", # Prefer TypeError exception for invalid type
278-
"TRY200", # Use raise from to specify exception cause
285+
# "TRY200", # Use raise from to specify exception cause
279286
"TRY302", # Remove exception handler; error is immediately re-raised
280287
"UP", # pyupgrade
281288
"W", # pycodestyle
282289
]
283290

284-
ignore = [
291+
lint.ignore = [
285292
"D202", # No blank lines allowed after function docstring
286293
"D203", # 1 blank line required before class docstring
287294
"D213", # Multi-line docstring summary should start at the second line
@@ -305,24 +312,24 @@ ignore = [
305312

306313
exclude = []
307314

308-
[tool.ruff.flake8-import-conventions.extend-aliases]
315+
[tool.ruff.lint.flake8-import-conventions.extend-aliases]
309316
voluptuous = "vol"
310317
"homeassistant.helpers.area_registry" = "ar"
311318
"homeassistant.helpers.config_validation" = "cv"
312319
"homeassistant.helpers.device_registry" = "dr"
313320
"homeassistant.helpers.entity_registry" = "er"
314321
"homeassistant.helpers.issue_registry" = "ir"
315322

316-
[tool.ruff.flake8-pytest-style]
323+
[tool.ruff.lint.flake8-pytest-style]
317324
fixture-parentheses = false
318325

319-
[tool.ruff.mccabe]
326+
[tool.ruff.lint.mccabe]
320327
max-complexity = 25
321328

322-
[tool.ruff.flake8-tidy-imports.banned-api]
329+
[tool.ruff.lint.flake8-tidy-imports.banned-api]
323330
"pytz".msg = "use zoneinfo instead"
324331

325-
[tool.ruff.isort]
332+
[tool.ruff.lint.isort]
326333
force-sort-within-sections = true
327334
section-order = ["future", "standard-library", "first-party", "third-party", "local-folder"]
328335
known-third-party = [
@@ -338,3 +345,4 @@ forced-separate = [
338345
]
339346
combine-as-imports = true
340347
split-on-trailing-comma = false
348+

scripts/setup.sh

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,9 @@ if [ -f "${my_venv}/bin/activate" ]; then
1111
# shellcheck disable=SC1091
1212
. "${my_venv}/bin/activate"
1313
# Install commit requirements
14-
pip install wheel
15-
pip install --upgrade -e . -r requirements_commit.txt -c https://raw.githubusercontent.com/home-assistant/core/dev/homeassistant/package_constraints.txt -r https://raw.githubusercontent.com/home-assistant/core/dev/requirements_test_pre_commit.txt
14+
pip install uv
15+
uv pip install wheel
16+
uv pip install --upgrade -e . -r requirements_commit.txt -c https://raw.githubusercontent.com/home-assistant/core/dev/homeassistant/package_constraints.txt -r https://raw.githubusercontent.com/home-assistant/core/dev/requirements_test_pre_commit.txt
1617
# Install pre-commit hook
1718
"${my_venv}/bin/pre-commit" install
1819
else

scripts/setup_test.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@ if [ -f "${my_venv}/bin/activate" ]; then
1111
# shellcheck disable=SC1091
1212
. "${my_venv}/bin/activate"
1313
# Install test requirements
14-
pip install --upgrade -e . -r requirements_test.txt -c https://raw.githubusercontent.com/home-assistant/core/dev/homeassistant/package_constraints.txt -r https://raw.githubusercontent.com/home-assistant/core/dev/requirements_test.txt -r https://raw.githubusercontent.com/home-assistant/core/dev/requirements_test_pre_commit.txt
14+
pip install uv
15+
uv pip install --upgrade -e . -r requirements_test.txt -c https://raw.githubusercontent.com/home-assistant/core/dev/homeassistant/package_constraints.txt -r https://raw.githubusercontent.com/home-assistant/core/dev/requirements_test.txt -r https://raw.githubusercontent.com/home-assistant/core/dev/requirements_test_pre_commit.txt
1516
# Install pre-commit hook
1617
"${my_venv}/bin/pre-commit" install
1718
else

scripts/tests_and_coverage.sh

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,9 @@ if [ -z "${GITHUB_ACTIONS}" ] || [ "$1" == "linting" ] ; then
3131
echo "... black-ing ..."
3232
black plugwise_usb/ tests/
3333

34-
echo "... ruff-ing ..."
35-
ruff plugwise_usb/ tests/
34+
# TODO: Skip ruff checks as there are too many for now (mainly missing docstrings)
35+
# echo "... ruff-ing ..."
36+
# ruff check --fix plugwise_usb/ tests/
3637

3738
echo "... pylint-ing ..."
3839
pylint plugwise_usb/ tests/

0 commit comments

Comments
 (0)