Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 18 additions & 21 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,37 +8,34 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.8, 3.9, '3.10', '3.11', '3.12']
python-version: [3.9, '3.10', '3.11', '3.12']

steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
- uses: actions/checkout@v5
- name: Install uv and set the Python version
uses: astral-sh/setup-uv@v7
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install .
pip install --upgrade flake8 pylint pytest pytest-cov pytest-asyncio pytest-httpserver black mypy isort
run: uv sync --locked --all-extras --dev
- name: Check code style with black
run: |
black --check .
uv run black --check .
- name: Check types with mypy
run: |
mypy .
uv run mypy .
- name: Check imports with isort
run: |
isort --check-only --profile black .
uv run isort --check-only --profile black .
- name: Lint with flake8
run: |
flake8 --ignore=E501,E704 solax tests
uv run flake8 --ignore=E501,E704 solax tests
- name: Lint with pylint
run: |
pylint -d 'C0111' solax tests
uv run pylint -d 'C0111,C0103' solax tests
- name: Test with pytest
run: |
pytest --cov=solax --cov-branch --cov-report=term-missing .
uv run pytest --cov=solax --cov-branch --cov-report=term-missing .
mv .coverage .coverage.${{ matrix.python-version }}
- name: Upload coverage
uses: actions/upload-artifact@v4
Expand All @@ -52,18 +49,18 @@ jobs:
runs-on: ubuntu-latest
needs: [build]
steps:
- uses: actions/checkout@v4
- name: Set up Python 3.12
uses: actions/setup-python@v5
- uses: actions/checkout@v5
- name: Install uv and set the Python version
uses: astral-sh/setup-uv@v7
with:
python-version: 3.12
- name: Download coverage files
uses: actions/download-artifact@v4
with:
merge-multiple: true
- name: Install dependencies
run: uv sync --locked --all-extras --dev
- name: Coverage combine
run: |
python -m pip install --upgrade pip
pip install --upgrade coverage
coverage combine
coverage report -m --fail-under=100
uv run coverage combine
uv run coverage report -m --fail-under=100
1 change: 1 addition & 0 deletions .python-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3.9
26 changes: 26 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
[project]
name = "solax"
version = "0.1.0"
description = "Solax inverter API wrapper"
readme = "README.md"
requires-python = ">=3.9"
dependencies = [
"aiohttp>=3.5.4",
"importlib-metadata>=3.6 ; python_full_version < '3.10'",
"typing-extensions>=4.1.0 ; python_full_version < '3.11'",
"voluptuous>=0.11.5",
]

[dependency-groups]
dev = [
"black>=25.11.0",
"coverage>=7.10.7",
"flake8>=7.3.0",
"isort>=6.1.0",
"mypy>=1.19.0",
"pylint>=3.3.9",
"pytest>=8.4.2",
"pytest-asyncio>=1.2.0",
"pytest-cov>=7.0.0",
"pytest-httpserver>=1.1.3",
]
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
],
python_requires=">=3.8",
python_requires=">=3.9",
entry_points={
"solax.inverter": [
"qvolt_hyb_g3_3p = solax.inverters.qvolt_hyb_g3_3p:QVOLTHYBG33P",
Expand Down
2 changes: 1 addition & 1 deletion tests/test_discovery.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ async def test_discovery_not_first_completed_after_staggering(
inverters = await solax.discover(
*conn,
inverters=[DelayedX1Boost, DelayedFailedX1Boost],
return_when=asyncio.FIRST_EXCEPTION
return_when=asyncio.FIRST_EXCEPTION,
)
assert DelayedX1Boost in {type(inverter) for inverter in inverters}

Expand Down
Loading
Loading