Skip to content

Commit

Permalink
Merge remote-tracking branch 'refs/remotes/blueprint/dev' into dev
Browse files Browse the repository at this point in the history
# Conflicts:
#	README.md
#	config/configuration.yaml
#	custom_components/integration_blueprint/__init__.py
#	custom_components/integration_blueprint/api.py
#	custom_components/integration_blueprint/binary_sensor.py
#	custom_components/integration_blueprint/config_flow.py
#	custom_components/integration_blueprint/const.py
#	custom_components/integration_blueprint/coordinator.py
#	custom_components/integration_blueprint/entity.py
#	custom_components/integration_blueprint/manifest.json
#	custom_components/integration_blueprint/sensor.py
#	custom_components/integration_blueprint/switch.py
#	hacs.json
#	requirements.txt
  • Loading branch information
Limych committed Oct 5, 2024
2 parents babf8ec + 11c653e commit 021bf01
Show file tree
Hide file tree
Showing 15 changed files with 61 additions and 80 deletions.
33 changes: 14 additions & 19 deletions .devcontainer.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ludeeus/integration_blueprint",
"image": "mcr.microsoft.com/devcontainers/python:1-3.12",
"image": "mcr.microsoft.com/devcontainers/python:3.12",
"postCreateCommand": "scripts/setup",
"forwardPorts": [
8123
Expand All @@ -14,33 +14,28 @@
"customizations": {
"vscode": {
"extensions": [
"ms-python.python",
"charliermarsh.ruff",
"github.vscode-pull-request-github",
"ryanluker.vscode-coverage-gutters",
"ms-python.python",
"ms-python.vscode-pylance",
"ms-python.black-formatter",
"ms-python.pylint"
"ryanluker.vscode-coverage-gutters"
],
"settings": {
"files.eol": "\n",
"editor.tabSize": 4,
"python.pythonPath": "/usr/bin/python3",
"python.analysis.autoSearchPaths": false,
"[python]": {
"editor.defaultFormatter": "ms-python.black-formatter"
},
"black-formatter.path": [
"/usr/local/py-utils/bin/black"
],
"editor.formatOnPaste": false,
"editor.formatOnPaste": true,
"editor.formatOnSave": true,
"editor.formatOnType": true,
"files.trimTrailingWhitespace": true
"editor.formatOnType": false,
"files.trimTrailingWhitespace": true,
"python.analysis.typeCheckingMode": "basic",
"python.analysis.autoImportCompletions": true,
"python.defaultInterpreterPath": "/usr/local/bin/python",
"[python]": {
"editor.defaultFormatter": "charliermarsh.ruff"
}
}
}
},
"remoteUser": "vscode",
"features": {
"ghcr.io/devcontainers/features/rust:1": {}
}
"features": {}
}
6 changes: 3 additions & 3 deletions .devcontainer/container/makefiles/integration.mk
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ up:
set-version: ## Set Home Assistant version
@bash /opt/container/helpers/homeassistant/set-version.sh

install: ## Install Home Assistant dev in the container
upgrade: ## Upgrade Home Assistant to latest dev in the container
@python3 -m pip --disable-pip-version-check install --upgrade git+https://github.com/home-assistant/home-assistant.git@dev

upgrade: ## Upgrade Home Assistant to latest dev in the container
install
install: ## Install Home Assistant dev in the container
upgrade

check-config: ## Check Home Assistant config
@hass -c /config --script check_config
7 changes: 5 additions & 2 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
runs-on: "ubuntu-latest"
steps:
- name: "Checkout the repository"
uses: "actions/[email protected].0"
uses: "actions/[email protected].7"

- name: "Set up Python"
uses: actions/setup-python@v5
Expand All @@ -25,5 +25,8 @@ jobs:
- name: "Install requirements"
run: python3 -m pip install -r requirements.txt

- name: "Run"
- name: "Lint"
run: python3 -m ruff check .

- name: "Format"
run: python3 -m ruff format . --check
4 changes: 2 additions & 2 deletions .github/workflows/validate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
runs-on: "ubuntu-latest"
steps:
- name: "Checkout the repository"
uses: "actions/[email protected].0"
uses: "actions/[email protected].7"

- name: "Run hassfest validation"
uses: "home-assistant/actions/hassfest@master"
Expand All @@ -27,7 +27,7 @@ jobs:
runs-on: "ubuntu-latest"
steps:
- name: "Checkout the repository"
uses: "actions/[email protected].0"
uses: "actions/[email protected].7"

- name: "Run HACS validation"
uses: "hacs/action@main"
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ ENV/
env.bak/
venv.bak/
coverage.xml
.ruff_cache

# mkdocs documentation
/site
Expand Down
4 changes: 0 additions & 4 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,6 @@ repos:
- --format=custom
- --configfile=tests/bandit.yaml
files: ^(custom_components|bin|tests)/.+\.py$
- repo: https://github.com/pre-commit/mirrors-isort
rev: v5.10.1
hooks:
- id: isort
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
hooks:
Expand Down
46 changes: 13 additions & 33 deletions .ruff.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,40 +2,17 @@

target-version = "py312"

lint.select = [
"B007", # Loop control variable {name} not used within loop body
"B014", # Exception handler with duplicate exception
"C", # complexity
"D", # docstrings
"E", # pycodestyle
"F", # pyflakes/autoflake
"ICN001", # import concentions; {name} should be imported as {asname}
"PGH004", # Use specific rule codes when using noqa
"PLC0414", # Useless import alias. Import alias does not rename original package.
"SIM105", # Use contextlib.suppress({exception}) instead of try-except-pass
"SIM117", # Merge with-statements that use the same scope
"SIM118", # Use {key} in {dict} instead of {key} in {dict}.keys()
"SIM201", # Use {left} != {right} instead of not {left} == {right}
"SIM212", # Use {a} if {a} else {b} instead of {b} if not {a} else {a}
"SIM300", # Yoda conditions. Use 'age == 42' instead of '42 == age'.
"SIM401", # Use get from dict with default instead of an if block
"T20", # flake8-print
"TRY004", # Prefer TypeError exception for invalid type
"RUF006", # Store a reference to the return value of asyncio.create_task
"UP", # pyupgrade
"W", # pycodestyle
[lint]
select = [
"ALL",
]

lint.ignore = [
"D202", # No blank lines allowed after function docstring
"D203", # 1 blank line required before class docstring
"D213", # Multi-line docstring summary should start at the second line
"D404", # First word of the docstring should not be This
"D406", # Section name should end with a newline
"D407", # Section name underlining
"D411", # Missing blank line before section
"E501", # line too long
"E731", # do not assign a lambda expression, use a def
ignore = [
"ANN101", # Missing type annotation for `self` in method
"ANN401", # Dynamically typed expressions (typing.Any) are disallowed
"D203", # no-blank-line-before-class (incompatible with formatter)
"D212", # multi-line-summary-first-line (incompatible with formatter)
"COM812", # incompatible with formatter
"ISC001", # incompatible with formatter
]

[lint.flake8-pytest-style]
Expand All @@ -46,3 +23,6 @@ keep-runtime-typing = true

[lint.mccabe]
max-complexity = 25

[lint.per-file-ignores]
"tests/*.py" = ["ANN001", "ANN201", "S101", "SLF001"]
11 changes: 9 additions & 2 deletions config/configuration.yaml
Original file line number Diff line number Diff line change
@@ -1,12 +1,19 @@
# https://www.home-assistant.io/integrations/default_config/
default_config:

# https://www.home-assistant.io/integrations/homeassistant/
homeassistant:
debug: true

# https://www.home-assistant.io/integrations/logger/
logger:
default: error
logs:
custom_components.gismeteo: debug

# If you need to debug uncomment the line below (doc: https://www.home-assistant.io/integrations/debugpy/)
# debugpy:
# https://www.home-assistant.io/integrations/debugpy/
# If you need to debug uncomment the line below
#debugpy:

gismeteo:
sweet_home:
Expand Down
2 changes: 1 addition & 1 deletion custom_components/gismeteo/const.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
# Base component constants
NAME: Final = "Gismeteo"
DOMAIN: Final = "gismeteo"
VERSION: Final = "3.0.1"
VERSION: Final = "3.0.2-alpha"
ATTRIBUTION: Final = "Data provided by Gismeteo"
ISSUE_URL: Final = "https://github.com/Limych/ha-gismeteo/issues"
#
Expand Down
2 changes: 1 addition & 1 deletion custom_components/gismeteo/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,5 @@
"requirements": [
"beautifulsoup4~=4.12"
],
"version": "3.0.1"
"version": "3.0.2-alpha"
}
6 changes: 2 additions & 4 deletions hacs.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
{
"name": "Gismeteo",
"filename": "gismeteo.zip",
"hide_default_branch": true,
"homeassistant": "2024.4.0",
"render_readme": true,
"zip_release": true
"homeassistant": "2024.6.0",
"render_readme": true
}
10 changes: 5 additions & 5 deletions requirements-dev.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
-r requirements-test.txt
black~=24.4
packaging~=24.0
pre-commit~=3.7
PyGithub~=2.3
pyupgrade~=3.15
black~=24.8
packaging~=24.1
pre-commit~=3.8
PyGithub~=2.4
pyupgrade~=3.17
yamllint~=1.35
4 changes: 2 additions & 2 deletions requirements-test.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
async-timeout
asynctest~=0.13
colorlog~=6.8
flake8~=7.0
flake8~=7.1
flake8-docstrings~=1.7
mypy~=1.10
mypy~=1.11
pylint~=3.2
pylint-strict-informational==0.1
pytest>=7.2
Expand Down
4 changes: 2 additions & 2 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
homeassistant>=2024.4.0
pip>=24.0
homeassistant>=2024.6.0
pip>=21.3.1
beautifulsoup4~=4.12
1 change: 1 addition & 0 deletions scripts/lint
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@ set -e

cd "$(dirname "$0")/.."

ruff format .
ruff check . --fix

0 comments on commit 021bf01

Please sign in to comment.