home-assistant: fix requirements parser version detection
This commit is contained in:
parent
7be740d950
commit
35619a928d
1 changed files with 10 additions and 8 deletions
|
@ -168,8 +168,8 @@ def name_to_attr_path(req: str, packages: Dict[str, Dict[str, str]]) -> Optional
|
|||
return None
|
||||
|
||||
|
||||
def get_pkg_version(package: str, packages: Dict[str, Dict[str, str]]) -> Optional[str]:
|
||||
pkg = packages.get(f"{PKG_SET}.{package}", None)
|
||||
def get_pkg_version(attr_path: str, packages: Dict[str, Dict[str, str]]) -> Optional[str]:
|
||||
pkg = packages.get(attr_path, None)
|
||||
if not pkg:
|
||||
return None
|
||||
return pkg["version"]
|
||||
|
@ -198,9 +198,11 @@ def main() -> None:
|
|||
extras = name[name.find("[")+1:name.find("]")].split(",")
|
||||
name = name[:name.find("[")]
|
||||
attr_path = name_to_attr_path(name, packages)
|
||||
if our_version := get_pkg_version(name, packages):
|
||||
if attr_path:
|
||||
if our_version := get_pkg_version(attr_path, packages):
|
||||
attr_name = attr_path.split(".")[-1]
|
||||
if Version.parse(our_version) < Version.parse(required_version):
|
||||
outdated[name] = {
|
||||
outdated[attr_name] = {
|
||||
'wanted': required_version,
|
||||
'current': our_version
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue