Skip to content
Merged
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
36 changes: 36 additions & 0 deletions .github/workflows/linting.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,39 @@ jobs:
poetry run isort --check-only --diff .
poetry run black --check --diff .
poetry run flake8 .

run-tests:
name: Test Python ${{ matrix.python-version }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"]

steps:
- name: Check out Git repository
uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

- name: Set up Poetry
uses: snok/install-poetry@v1
with:
version: 2.1.4
virtualenvs-create: true
virtualenvs-in-project: true

- name: Install dependencies
run: poetry install

- name: Run unit tests
run: poetry run pytest

- name: Build and verify wheel installation
run: |
poetry build
poetry run python -m pip install --force-reinstall --no-deps dist/*.whl
poetry run python -I -c "from pycheckwatt import CheckwattManager"
2 changes: 1 addition & 1 deletion Dockerfile.dev
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM python:3.11-slim
FROM python:3.14-slim

WORKDIR /app
# Install the same Poetry version used in CI
Expand Down
11 changes: 11 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,13 @@ if __name__ == "__main__":

```

Long-running applications should retain one `CheckwattManager` instance instead of
creating one for every poll. Repeated calls to `login()` reuse a valid JWT and refresh
it when necessary. An application-owned `aiohttp.ClientSession` can be passed with
`session=...`; pyCheckwatt reuses an injected session but does not close it. Set
`raise_on_rate_limit=True` to receive `CheckwattRateLimitError` with the requested
retry delay. The default retains the legacy `False` return behavior.

Create a virtual environment and install pyCheckwatt:
```bash
$ python -m venv venv
Expand Down Expand Up @@ -243,6 +250,10 @@ Inside the container local code changes are automatically synced and you can run

### Development tools

The library requires Python 3.10 or newer. CI tests Python 3.10 through 3.14,
including installation of the built wheel. The development container uses
Python 3.14; library code retains Python 3.10 syntax compatibility.

The same lint commands used in CI can be run through Docker Compose:

```bash
Expand Down
1,135 changes: 744 additions & 391 deletions poetry.lock

Large diffs are not rendered by default.

Loading
Loading