Allow github requirements specs in hassfest for non-core integrations (#124925)

* allow all requirements specs

* remove unnecessary tests

* Revert "remove unnecessary tests"

This reverts commit 0a2af0318d.

* Revert "allow all requirements specs"

This reverts commit d15cd27f7b.

* be lenient only for custom integrations

* don't allow blanks as requested

---------

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
This commit is contained in:
Marc-Philip
2024-09-20 00:36:31 +02:00
committed by GitHub
co-authored by Martin Hjelmare
parent 3d43c22485
commit 72065768f3
2 changed files with 32 additions and 12 deletions
+13 -12
View File
@@ -84,18 +84,19 @@ def validate_requirements_format(integration: Integration) -> bool:
if not version:
continue
for part in version.split(";", 1)[0].split(","):
version_part = PIP_VERSION_RANGE_SEPARATOR.match(part)
if (
version_part
and AwesomeVersion(version_part.group(2)).strategy
== AwesomeVersionStrategy.UNKNOWN
):
integration.add_error(
"requirements",
f"Unable to parse package version ({version}) for {pkg}.",
)
continue
if integration.core:
for part in version.split(";", 1)[0].split(","):
version_part = PIP_VERSION_RANGE_SEPARATOR.match(part)
if (
version_part
and AwesomeVersion(version_part.group(2)).strategy
== AwesomeVersionStrategy.UNKNOWN
):
integration.add_error(
"requirements",
f"Unable to parse package version ({version}) for {pkg}.",
)
continue
return len(integration.errors) == start_errors