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
4 changes: 2 additions & 2 deletions .github/workflows/merge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
name: Latest release

env:
CACHE_VERSION: 5
CACHE_VERSION: 21
DEFAULT_PYTHON: "3.12"

# Only run on merges
Expand All @@ -22,7 +22,7 @@ jobs:
if: github.event.pull_request.merged == true
steps:
- name: Check out committed code
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
uses: actions/checkout@v4
- name: Set up Python ${{ env.DEFAULT_PYTHON }}
id: python
uses: actions/setup-python@v5
Expand Down
42 changes: 22 additions & 20 deletions .github/workflows/verify.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
name: Latest commit

env:
CACHE_VERSION: 6
CACHE_VERSION: 22
DEFAULT_PYTHON: "3.12"
PRE_COMMIT_HOME: ~/.cache/pre-commit

Expand All @@ -22,7 +22,7 @@ jobs:
name: Prepare
steps:
- name: Check out committed code
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
uses: actions/checkout@v4
- name: Set up Python ${{ env.DEFAULT_PYTHON }}
id: python
uses: actions/setup-python@v5
Expand All @@ -48,8 +48,9 @@ jobs:
pip install virtualenv --upgrade
python -m venv venv
. venv/bin/activate
pip install -U pip setuptools wheel
pip install -r requirements_test.txt -r requirements_commit.txt
pip install uv
uv pip install -U pip setuptools wheel
uv pip install -r requirements_test.txt -r requirements_commit.txt
- name: Restore pre-commit environment from cache
id: cache-precommit
uses: actions/cache@v4
Expand All @@ -71,7 +72,7 @@ jobs:
needs: prepare
steps:
- name: Check out committed code
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
uses: actions/checkout@v4
with:
persist-credentials: false
- name: Set up Python ${{ env.DEFAULT_PYTHON }}
Expand All @@ -97,7 +98,7 @@ jobs:
- name: Ruff (check)
run: |
. venv/bin/activate
#ruff plugwise_usb/*py tests/*py
#ruff check plugwise_usb/*py tests/*py
echo "***"
echo "***"
echo "Code is not up to par for ruff, skipping"
Expand All @@ -107,7 +108,7 @@ jobs:
if: failure()
run: |
. venv/bin/activate
ruff --fix plugwise_usb/*py tests/*py
ruff check --fix plugwise_usb/*py tests/*py
git config --global user.name 'autoruff'
git config --global user.email '[email protected]'
git remote set-url origin https://x-access-token:${{ secrets.PAT_CT }}@github.com/$GITHUB_REPOSITORY
Expand All @@ -124,7 +125,7 @@ jobs:
- dependencies_check
steps:
- name: Check out committed code
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
uses: actions/checkout@v4
- name: Set up Python ${{ env.DEFAULT_PYTHON }}
id: python
uses: actions/setup-python@v5
Expand Down Expand Up @@ -175,7 +176,7 @@ jobs:
python-version: ["3.12", "3.11", "3.10"]
steps:
- name: Check out committed code
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
id: python
uses: actions/setup-python@v5
Expand All @@ -199,11 +200,12 @@ jobs:
run: |
python -m venv venv
. venv/bin/activate
pip install -U pip setuptools wheel
#pip install -r requirements_test.txt
pip install uv
uv pip install -U pip setuptools wheel
# uv pip install -r requirements_test.txt
# 20220124 Mimic setup_test.sh
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
pip install --upgrade pytest-asyncio
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
uv pip install --upgrade pytest-asyncio

pytest:
runs-on: ubuntu-latest
Expand All @@ -215,7 +217,7 @@ jobs:

steps:
- name: Check out committed code
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
id: python
uses: actions/setup-python@v5
Expand Down Expand Up @@ -251,7 +253,7 @@ jobs:
needs: pytest
steps:
- name: Check out committed code
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
uses: actions/checkout@v4
with:
persist-credentials: false
- name: Set up Python ${{ env.DEFAULT_PYTHON }}
Expand Down Expand Up @@ -291,7 +293,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Check out committed code
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
uses: actions/checkout@v4
- name: Run ShellCheck
uses: ludeeus/action-shellcheck@master

Expand All @@ -301,7 +303,7 @@ jobs:
name: Dependency
steps:
- name: Check out committed code
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
uses: actions/checkout@v4
- name: Run dependency checker
run: scripts/dependencies_check.sh debug

Expand All @@ -311,7 +313,7 @@ jobs:
needs: pytest
steps:
- name: Check out committed code
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
uses: actions/checkout@v4
- name: Set up Python ${{ env.DEFAULT_PYTHON }}
id: python
uses: actions/setup-python@v5
Expand Down Expand Up @@ -356,7 +358,7 @@ jobs:
needs: [coverage, mypy]
steps:
- name: Check out committed code
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
uses: actions/checkout@v4
- name: Set up Python ${{ env.DEFAULT_PYTHON }}
id: python
uses: actions/setup-python@v5
Expand Down Expand Up @@ -399,7 +401,7 @@ jobs:
needs: coverage
steps:
- name: Check out committed code
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
uses: actions/checkout@v4
- name: Set up Python ${{ env.DEFAULT_PYTHON }}
id: python
uses: actions/setup-python@v5
Expand Down
10 changes: 6 additions & 4 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ repos:
args:
- --branch=main
- repo: https://github.com/asottile/pyupgrade
rev: v3.16.0
rev: v3.17.0
hooks:
- id: pyupgrade
args: [--py39-plus]
Expand All @@ -51,10 +51,12 @@ repos:
rev: v1.35.1
hooks:
- id: yamllint
- repo: https://github.com/pre-commit/mirrors-prettier
rev: v3.1.0
- repo: https://github.com/biomejs/pre-commit
rev: v0.4.0
hooks:
- id: prettier
- id: biome-lint
additional_dependencies: ["@biomejs/[email protected]"]
name: "Verifying/updating code with biome (improved prettier)"
- repo: https://github.com/cdce8p/python-typing-update
rev: v0.6.0
hooks:
Expand Down
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Changelog

## Ongoing

- Ensure CI process remains operational
- Bumped pip to now prepend uv for using quicker dependency resolving and installing
- As for latest HA Core USB team should rework to python 3.12 (not still 3.10)

## v0.31.4(a0)

- Re-add python 3.12 checks and compatibility
Expand Down
3 changes: 1 addition & 2 deletions plugwise_usb/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -538,8 +538,7 @@ def _pass_message_to_node(self, message, mac, discover=True):
return False

def _watchdog_loop(self):
"""Main worker loop to watch all other worker threads
"""
"""Main worker loop to watch all other worker threads"""
time.sleep(5)
circle_plus_retry_counter = 0
while self._run_watchdog:
Expand Down
2 changes: 1 addition & 1 deletion plugwise_usb/controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,7 @@ def _post_message_action(self, seq_id, ack_response=None, request="unknown"):
request,
str(seq_id),
)
#Still save it to try and get it back into sync
# Still save it to try and get it back into sync
self.last_seq_id = seq_id
if resend_request:
self.resend(seq_id)
Expand Down
6 changes: 2 additions & 4 deletions plugwise_usb/messages/responses.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,7 @@


class NodeResponse(PlugwiseMessage):
"""Base class for response messages received by USB-Stick.
"""
"""Base class for response messages received by USB-Stick."""

def __init__(self, format_size=None):
super().__init__()
Expand Down Expand Up @@ -561,8 +560,7 @@ def __init__(self):


def get_message_response(message_id, length, seq_id):
"""Return message class based on sequence ID, Length of message or message ID.
"""
"""Return message class based on sequence ID, Length of message or message ID."""
# First check for known sequence ID's
if seq_id == b"FFFD":
return NodeJoinAckResponse()
Expand Down
Loading