Skip to content

Commit

Permalink
Set MQTT quality scale to platinum (#135612)
Browse files Browse the repository at this point in the history
* Set MQTT quality scale to platinum

* Add  test for type stub
  • Loading branch information
jbouwh authored Jan 15, 2025
1 parent f0257fe commit 1421f4c
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 5 deletions.
2 changes: 1 addition & 1 deletion homeassistant/components/mqtt/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"dependencies": ["file_upload", "http"],
"documentation": "https://www.home-assistant.io/integrations/mqtt",
"iot_class": "local_push",
"quality_scale": "gold",
"quality_scale": "platinum",
"requirements": ["paho-mqtt==1.6.1"],
"single_config_entry": true
}
7 changes: 4 additions & 3 deletions homeassistant/components/mqtt/quality_scale.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ rules:
comment: |
This integration does not use web sessions.
strict-typing:
status: todo
comment: |
Requirement 'paho-mqtt==1.6.1' appears untyped
status: done
comment: >
Typing for 'paho-mqtt==1.6.1' supported via 'types-paho-mqtt==1.6.0.20240321'
(requirements_test.txt).
6 changes: 5 additions & 1 deletion script/hassfest/quality_scale_validation/strict_typing.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,11 @@ def _check_requirements_are_typed(integration: Integration) -> list[str]:

if not any(file for file in distribution.files if file.name == "py.typed"):
# no py.typed file
invalid_requirements.append(requirement)
try:
metadata.distribution(f"types-{requirement_name}")
except metadata.PackageNotFoundError:
# also no stubs-only package
invalid_requirements.append(requirement)

return invalid_requirements

Expand Down

0 comments on commit 1421f4c

Please sign in to comment.