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,8 +4,8 @@
name: Latest release

env:
CACHE_VERSION: 10
DEFAULT_PYTHON: "3.13"
CACHE_VERSION: 11
DEFAULT_PYTHON: "3.14"

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

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

Expand All @@ -23,7 +23,7 @@ jobs:
name: Cache identify
outputs:
cache-key: ${{ steps.set-key.outputs.cache-key }}
python-version: ${{ steps.python.outputs.python-version}} # Ensure all runners use THIS minor version
python-version: ${{ steps.python.outputs.python-version }} # Ensure all runners use THIS minor version
steps:
- name: Check out committed code
uses: actions/checkout@v5
Expand All @@ -37,7 +37,7 @@ jobs:
run: wget -O ha_pyproject.toml "https://raw.githubusercontent.com/home-assistant/core/refs/heads/dev/pyproject.toml"
- name: Compute cache key
id: set-key
run: echo "cache-key=${{ runner.os }}-venv-cache-${{ env.CACHE_VERSION }}-${{ steps.python.outputs.python-version }}-${{ hashFiles('pyproject.toml', 'requirements_test.txt', '.pre-commit-config.yaml') }}" >> "$GITHUB_OUTPUT"
run: echo "cache-key=${{ runner.os }}-${{ env.CACHE_VERSION }}-${{ hashFiles('pyproject.toml', 'requirements_test.txt', '.pre-commit-config.yaml') }}" >> "$GITHUB_OUTPUT"

# Prepare default python version environment
prepare:
Expand Down Expand Up @@ -71,17 +71,17 @@ jobs:
uses: plugwise/gh-actions/restore-venv@v1
with:
cache-key: ${{ needs.cache.outputs.cache-key }}
python-version: ${{ needs.cache.outputs.python-version}}
python-version: ${{ needs.cache.outputs.python-version }}
venv-dir: ${{ env.VENV }}
precommit-home: ${{ env.PRE_COMMIT_HOME }}
- name: Ruff (with fix)
run: |
. venv/bin/activate
. venv-${{ needs.cache.outputs.python-version }}/bin/activate
ruff check plugwise/ tests/
- name: If needed, commit ruff changes to the pull request
if: failure()
run: |
. venv/bin/activate
. venv-${{ needs.cache.outputs.python-version }}/bin/activate
ruff format plugwise/ tests/
git config --global user.name 'autoruff'
git config --global user.email 'plugwise@users.noreply.github.com'
Expand All @@ -107,21 +107,21 @@ jobs:
uses: plugwise/gh-actions/restore-venv@v1
with:
cache-key: ${{ needs.cache.outputs.cache-key }}
python-version: ${{ needs.cache.outputs.python-version}}
python-version: ${{ needs.cache.outputs.python-version }}
venv-dir: ${{ env.VENV }}
precommit-home: ${{ env.PRE_COMMIT_HOME }}
- name: Verify commit
run: |
. venv/bin/activate
. venv-${{ needs.cache.outputs.python-version }}/bin/activate
pre-commit run --show-diff-on-failure --color=always --all-files --hook-stage manual pylint
- name: Biome lint
run: |
. venv/bin/activate
. venv-${{ needs.cache.outputs.python-version }}/bin/activate
mkdir -p ./tmp && curl -sL "https://github.com/biomejs/biome/releases/latest/download/biome-linux-x64" -o ./tmp/biome && chmod +x ./tmp/biome
pre-commit run --show-diff-on-failure --color=always --all-files --hook-stage manual biome
- name: Lint markdown files
run: |
. venv/bin/activate
. venv-${{ needs.cache.outputs.python-version }}/bin/activate
pre-commit run --show-diff-on-failure --color=always --all-files --hook-stage manual markdownlint

pytest:
Expand All @@ -133,7 +133,7 @@ jobs:
- commitcheck
strategy:
matrix:
python-version: ["3.13"]
python-version: ["3.14", "3.13"]
steps:
- name: Check out committed code
uses: actions/checkout@v5
Expand All @@ -146,18 +146,19 @@ jobs:
id: cache-reuse
uses: plugwise/gh-actions/restore-venv@v1
with:
fail-on-miss: false # First time create cache (if not already exists)
cache-key: ${{ needs.cache.outputs.cache-key }}
python-version: ${{ steps.python.outputs.python-version }} # Force to installed python minor$
python-version: ${{ steps.python.outputs.python-version }} # Force to installed python minor
venv-dir: ${{ env.VENV }}
precommit-home: ${{ env.PRE_COMMIT_HOME }}
- name: Run all tests
run: |
. venv/bin/activate
. venv-${{ steps.python.outputs.python-version }}/bin/activate
pytest --log-level info tests/*.py --cov='.'
- name: Upload coverage artifact
uses: actions/upload-artifact@v4
with:
name: coverage-${{ matrix.python-version }}
name: coverage-${{ steps.python.outputs.python-version }}
path: .coverage
if-no-files-found: error
include-hidden-files: true
Expand All @@ -179,12 +180,12 @@ jobs:
uses: plugwise/gh-actions/restore-venv@v1
with:
cache-key: ${{ needs.cache.outputs.cache-key }}
python-version: ${{ needs.cache.outputs.python-version}}
python-version: ${{ needs.cache.outputs.python-version }}
venv-dir: ${{ env.VENV }}
precommit-home: ${{ env.PRE_COMMIT_HOME }}
- name: Run mypy
run: |
. venv/bin/activate
. venv-${{ needs.cache.outputs.python-version }}/bin/activate
pip list | grep -i mypy
mypy plugwise/

Expand Down Expand Up @@ -224,7 +225,7 @@ jobs:
uses: plugwise/gh-actions/restore-venv@v1
with:
cache-key: ${{ needs.cache.outputs.cache-key }}
python-version: ${{ needs.cache.outputs.python-version}}
python-version: ${{ needs.cache.outputs.python-version }}
venv-dir: ${{ env.VENV }}
precommit-home: ${{ env.PRE_COMMIT_HOME }}
- name: Download all coverage artifacts
Expand All @@ -235,7 +236,7 @@ jobs:
path: ${{ github.workspace }}/artifacts
- name: Combine coverage results
run: |
. venv/bin/activate
. venv-${{ needs.cache.outputs.python-version }}/bin/activate
coverage combine artifacts/.coverage*
coverage report --fail-under=94
coverage xml
Expand Down Expand Up @@ -306,11 +307,11 @@ jobs:
uses: plugwise/gh-actions/restore-venv@v1
with:
cache-key: ${{ needs.cache.outputs.cache-key }}
python-version: ${{ needs.cache.outputs.python-version}}
python-version: ${{ needs.cache.outputs.python-version }}
venv-dir: ${{ env.VENV }}
precommit-home: ${{ env.PRE_COMMIT_HOME }}
- name: Run complexity report (click to view details)
run: |
. venv/bin/activate
. venv-${{ needs.cache.outputs.python-version }}/bin/activate
echo "Showing complexity higher or equal to 'C'"
radon cc plugwise/ tests/ -s -nc --no-assert
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
default_language_version:
# force all unspecified python hooks to run python3
python: python3.13
python: default

repos:
# Run manually in CI skipping the branch checks
Expand Down
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

## Ongoing

- Test/validate for Python 3.14

## v1.7.8

- Implement fixes related to the select-platform-data provided to the HA Core integrations, part of solving pw-beta issue [#897](https://github.com/plugwise/plugwise-beta/issues/897)
Expand Down
7 changes: 4 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ classifiers = [
"Development Status :: 5 - Production/Stable",
"Intended Audience :: Developers",
"Operating System :: OS Independent",
"Programming Language :: Python :: 3.14",
"Programming Language :: Python :: 3.13",
"Topic :: Home Automation",
]
Expand Down Expand Up @@ -56,7 +57,7 @@ include = ["plugwise*"]
##

[tool.pylint.MAIN]
py-version = "3.13"
py-version = "3.14"
# Use a conservative default here; 2 should speed up most setups and not hurt
# any too bad. Override on command line as appropriate.
jobs = 2
Expand Down Expand Up @@ -391,7 +392,7 @@ max-line-length-suggestions = 72


[tool.mypy]
python_version = "3.13"
python_version = "3.14"
show_error_codes = true
follow_imports = "silent"
ignore_missing_imports = true
Expand Down Expand Up @@ -421,7 +422,7 @@ omit= [
]

[tool.ruff]
target-version = "py313"
target-version = "py314"

lint.select = [
"B002", # Python does not support the unary prefix increment
Expand Down