mirror of
https://github.com/davidhalter/typeshed.git
synced 2026-01-09 13:02:22 +08:00
Add the ability to run third-party stubtest on Windows or MacOS when needed (#8923)
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com> Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
This commit is contained in:
23
tests/get_packages.py
Executable file
23
tests/get_packages.py
Executable file
@@ -0,0 +1,23 @@
|
||||
#!/usr/bin/env python3
|
||||
import os
|
||||
import sys
|
||||
|
||||
import tomli
|
||||
|
||||
platform = sys.platform
|
||||
distributions = sys.argv[1:]
|
||||
if not distributions:
|
||||
distributions = os.listdir("stubs")
|
||||
|
||||
metadata_mapping = {
|
||||
"linux": "apt_dependencies",
|
||||
# We could add others here if we run into stubs that need it:
|
||||
# "darwin": "brew_dependencies",
|
||||
# "win32": "choco_dependencies",
|
||||
}
|
||||
|
||||
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], []):
|
||||
print(package)
|
||||
Reference in New Issue
Block a user