git.iko.soy/typeable/nixpkgs
on master help sign in
home-assistant: find unstable versions in parse-requirements.py

Previously unstable versions would not have been found, because the regular expression was looking for a numeric version after the attribute name. When the version is however an unstable one, it would start with > unstable-2021-04-23 and therefore not match the pattern.

commitf129df86a11183683bcd29b4f7fd421f11355cdf authorMartin Weinelt <hexa@darmstadt.ccc.de> dateFri 23 Apr 2021, 02:00 (6 years ago) parent313681c
2 files changed+5−2
pkgs/servers/home-assistant/component-packages.nix+1−1 pkgs/servers/home-assistant/parse-requirements.py+4−1
pkgs/servers/home-assistant/component-packages.nix+1−1
@@ -90,7 +90,7 @@
9090 "blueprint" = ps: with ps; [ ];
9191 "bluesound" = ps: with ps; [ xmltodict ];
9292 "bluetooth_le_tracker" = ps: with ps; [ ]; # missing inputs: pygatt[GATTTOOL]
93− "bluetooth_tracker" = ps: with ps; [ bt_proximity ]; # missing inputs: pybluez
93+ "bluetooth_tracker" = ps: with ps; [ bt_proximity pybluez ];
9494 "bme280" = ps: with ps; [ smbus-cffi ]; # missing inputs: i2csense
9595 "bme680" = ps: with ps; [ bme680 smbus-cffi ];
9696 "bmp280" = ps: with ps; [ ]; # missing inputs: RPi.GPIO adafruit-circuitpython-bmp280
pkgs/servers/home-assistant/parse-requirements.py+4−1
@@ -124,7 +124,10 @@ def name_to_attr_path(req: str, packages: Dict[str, Dict[str, str]]) -> Optional
124124 for name in names:
125125 # treat "-" and "_" equally
126126 name = re.sub("[-_]", "[-_]", name)
127− pattern = re.compile("^python\\d\\.\\d-{}-\\d".format(name), re.I)
127+ # python(minor).(major)-(pname)-(version or unstable-date)
128+ # we need the version qualifier, or we'll have multiple matches
129+ # (e.g. pyserial and pyserial-asyncio when looking for pyserial)
130+ pattern = re.compile("^python\\d\\.\\d-{}-(?:\\d|unstable-.*)".format(name), re.I)
128131 for attr_path, package in packages.items():
129132 if pattern.match(package["name"]):
130133 attr_paths.add(attr_path)