mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-30 08:04:24 +08:00
check_consistent.py: Add check ensuring packages are not installed for unspecified platforms (#9265)
This commit is contained in:
@@ -3,16 +3,15 @@ import os
|
||||
import sys
|
||||
|
||||
import tomli
|
||||
from utils import METADATA_MAPPING
|
||||
|
||||
platform = sys.platform
|
||||
distributions = sys.argv[1:]
|
||||
if not distributions:
|
||||
distributions = os.listdir("stubs")
|
||||
|
||||
metadata_mapping = {"linux": "apt_dependencies", "darwin": "brew_dependencies", "win32": "choco_dependencies"}
|
||||
|
||||
if platform in metadata_mapping:
|
||||
if platform in METADATA_MAPPING:
|
||||
for distribution in distributions:
|
||||
with open(f"stubs/{distribution}/METADATA.toml", "rb") as file:
|
||||
for package in tomli.load(file).get("tool", {}).get("stubtest", {}).get(metadata_mapping[platform], []):
|
||||
for package in tomli.load(file).get("tool", {}).get("stubtest", {}).get(METADATA_MAPPING[platform], []):
|
||||
print(package)
|
||||
|
||||
Reference in New Issue
Block a user