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
2 changes: 1 addition & 1 deletion .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: 22
CACHE_VERSION: 1
DEFAULT_PYTHON: "3.14"

# Only run on merges
Expand Down
25 changes: 12 additions & 13 deletions .github/workflows/verify.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,8 @@
name: Latest commit

env:
CACHE_VERSION: 1
CACHE_VERSION: 2
DEFAULT_PYTHON: "3.14"
PRE_COMMIT_HOME: ~/.cache/pre-commit
VENV: venv

on:
Expand Down Expand Up @@ -45,15 +44,15 @@ jobs:
needs: cache
name: Prepare
steps:
- name: Prepare code checkout and python/pre-commit setup
- name: Prepare code checkout and python/prek/pre-commit setup
id: cache-reuse
uses: plugwise/gh-actions/prepare-python-and-code@v2
with:
cache-key: ${{ needs.cache.outputs.cache-key }}
fail-on-miss: false # First time create cache (if not already exists)
python-version: ${{ needs.cache.outputs.python-version }}
venv-dir: ${{ env.VENV }}
precommit-home: ${{ env.PRE_COMMIT_HOME }}
prek-home: ${{ env.PREK_HOME }}

ruff:
runs-on: ubuntu-latest
Expand All @@ -73,7 +72,7 @@ jobs:
cache-key: ${{ needs.cache.outputs.cache-key }}
python-version: ${{ needs.cache.outputs.python-version }}
venv-dir: ${{ env.VENV }}
precommit-home: ${{ env.PRE_COMMIT_HOME }}
prek-home: ${{ env.PREK_HOME }}
- name: Ruff (with fix)
run: |
. venv-${{ needs.cache.outputs.python-version }}/bin/activate
Expand Down Expand Up @@ -109,11 +108,11 @@ jobs:
cache-key: ${{ needs.cache.outputs.cache-key }}
python-version: ${{ needs.cache.outputs.python-version }}
venv-dir: ${{ env.VENV }}
precommit-home: ${{ env.PRE_COMMIT_HOME }}
prek-home: ${{ env.PREK_HOME }}
- name: Verify commit
run: |
. venv-${{ needs.cache.outputs.python-version }}/bin/activate
pre-commit run --show-diff-on-failure --color=always --all-files --hook-stage manual pylint
prek run --show-diff-on-failure --color=always --all-files --hook-stage manual pylint
# - name: Biome lint
# run: |
# . venv-${{ needs.cache.outputs.python-version }}/bin/activate
Expand All @@ -122,7 +121,7 @@ jobs:
- name: Lint markdown files
run: |
. venv-${{ needs.cache.outputs.python-version }}/bin/activate
pre-commit run --show-diff-on-failure --color=always --all-files --hook-stage manual markdownlint
prek run --show-diff-on-failure --color=always --all-files --hook-stage manual pymarkdown

pytest:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -150,7 +149,7 @@ jobs:
cache-key: ${{ needs.cache.outputs.cache-key }}
python-version: ${{ steps.python.outputs.python-version }} # Force to installed python minor
venv-dir: ${{ env.VENV }}
precommit-home: ${{ env.PRE_COMMIT_HOME }}
prek-home: ${{ env.PREK_HOME }}
- name: Run all tests
run: |
. venv-${{ steps.python.outputs.python-version }}/bin/activate
Expand Down Expand Up @@ -183,11 +182,11 @@ jobs:
cache-key: ${{ needs.cache.outputs.cache-key }}
python-version: ${{ needs.cache.outputs.python-version }}
venv-dir: ${{ env.VENV }}
precommit-home: ${{ env.PRE_COMMIT_HOME }}
prek-home: ${{ env.PREK_HOME }}
- name: Run mypy
run: |
. venv-${{ needs.cache.outputs.python-version }}/bin/activate
pip list | grep -i mypy
uv pip list | grep -i mypy
mypy plugwise_usb/

# Check shellscripts
Expand Down Expand Up @@ -228,7 +227,7 @@ jobs:
cache-key: ${{ needs.cache.outputs.cache-key }}
python-version: ${{ needs.cache.outputs.python-version }}
venv-dir: ${{ env.VENV }}
precommit-home: ${{ env.PRE_COMMIT_HOME }}
prek-home: ${{ env.PREK_HOME }}
- name: Download all coverage artifacts
uses: actions/download-artifact@v8
with:
Expand Down Expand Up @@ -316,7 +315,7 @@ jobs:
cache-key: ${{ needs.cache.outputs.cache-key }}
python-version: ${{ needs.cache.outputs.python-version }}
venv-dir: ${{ env.VENV }}
precommit-home: ${{ env.PRE_COMMIT_HOME }}
prek-home: ${{ env.PREK_HOME }}
- name: Run complexity report (click to view details)
run: |
. venv-${{ needs.cache.outputs.python-version }}/bin/activate
Expand Down
2 changes: 0 additions & 2 deletions .markdownlint.yaml

This file was deleted.

8 changes: 4 additions & 4 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -118,8 +118,8 @@ repos:
name: "Biome (prettier)"
entry: ./tmp/biome check plugwise_usb/ tests/ --files-ignore-unknown=true --no-errors-on-unmatched --json-formatter-indent-width=2 --json-formatter-indent-style=space
language: script
- repo: https://github.com/igorshubovych/markdownlint-cli
rev: v0.48.0
- repo: https://github.com/jackdewinter/pymarkdown
rev: v0.9.36
hooks:
- id: markdownlint
name: "Markdown linting"
- id: pymarkdown
name: MarkDown Lint
1 change: 1 addition & 0 deletions .pymarkdown
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{ "plugins": { "md013": { "enabled": false } } }
2 changes: 1 addition & 1 deletion requirements_commit.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# Versioning omitted (leave this up to HA-core)
coverage
mypy
pre-commit
prek
pylint
pylint_strict_informational==0.1
ruff
4 changes: 2 additions & 2 deletions scripts/setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,6 @@ fi
# Install commit requirements
uv pip install --upgrade -e . -r requirements_commit.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_pre_commit.txt

# Install pre-commit hook
pre-commit install
# Install prek hook
prek install --install-hooks

4 changes: 2 additions & 2 deletions scripts/setup_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ curl -sL "https://github.com/biomejs/biome/releases/latest/download/biome-${use_
# Make biome executable (if necessary)
chmod +x "${my_path}/tmp/biome"

# Install pre-commit hook unless running from within pre-commit
# Install prek hook unless running from within pre-commit
if [ "$#" -eq 0 ]; then
pre-commit install
prek install --install-hooks
fi

3 changes: 1 addition & 2 deletions scripts/tests_and_coverage.sh
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,8 @@ biome_format() {
}

# Install/update dependencies
pre-commit install
pre-commit install-hooks
uv pip install -r requirements_test.txt -r requirements_commit.txt
prek install --install-hooks

set +u

Expand Down
Loading