Skip to content

Commit a0834cf

Browse files
committed
Deps & scripts
1 parent e34e7e0 commit a0834cf

4 files changed

Lines changed: 310 additions & 300 deletions

File tree

‎.github/workflows/ci.yml‎

Lines changed: 2 additions & 2 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.14.14
28-
UV_VERSION: 0.9.26
27+
RUFF_VERSION: 0.15.0
28+
UV_VERSION: 0.9.29
2929

3030
jobs:
3131
ruff:

‎pyproject.toml‎

Lines changed: 87 additions & 93 deletions
Original file line numberDiff line numberDiff line change
@@ -1,93 +1,87 @@
1-
[build-system]
2-
build-backend = "uv_build"
3-
requires = [ "uv-build>=0.9,<0.10" ]
4-
5-
[project]
6-
name = "sunsynk"
7-
version = "0.9.3"
8-
description = "Library to interface Deye/Sunsynk Hybrid Inverters"
9-
readme = "README.md"
10-
keywords = [ "asyncio", "deye", "inverter", "modbus", "sunsynk" ]
11-
license = "Apache-2.0"
12-
license-files = [ "LICENSE" ]
13-
authors = [ { name = "Johann Kellerman", email = "kellerza@gmail.com" } ]
14-
requires-python = ">=3.12"
15-
classifiers = [
16-
"Development Status :: 5 - Production/Stable",
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-
"Programming Language :: Python :: 3.14",
23-
]
24-
dependencies = [
25-
"attrs>=25,<26",
26-
"cattrs>=25,<26",
27-
"mqtt-entity[options]>=1,<2",
28-
"prettytable>=3.17,<4",
29-
"pymodbus[serial]==3.11.4",
30-
]
31-
optional-dependencies.solarman = [ "pysolarmanv5==3.0.6" ]
32-
optional-dependencies.umodbus = [ "async-modbus==0.2.3", "connio==0.2", "umodbus==1.0.4" ]
33-
urls.Homepage = "https://kellerza.github.io/sunsynk/"
34-
urls.Source = "https://github.com/kellerza/sunsynk"
35-
36-
[dependency-groups]
37-
dev = [
38-
"codespell",
39-
"pyproject-fmt",
40-
"pyright",
41-
"pytest",
42-
"pytest-asyncio",
43-
"pytest-cov",
44-
"pytest-github-actions-annotate-failures",
45-
"types-pyyaml",
46-
]
47-
48-
[tool.uv.build-backend]
49-
module-name = [ "sunsynk", "ha_addon_sunsynk_multi" ]
50-
51-
[tool.ruff]
52-
include = [ "src/**/*.py" ]
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,**/cache/*,**/node_modules/*"
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" ]
1+
[build-system]
2+
build-backend = "uv_build"
3+
requires = [ "uv-build>=0.9,<0.10" ]
4+
5+
[project]
6+
name = "sunsynk"
7+
version = "0.9.3"
8+
description = "Library to interface Deye/Sunsynk Hybrid Inverters"
9+
readme = "README.md"
10+
keywords = [ "asyncio", "deye", "inverter", "modbus", "sunsynk" ]
11+
license = "Apache-2.0"
12+
license-files = [ "LICENSE" ]
13+
authors = [ { name = "Johann Kellerman", email = "kellerza@gmail.com" } ]
14+
requires-python = ">=3.12"
15+
classifiers = [
16+
"Development Status :: 5 - Production/Stable",
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+
"Programming Language :: Python :: 3.14",
23+
]
24+
dependencies = [
25+
"attrs>=25,<26",
26+
"cattrs>=25,<26",
27+
"mqtt-entity[options]>=1,<2",
28+
"prettytable>=3.17,<4",
29+
"pymodbus[serial]==3.11.4",
30+
]
31+
optional-dependencies.solarman = [ "pysolarmanv5==3.0.6" ]
32+
optional-dependencies.umodbus = [ "async-modbus==0.2.3", "connio==0.2", "umodbus==1.0.4" ]
33+
urls.Homepage = "https://kellerza.github.io/sunsynk/"
34+
urls.Source = "https://github.com/kellerza/sunsynk"
35+
36+
[dependency-groups]
37+
dev = [
38+
"codespell",
39+
"pyproject-fmt",
40+
"pyright",
41+
"pytest",
42+
"pytest-asyncio",
43+
"pytest-cov",
44+
"pytest-github-actions-annotate-failures",
45+
"types-pyyaml",
46+
]
47+
48+
[tool.uv]
49+
build-backend.module-name = [ "sunsynk", "ha_addon_sunsynk_multi" ]
50+
51+
[tool.ruff]
52+
include = [ "src/**/*.py" ]
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,**/cache/*,**/node_modules/*"
77+
ignore-words-list = "HASS,hass,Hass,ist"
78+
79+
[tool.pytest]
80+
ini_options.pythonpath = [ ".", "src" ]
81+
ini_options.filterwarnings = "ignore:.+@coroutine.+deprecated.+"
82+
ini_options.testpaths = "src\tests"
83+
ini_options.norecursedirs = [ ".git", "modules" ]
84+
ini_options.log_cli = true
85+
ini_options.log_cli_level = "DEBUG"
86+
ini_options.asyncio_mode = "auto"
87+
ini_options.addopts = "--cov=src --cov-report xml:cov.xml"

‎scripts/copy2local.cmd‎

Lines changed: 30 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,43 @@
11
@echo off
2-
CALL :copy_ss hass-addon-sunsynk-multi,\\192.168.1.8\addons\hass-addon-sunsynk-multi
3-
CALL :copy_addon hass-addon-mbusd,\\192.168.1.8\addons\hass-addon-mbusd
2+
set DEST=\\192.168.1.8\addons
3+
CALL :copy_sunsynk hass-addon-sunsynk-edge
4+
CALL :copy_addon hass-addon-sunsynk-edge
5+
CALL :copy_builder hass-addon-sunsynk-edge
46

5-
EXIT /B %ERRORLEVEL%
6-
7-
:copy_ss
7+
rem CALL :copy_config hass-addon-mbusd,\\192.168.1.8\addons\hass-addon-mbusd
8+
rem CALL :copy__addon hass-addon-mbusd,\\192.168.1.8\addons\hass-addon-mbusd
89

9-
echo # Copy sunsynk package
10-
for %%f in (pyproject.toml,MANIFEST.in,LICENSE,README.md,uv.lock) do xcopy /Y "%%f" %~2\sunsynk\
11-
xcopy /Y /S /EXCLUDE:scripts\copyexclude.txt src %~2\sunsynk\src\
10+
EXIT /B %ERRORLEVEL%
1211

12+
:copy_sunsynk
13+
CALL :print "Copy sunsynk package for '%~1'"
14+
for %%f in (pyproject.toml,MANIFEST.in,LICENSE,README.md,uv.lock) do xcopy /Y "%%f" %DEST%\%~1\sunsynk\
15+
xcopy /Y /S /EXCLUDE:scripts\copyexclude.txt src %DEST%\%~1\sunsynk\src\
1316

1417
:copy_addon
15-
echo # Modify Config for local testing
18+
CALL :print "Copy '%~1' to '%DEST%\%~1'"
19+
xcopy /Y /S /EXCLUDE:scripts\copyexclude.txt %~1 %DEST%\%~1
20+
EXIT /B 0
21+
22+
CALL :print "Modify Config for local testing"
1623
set cf=%~1\config.localtest.yaml
1724
cp %~1\config.yaml %cf%
1825
sed -i 's/image:/# image:/' %cf%
1926
sed -i 's/name: /name: A_LOCAL /' %cf%
20-
xcopy /Y %cf% %~2\config.yaml
21-
echo 0.0.0 > %~1\VERSION
27+
xcopy /Y %cf% %DEST%\%~1\config.yaml*
28+
EXIT /B 0
2229

23-
echo # Copy '%~1' to '%~2'
24-
xcopy /Y /S /EXCLUDE:scripts\copyexclude.txt %~1 %~2
30+
:copy_builder
31+
CALL :print "Copy builder files for '%~1'"
32+
xcopy /Y hass-addon-sunsynk-multi\Dockerfile %DEST%\%~1\
33+
xcopy /Y hass-addon-sunsynk-multi\build.yaml %DEST%\%~1\
34+
xcopy /Y /S hass-addon-sunsynk-multi\rootfs %DEST%\%~1\rootfs\
35+
echo 0.0.0 > %DEST%\%~1\VERSION
36+
EXIT /B 0
2537

38+
:print
39+
echo.
40+
echo %~1
41+
echo ===========================================================
42+
echo.
2643
EXIT /B 0

0 commit comments

Comments
 (0)