@@ -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)