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:
Nikita Sobolev
2022-11-11 16:40:50 +03:00
committed by GitHub
parent 0f33721c52
commit 9cd9f6f6e0
15 changed files with 129 additions and 61 deletions

23
tests/get_packages.py Executable file
View 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)