-
Notifications
You must be signed in to change notification settings - Fork 4
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
8 changed files
with
3,047 additions
and
119 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
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,35 @@ | ||
name: Linting | ||
|
||
on: | ||
push: | ||
pull_request: | ||
schedule: | ||
- cron: "0 0 * * *" | ||
|
||
jobs: | ||
pre-commit: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-python@v5 | ||
with: | ||
python-version: 3.x | ||
- uses: pre-commit/action@v3 | ||
|
||
hacs: | ||
runs-on: "ubuntu-latest" | ||
name: HACS | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: HACS validation | ||
uses: "hacs/action@main" | ||
with: | ||
category: "integration" | ||
ignore: brands | ||
|
||
hassfest: | ||
runs-on: "ubuntu-latest" | ||
name: Hassfest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: "home-assistant/actions/hassfest@master" |
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,86 +1,33 @@ | ||
name: Linting | ||
name: CI | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
- master | ||
- dev | ||
pull_request: | ||
schedule: | ||
- cron: "0 0 * * *" | ||
|
||
env: | ||
DEFAULT_PYTHON: "3.12" | ||
|
||
jobs: | ||
pre-commit: | ||
runs-on: "ubuntu-latest" | ||
name: Pre-commit | ||
steps: | ||
- name: Check out the repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Set up Python ${{ env.DEFAULT_PYTHON }} | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: ${{ env.DEFAULT_PYTHON }} | ||
|
||
- name: Upgrade pip | ||
run: | | ||
pip install --constraint=.github/workflows/constraints.txt pip | ||
pip --version | ||
- name: Install Python modules | ||
run: | | ||
pip install --constraint=.github/workflows/constraints.txt pre-commit black flake8 reorder-python-imports | ||
- name: Run pre-commit on all files | ||
run: | | ||
pre-commit run --all-files --show-diff-on-failure --color=always | ||
hacs: | ||
runs-on: "ubuntu-latest" | ||
name: HACS | ||
steps: | ||
- name: Check out the repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: HACS validation | ||
uses: "hacs/[email protected]" | ||
with: | ||
category: "integration" | ||
ignore: brands | ||
|
||
hassfest: | ||
runs-on: "ubuntu-latest" | ||
name: Hassfest | ||
steps: | ||
- name: Check out the repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Hassfest validation | ||
uses: "home-assistant/actions/hassfest@master" | ||
|
||
tests: | ||
runs-on: "ubuntu-latest" | ||
name: Run tests | ||
steps: | ||
- name: Check out code from GitHub | ||
uses: actions/checkout@v4 | ||
- name: Setup Python ${{ env.DEFAULT_PYTHON }} | ||
- uses: actions/checkout@v4 | ||
- name: Set up Python | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: ${{ env.DEFAULT_PYTHON }} | ||
- name: Install requirements | ||
run: | | ||
pip install --constraint=.github/workflows/constraints.txt pip | ||
pip install -r requirements_test.txt | ||
- name: Tests suite | ||
run: | | ||
pytest \ | ||
--timeout=9 \ | ||
--durations=10 \ | ||
-n auto \ | ||
-p no:sugar \ | ||
tests | ||
- uses: snok/install-poetry@main | ||
- name: Install Dependencies | ||
run: poetry install | ||
shell: bash | ||
- name: Test with Pytest | ||
run: poetry run pytest --cov-report=xml | ||
shell: bash | ||
# yamllint disable | ||
# - name: Upload coverage to Codecov | ||
# uses: codecov/codecov-action@v3 | ||
# with: | ||
# token: ${{ secrets.CODECOV_TOKEN }} | ||
# yamllint enable |
Large diffs are not rendered by default.
Oops, something went wrong.
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,88 @@ | ||
[tool.poetry] | ||
name = "hass-myheat" | ||
version = "0.2.0" | ||
description = "MyHeat integration plugin for HomeAssistant" | ||
authors = ["Vladimir Ermakov <[email protected]>"] | ||
readme = "README.md" | ||
license = "MIT" | ||
|
||
[tool.poetry.dependencies] | ||
python = "^3.12" | ||
aiohttp = "*" | ||
home-assistant-bluetooth = "^1" | ||
homeassistant = ">=2023" | ||
voluptuous = ">=0.12.1" | ||
|
||
[tool.poetry.group.dev.dependencies] | ||
flake8 = "*" | ||
reorder-python-imports = "*" | ||
pytest-homeassistant-custom-component = "*" | ||
bandit = "*" | ||
black = {version = "*", allow-prereleases = true} | ||
mypy = "*" | ||
pre-commit = "*" | ||
pydocstyle = ">=6.0.0" | ||
prospector = {extras = ["with_vulture"], version = "*"} | ||
|
||
[build-system] | ||
requires = ["poetry-core"] | ||
build-backend = "poetry.core.masonry.api" | ||
|
||
[tool.isort] | ||
multi_line_output = 3 | ||
include_trailing_comma = true | ||
force_grid_wrap = 0 | ||
use_parentheses = true | ||
line_length = 88 | ||
indent = "\" \"" | ||
not_skip = "__init__.py" | ||
force_sort_within_sections = true | ||
sections = "FUTURE,STDLIB,INBETWEENS,THIRDPARTY,FIRSTPARTY,LOCALFOLDER" | ||
default_section = "THIRDPARTY" | ||
known_first_party = "custom_components.myheat, tests" | ||
combine_as_imports = true | ||
|
||
[tool.pytest.ini_options] | ||
addopts = ["-qq", "--cov=custom_components.myheat"] | ||
console_output_style = "count" | ||
|
||
[tool.coverage.run] | ||
branch = false | ||
|
||
[tool.coverage.report] | ||
show_missing = true | ||
fail_under = 100 | ||
|
||
[tool.mypy] | ||
python_version = '3.12' | ||
ignore_errors = false | ||
follow_imports = "silent" | ||
ignore_missing_imports = true | ||
warn_incomplete_stub = true | ||
warn_redundant_casts = true | ||
warn_unused_configs = true | ||
exclude='custom_components\/(?!myheat).*' | ||
|
||
[tool.black] | ||
line-length = 88 | ||
target-version = ['py38'] | ||
exclude = ''' | ||
( | ||
/( | ||
\.eggs # exclude a few common directories in the | ||
| \.git # root of the project | ||
| \.hg | ||
| \.mypy_cache | ||
| \.tox | ||
| \.venv | ||
| _build | ||
| buck-out | ||
| build | ||
| dist | ||
)/ | ||
| deps | ||
# the root of the project | ||
) | ||
| custom_components\/(?!myheat).* | ||
''' |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.