Skip to content

Commit feacac9

Browse files
committed
updates
1 parent 079508f commit feacac9

7 files changed

Lines changed: 606 additions & 526 deletions

File tree

‎.github/workflows/ci.yml‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@ on:
2424
- ".github/workflows/ci.yml"
2525

2626
env:
27-
RUFF_VERSION: 0.12.2
28-
UV_VERSION: 0.7.21
27+
RUFF_VERSION: 0.12.12
28+
UV_VERSION: 0.8.19
2929
TEST_TARGET: "src"
3030

3131
jobs:
@@ -48,7 +48,7 @@ jobs:
4848
steps:
4949
- uses: actions/checkout@v5
5050
- name: "Set up Python"
51-
uses: actions/setup-python@v5
51+
uses: actions/setup-python@v6
5252
with:
5353
python-version-file: "pyproject.toml"
5454
- name: Install uv
@@ -73,7 +73,7 @@ jobs:
7373
steps:
7474
- uses: actions/checkout@v5
7575
- name: "Set up Python"
76-
uses: actions/setup-python@v5
76+
uses: actions/setup-python@v6
7777
with:
7878
python-version: ${{ matrix.python-version }}
7979
- name: Install uv
@@ -102,7 +102,7 @@ jobs:
102102
steps:
103103
- uses: actions/checkout@v5
104104
- name: "Set up Python"
105-
uses: actions/setup-python@v5
105+
uses: actions/setup-python@v6
106106
with:
107107
python-version-file: "pyproject.toml"
108108
- name: Install uv

‎.github/workflows/deploy-docs.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717
runs-on: ubuntu-latest
1818
steps:
1919
- uses: actions/checkout@v5
20-
- uses: actions/setup-node@v4
20+
- uses: actions/setup-node@v5
2121
with:
2222
node-version: 18
2323
- run: npm ci

‎.pre-commit-config.yaml‎

Lines changed: 28 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,45 @@
11
repos:
22
- repo: https://github.com/astral-sh/uv-pre-commit
3-
rev: 0.7.21
3+
rev: 0.8.19
44
hooks:
55
- id: uv-lock
66

7-
- repo: https://github.com/astral-sh/ruff-pre-commit
8-
rev: v0.12.2
7+
- repo: local
98
hooks:
9+
- id: pyproject-fmt
10+
name: pyproject-fmt
11+
entry: uv run pyproject-fmt pyproject.toml
12+
language: system
13+
pass_filenames: false
14+
1015
- id: ruff-check
11-
args: [--fix, --exit-non-zero-on-fix]
16+
name: ruff-check
17+
entry: uv run ruff check --fix --exit-non-zero-on-fix
18+
language: system
19+
pass_filenames: false
20+
1221
- id: ruff-format
22+
name: ruff-format
23+
entry: uv run ruff format --exit-non-zero-on-fix
24+
language: system
25+
pass_filenames: false
1326

14-
- repo: https://github.com/codespell-project/codespell
15-
rev: v2.4.1
16-
hooks:
1727
- id: codespell
18-
files: "src/.*.py"
19-
args:
20-
- "--ignore-words-list"
21-
- HASS,hass,Hass,ist
22-
- --skip
23-
- "package-lock.json,*.map,www/docs/.vitepress/cache/*"
24-
- id: codespell
25-
files: "hass-addon-[a-z]+/.*"
26-
args:
27-
- -L
28-
- HASS,hass,Hass
28+
name: codespell
29+
entry: uv run codespell --toml pyproject.toml
30+
language: system
31+
pass_filenames: false
2932

30-
- repo: local
31-
hooks:
3233
- id: mypy
3334
name: mypy
3435
entry: uv run mypy . --config-file pyproject.toml
3536
language: system
3637
types: [python]
3738
pass_filenames: false
39+
40+
- id: pytest
41+
name: pytest
42+
entry: uv run pytest
43+
language: system
44+
types: [python]
45+
pass_filenames: false

‎hass-addon-sunsynk-multi/Dockerfile‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ COPY sunsynk sunsynk
1212
RUN set -x \
1313
# && apk add --no-cache --virtual .build-deps \
1414
# build-base \
15-
&& curl -LsSf https://astral.sh/uv/0.7.21/install.sh | sh \
15+
&& curl -LsSf https://astral.sh/uv/0.8.19/install.sh | sh \
1616
&& uv venv \
1717
&& uv pip install --index-strategy unsafe-best-match \
1818
./sunsynk[umodbus,solarman]
Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# https://github.com/home-assistant/docker-base
22
build_from:
3-
aarch64: "ghcr.io/home-assistant/aarch64-base-python:3.12-alpine3.21"
4-
amd64: "ghcr.io/home-assistant/amd64-base-python:3.12-alpine3.21"
5-
armhf: "ghcr.io/home-assistant/armhf-base-python:3.12-alpine3.21"
6-
armv7: "ghcr.io/home-assistant/armv7-base-python:3.12-alpine3.21"
7-
i386: "ghcr.io/home-assistant/i386-base-python:3.12-alpine3.21"
3+
aarch64: "ghcr.io/home-assistant/aarch64-base-python:3.13-alpine3.22"
4+
amd64: "ghcr.io/home-assistant/amd64-base-python:3.13-alpine3.22"
5+
armhf: "ghcr.io/home-assistant/armhf-base-python:3.13-alpine3.22"
6+
armv7: "ghcr.io/home-assistant/armv7-base-python:3.13-alpine3.22"
7+
i386: "ghcr.io/home-assistant/i386-base-python:3.13-alpine3.22"

‎pyproject.toml‎

Lines changed: 93 additions & 95 deletions
Original file line numberDiff line numberDiff line change
@@ -1,95 +1,93 @@
1-
[build-system]
2-
requires = ["setuptools", "setuptools-scm"]
3-
build-backend = "setuptools.build_meta"
4-
5-
[tool.setuptools]
6-
license-files = [] # https://github.com/astral-sh/uv/issues/9513
7-
8-
[project]
9-
name = "sunsynk"
10-
version = "0.9.0"
11-
description = "Library to interface Deye/Sunsynk Hybrid Inverters"
12-
keywords = ["sunsynk", "deye", "inverter", "modbus", "asyncio"]
13-
readme = "README.md"
14-
authors = [{ name = "Johann Kellerman", email = "kellerza@gmail.com" }]
15-
license = { text = "Apache-2.0" }
16-
classifiers = [
17-
"Development Status :: 4 - Beta",
18-
"Intended Audience :: Developers",
19-
"Natural Language :: English",
20-
"Programming Language :: Python :: 3",
21-
"Programming Language :: Python :: 3 :: Only",
22-
"Programming Language :: Python :: 3.12",
23-
"Programming Language :: Python :: 3.13",
24-
]
25-
requires-python = ">=3.12"
26-
dependencies = [
27-
"attrs>=25,<26",
28-
"cattrs>=25,<26",
29-
"mqtt-entity[options]>=1,<2",
30-
"prettytable==3.16.0",
31-
"pymodbus[serial]==3.9.2",
32-
]
33-
34-
[project.urls]
35-
Homepage = "https://kellerza.github.io/sunsynk/"
36-
37-
[project.optional-dependencies]
38-
umodbus = ["async_modbus==0.2.2", "connio==0.2.0", "umodbus==1.0.4"]
39-
solarman = ["pysolarmanv5==3.0.6"]
40-
41-
[dependency-groups]
42-
dev = [
43-
"mypy",
44-
"pytest-asyncio",
45-
"pytest-cov",
46-
"pytest-github-actions-annotate-failures",
47-
"pytest",
48-
"types-PyYAML",
49-
]
50-
51-
[tool.mypy]
52-
disallow_untyped_defs = true
53-
ignore_missing_imports = true
54-
exclude = "build/.*"
55-
enable_error_code = ["ignore-without-code"]
56-
57-
[tool.pytest.ini_options]
58-
pythonpath = [".", "src"]
59-
filterwarnings = "ignore:.+@coroutine.+deprecated.+"
60-
testpaths = "src\tests"
61-
norecursedirs = [".git", "modules"]
62-
log_cli = true
63-
log_cli_level = "DEBUG"
64-
asyncio_mode = "auto"
65-
addopts = "--cov=src --cov-report xml:cov.xml"
66-
67-
[tool.ruff]
68-
include = ["src/**/*.py"]
69-
70-
[tool.ruff.format]
71-
line-ending = "lf"
72-
docstring-code-format = true
73-
74-
[tool.ruff.lint]
75-
select = [
76-
"A", # flake8-builtins
77-
"ASYNC", # flake8-async
78-
"B", # bugbear
79-
"D", # pydocstyle
80-
"E", # pycodestyle
81-
"F", # pyflakes
82-
"I", # isort
83-
"PGH", # pygrep-hooks
84-
"PIE", # flake8-pie
85-
"PL", # pylint
86-
"PTH", # flake8-pathlib
87-
"PYI", # flake8-pyi
88-
"RUF", # ruff
89-
"UP", # pyupgrade
90-
"W", # pycodestyle
91-
]
92-
ignore = ["E203", "E501", "D203", "D213", "PLR2004"]
93-
94-
[tool.ruff.lint.pylint]
95-
max-args = 7
1+
[build-system]
2+
build-backend = "setuptools.build_meta"
3+
4+
requires = [ "setuptools", "setuptools-scm" ]
5+
6+
[project]
7+
name = "sunsynk"
8+
version = "0.9.0"
9+
description = "Library to interface Deye/Sunsynk Hybrid Inverters"
10+
readme = "README.md"
11+
keywords = [ "asyncio", "deye", "inverter", "modbus", "sunsynk" ]
12+
license = { text = "Apache-2.0" }
13+
authors = [ { name = "Johann Kellerman", email = "kellerza@gmail.com" } ]
14+
requires-python = ">=3.12"
15+
classifiers = [
16+
"Development Status :: 4 - Beta",
17+
"Intended Audience :: Developers",
18+
"Natural Language :: English",
19+
"Programming Language :: Python :: 3 :: Only",
20+
"Programming Language :: Python :: 3.12",
21+
"Programming Language :: Python :: 3.13",
22+
]
23+
dependencies = [
24+
"attrs>=25,<26",
25+
"cattrs>=25,<26",
26+
"mqtt-entity[options]>=1,<2",
27+
"prettytable==3.16",
28+
"pymodbus[serial]==3.11.2",
29+
]
30+
31+
optional-dependencies.solarman = [ "pysolarmanv5==3.0.6" ]
32+
optional-dependencies.umodbus = [ "async-modbus==0.2.2", "connio==0.2", "umodbus==1.0.4" ]
33+
urls.Homepage = "https://kellerza.github.io/sunsynk/"
34+
35+
[dependency-groups]
36+
dev = [
37+
"codespell>=2.4.1",
38+
"mypy",
39+
"pyproject-fmt>=2.6",
40+
"pytest",
41+
"pytest-asyncio",
42+
"pytest-cov",
43+
"pytest-github-actions-annotate-failures",
44+
"types-pyyaml",
45+
]
46+
47+
[tool.setuptools]
48+
license-files = [ ] # https://github.com/astral-sh/uv/issues/9513
49+
50+
[tool.ruff]
51+
include = [ "src/**/*.py" ]
52+
53+
format.line-ending = "lf"
54+
format.docstring-code-format = true
55+
lint.select = [
56+
"A", # flake8-builtins
57+
"ASYNC", # flake8-async
58+
"B", # bugbear
59+
"D", # pydocstyle
60+
"E", # pycodestyle
61+
"F", # pyflakes
62+
"I", # isort
63+
"PGH", # pygrep-hooks
64+
"PIE", # flake8-pie
65+
"PL", # pylint
66+
"PTH", # flake8-pathlib
67+
"PYI", # flake8-pyi
68+
"RUF", # ruff
69+
"UP", # pyupgrade
70+
"W", # pycodestyle
71+
]
72+
lint.ignore = [ "D203", "D213", "E203", "E501", "PLR2004" ]
73+
lint.pylint.max-args = 7
74+
75+
[tool.codespell]
76+
skip = "data,*.map,package-lock.json,*.map,www/docs/.vitepress/cache/*"
77+
ignore-words-list = "HASS,hass,Hass,ist"
78+
79+
[tool.pytest.ini_options]
80+
pythonpath = [ ".", "src" ]
81+
filterwarnings = "ignore:.+@coroutine.+deprecated.+"
82+
testpaths = "src\tests"
83+
norecursedirs = [ ".git", "modules" ]
84+
log_cli = true
85+
log_cli_level = "DEBUG"
86+
asyncio_mode = "auto"
87+
addopts = "--cov=src --cov-report xml:cov.xml"
88+
89+
[tool.mypy]
90+
disallow_untyped_defs = true
91+
ignore_missing_imports = true
92+
exclude = "build/.*"
93+
enable_error_code = [ "ignore-without-code" ]

0 commit comments

Comments
 (0)