-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
15 changed files
with
175 additions
and
56 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,24 @@ | ||
--- | ||
name: Testing | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Set up Python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: '3.12' | ||
- name: Install dependencies | ||
run: ./uv pip install -r requirements.test | ||
- name: pytest | ||
run: pytest -vvv | ||
env: | ||
PYTHONPATH: . | ||
- uses: actions/checkout@v4 | ||
- name: Set up Python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: '3.12' | ||
- name: Install dependencies | ||
run: ./uv pip install -r requirements.test | ||
- name: pytest | ||
run: pytest -vvv | ||
env: | ||
PYTHONPATH: . |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,22 @@ | ||
--- | ||
name: HACS/HA | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
- main | ||
pull_request: | ||
schedule: | ||
- cron: "0 0 * * *" | ||
- cron: 0 0 * * * | ||
|
||
jobs: | ||
hacs: | ||
name: HACS and Home assistant | ||
runs-on: "ubuntu-latest" | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: "home-assistant/actions/hassfest@master" | ||
- name: HACS Action | ||
uses: "hacs/action@main" | ||
with: | ||
category: integration | ||
- uses: actions/checkout@v4 | ||
- uses: home-assistant/actions/hassfest@master | ||
- name: HACS Action | ||
uses: hacs/action@main | ||
with: | ||
category: integration |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
.downloads/ | ||
.venv/ | ||
__pycache__/ | ||
__pycache__/ | ||
.dmypy.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
--- | ||
repos: | ||
- repo: https://github.com/psf/black | ||
rev: 24.3.0 | ||
hooks: | ||
- id: black | ||
args: | ||
- --safe | ||
- repo: https://github.com/pycqa/flake8 | ||
rev: 7.0.0 | ||
hooks: | ||
- id: flake8 | ||
additional_dependencies: | ||
- flake8-docstrings==1.5.0 | ||
- pydocstyle==5.0.2 | ||
- Flake8-pyproject==1.2.3 | ||
- repo: https://github.com/PyCQA/isort | ||
rev: 5.12.0 | ||
hooks: | ||
- id: isort | ||
args: [--profile, black] | ||
- repo: https://github.com/pre-commit/pre-commit-hooks | ||
rev: v3.3.0 | ||
hooks: | ||
- id: check-executables-have-shebangs | ||
stages: [manual] | ||
- id: check-json | ||
- id: trailing-whitespace | ||
exclude_types: [yaml] | ||
- id: end-of-file-fixer | ||
- id: check-yaml | ||
- repo: https://github.com/jumanjihouse/pre-commit-hook-yamlfmt | ||
rev: 0.2.3 | ||
hooks: | ||
- id: yamlfmt | ||
args: [--mapping, '2', --offset, '0', --sequence, '2'] | ||
exclude: pnpm-lock.yaml | ||
- repo: local | ||
hooks: | ||
- id: mypy | ||
name: mypy | ||
language: system | ||
entry: make mypy | ||
types: [python] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
Previous attempt in core: https://github.com/home-assistant/core/pull/52334 | ||
Authenticated plugin: https://github.com/custom-components/authenticated | ||
Discussion: https://community.home-assistant.io/t/add-ip-ban-whitelist-for-http-integration/301365/26 | ||
Discussion: https://community.home-assistant.io/t/add-ip-ban-whitelist-for-http-integration/301365/26 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
[tool.mypy] | ||
pretty = true | ||
show_error_codes = true | ||
show_error_context = true | ||
explicit_package_bases = true | ||
warn_unused_ignores = true | ||
|
||
[tool.flake8] | ||
max_line_length = 110 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
# Fix Python 3.11. See https://github.com/aio-libs/yarl/issues/706 | ||
yarl >= 1.8.1 | ||
yarl >= 1.8.1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,9 @@ | ||
pytest | ||
homeassistant | ||
homeassistant >= 2023.8.3 | ||
homeassistant-stubs | ||
voluptuous | ||
pytest-watcher | ||
pytest-homeassistant-custom-component >=0.13.53 | ||
anyio[asyncio] | ||
anyio[asyncio] | ||
pre-commit | ||
mypy |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# FIXME: need >=0.14 and HA depends on 0.13.1 right now | ||
|
||
from typing import Any, Callable, List | ||
|
||
class Schema: | ||
def __init__(self, config: dict) -> None: ... | ||
|
||
class Required: | ||
def __init__(self, name: str) -> None: ... | ||
|
||
class All: | ||
def __init__( | ||
self, *args: List[Callable[[Any], Any]] | Callable[[Any], Any] | ||
) -> None: ... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
"""Tests for the Ban Whitelist integration.""" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,9 @@ | ||
"""Common fixtures for the Ban Whitelist tests.""" | ||
|
||
from collections.abc import Generator | ||
from unittest.mock import AsyncMock, patch | ||
|
||
import pytest | ||
|
||
|
||
@pytest.fixture | ||
def anyio_backend(): | ||
return 'asyncio' | ||
"""Config anyio with asyncio (as that's what HA uses).""" | ||
return "asyncio" |
Oops, something went wrong.