diff --git a/.github/workflows/merge.yml b/.github/workflows/merge.yml index c95dfa34a..5c3d7ffa1 100644 --- a/.github/workflows/merge.yml +++ b/.github/workflows/merge.yml @@ -4,7 +4,7 @@ name: Latest release env: - CACHE_VERSION: 1 + CACHE_VERSION: 3 DEFAULT_PYTHON: 3.9 # Only run on merges diff --git a/.github/workflows/verify.yml b/.github/workflows/verify.yml index 2e43fb0bd..7af67abcd 100644 --- a/.github/workflows/verify.yml +++ b/.github/workflows/verify.yml @@ -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: @@ -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 @@ -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 @@ -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: diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 679903d68..320801a61 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,7 +1,7 @@ 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] @@ -9,12 +9,12 @@ repos: 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: @@ -22,7 +22,7 @@ repos: - --quiet files: ^((plugwise|tests)/.+)?[^/]+\.py$ - repo: https://github.com/codespell-project/codespell - rev: v1.17.1 + rev: v2.1.0 hooks: - id: codespell args: @@ -31,7 +31,7 @@ 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: @@ -39,7 +39,7 @@ repos: - 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: @@ -47,12 +47,8 @@ repos: - --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 @@ -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 diff --git a/requirements_test.txt b/requirements_test.txt index 62d69d079..abf861b8c 100644 --- a/requirements_test.txt +++ b/requirements_test.txt @@ -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 diff --git a/scripts/setup_test.sh b/scripts/setup_test.sh index 0028dcd3f..9b40f4750 100755 --- a/scripts/setup_test.sh +++ b/scripts/setup_test.sh @@ -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