8000 stubtest_third_party.py: Allow running non-listed platforms locally by Avasam · Pull Request #9173 · python/typeshed · GitHub
[go: up one dir, main page]

Skip to content

stubtest_third_party.py: Allow running non-listed platforms locally #9173

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 9 commits into from
Nov 15, 2022
Merged
Next Next commit
Allow running non-listed platforms locally
  • Loading branch information
Avasam committed Nov 12, 2022
commit 736d5f26f9fcc86a15cc3a42a840b496eeafcb39
22 changes: 18 additions & 4 deletions tests/stubtest_third_party.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,24 @@ def run_stubtest(dist: Path, *, verbose: bool = False) -> bool:
print(colored("skipping", "yellow"))
return True

platforms_to_test = stubtest_meta.get("platforms", ["linux"])
if sys.platform not in platforms_to_test:
print(colored(f"skipping, unsupported platform: {sys.platform}, supported: {platforms_to_test}", "yellow"))
return True
platforms_to_test: list[str] | None = stubtest_meta.get("platforms")
if os.environ.get("CI"):
if platforms_to_test:
if sys.platform not in platforms_to_test:
print(colored(f"skipping, unsupported platform: {sys.platform}, supported: {platforms_to_test}", "yellow"))
return True
elif sys.platform != "linux":
print(colored(f"skipping, redundant platform: {sys.platform}", "yellow"))
return True

elif platforms_to_test and sys.platform not in platforms_to_test:
print(
colored(
rf"warning: your platform {sys.platform}, is not in: {platforms_to_test}. "
+ "It may be unsupported or deemed redundant to test on the CI",
"yellow",
)
)

with tempfile.TemporaryDirectory() as tmp:
venv_dir = Path(tmp)
Expand Down
0