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: 1
CACHE_VERSION: 3
DEFAULT_PYTHON: 3.9

# Only run on merges
Expand Down
11 changes: 5 additions & 6 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: 11
DEFAULT_PYTHON: 3.9
CACHE_VERSION: 16
DEFAULT_PYTHON: "3.9"
PRE_COMMIT_HOME: ~/.cache/pre-commit

on:
Expand Down Expand Up @@ -45,10 +45,10 @@ jobs:
- name: Create Python virtual environment
if: steps.cache-venv.outputs.cache-hit != 'true'
run: |
pip install virtualenv --upgrade
python -m venv venv
. venv/bin/activate
pip install -U pip setuptools
pip install -e .
pip install -U pip setuptools wheel
pip install -r requirements_test.txt
- name: Restore pre-commit environment from cache
id: cache-precommit
Expand Down Expand Up @@ -156,7 +156,7 @@ jobs:
pre-commit run --show-diff-on-failure --color=always --all-files --hook-stage manual black
pre-commit run --show-diff-on-failure --color=always --all-files --hook-stage manual codespell
pre-commit run --show-diff-on-failure --color=always --all-files --hook-stage manual flake8
pre-commit run --show-diff-on-failure --color=always --all-files --hook-stage manual isort
#pre-commit run --show-diff-on-failure --color=always --all-files --hook-stage manual isort
pre-commit run --show-diff-on-failure --color=always --all-files --hook-stage manual mypy
pre-commit run --show-diff-on-failure --color=always --all-files --hook-stage manual userdata
pre-commit run --show-diff-on-failure --color=always --all-files --hook-stage manual yamllint
Expand Down Expand Up @@ -195,7 +195,6 @@ jobs:
python -m venv venv
. venv/bin/activate
pip install -U pip setuptools wheel
pip install -e .
pip install -r requirements_test.txt

pytest:
Expand Down
22 changes: 11 additions & 11 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,28 +1,28 @@
repos:
# Run manually in CI skipping the branch checks
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v3.2.0
rev: v4.1.0
hooks:
- id: check-executables-have-shebangs
stages: [manual]
- id: no-commit-to-branch
args:
- --branch=main
- repo: https://github.com/asottile/pyupgrade
rev: v2.7.2
rev: v2.30.0
hooks:
- id: pyupgrade
args: [--py37-plus]
- repo: https://github.com/psf/black
rev: 21.10b0
rev: 21.12b0
hooks:
- id: black
args:
- --safe
- --quiet
files: ^((plugwise|tests)/.+)?[^/]+\.py$
- repo: https://github.com/codespell-project/codespell
rev: v1.17.1
rev: v2.1.0
hooks:
- id: codespell
args:
Expand All @@ -31,28 +31,24 @@ repos:
- --quiet-level=2
exclude_types: [csv, json]
- repo: https://gitlab.com/pycqa/flake8
rev: 3.8.4
rev: 3.9.2
hooks:
- id: flake8
additional_dependencies:
- flake8-docstrings==1.5.0
- pydocstyle==5.1.1
files: ^(plugwise|tests)/.+\.py$
- repo: https://github.com/PyCQA/bandit
rev: 1.6.2
rev: 1.7.1
hooks:
- id: bandit
args:
- --quiet
- --format=custom
- --configfile=tests/bandit.yaml
files: ^(plugwise|tests)/.+\.py$
- repo: https://github.com/PyCQA/isort
rev: 5.5.3
hooks:
- id: isort
- repo: https://github.com/adrienverge/yamllint.git
rev: v1.24.2
rev: v1.26.3
hooks:
- id: yamllint
- repo: https://github.com/prettier/prettier
Expand All @@ -79,3 +75,7 @@ repos:
types: [python]
require_serial: true
files: ^plugwise/.+\.py$
# - repo: https://github.com/PyCQA/isort
# rev: 5.10.1
# hooks:
# - id: isort
4 changes: 1 addition & 3 deletions requirements_test.txt
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
# In addition to Upstream HA (devbranch)
-r https://raw.githubusercontent.com/home-assistant/core/dev/requirements_test.txt
# and commit
# -r requirements_commit.txt
-r https://raw.githubusercontent.com/home-assistant/core/dev/requirements_test_pre_commit.txt
# and setup
-e .
#
# pytest-asyncio
pytest-cover
radon
2 changes: 1 addition & 1 deletion scripts/setup_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ for venv in venv .venv .; do
. "${my_path}/${venv}/bin/activate"

# Install testing requirements
pip install --upgrade -r requirements_test.txt
pip install --upgrade -r requirements_test.txt
# Install pre-commit hook
${my_path}/${venv}/bin/pre-commit install
fi
Expand Down