home-assistant: fix parse-requirements.py

A regex failed to match python3.10.
This commit is contained in:
Robert Schütz 2022-06-15 07:35:32 +00:00
parent 4e74812c3a
commit b9feda3c0b

View file

@ -155,7 +155,7 @@ def name_to_attr_path(req: str, packages: Dict[str, Dict[str, str]]) -> Optional
# python(minor).(major)-(pname)-(version or unstable-date)
# we need the version qualifier, or we'll have multiple matches
# (e.g. pyserial and pyserial-asyncio when looking for pyserial)
pattern = re.compile(f"^python\\d\\.\\d-{name}-(?:\\d|unstable-.*)", re.I)
pattern = re.compile(f"^python\\d+\\.\\d+-{name}-(?:\\d|unstable-.*)", re.I)
for attr_path, package in packages.items():
if pattern.match(package["name"]):
attr_paths.append(attr_path)