mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-07 20:54:28 +08:00
Support environment markers in requires fields (#12711)
This commit is contained in:
@@ -163,7 +163,12 @@ def _is_supported_stdlib_version(module_versions: SupportedVersionsDict, filenam
|
||||
|
||||
|
||||
def _get_pkgs_associated_with_requirement(req_name: str) -> list[str]:
|
||||
dist = importlib.metadata.distribution(req_name)
|
||||
try:
|
||||
dist = importlib.metadata.distribution(req_name)
|
||||
except importlib.metadata.PackageNotFoundError:
|
||||
# The package wasn't installed, probably because an environment
|
||||
# marker excluded it.
|
||||
return []
|
||||
toplevel_txt_contents = dist.read_text("top_level.txt")
|
||||
if toplevel_txt_contents is None:
|
||||
if dist.files is None:
|
||||
|
||||
Reference in New Issue
Block a user