chore: add structurally typed GenericPythonConfiguration (#1458)

* Add structually typed GenericPythonConfiguration

Use structural typing for the return value of get_python_configurations
so that we don't have to specify a union of all possible PythonConfiguration
types

* address henryiii's comments

* Use Set in more places
This commit is contained in:
Hood Chatham
2023-04-06 14:40:25 -04:00
committed by GitHub
parent bd5294b3f3
commit d018570bc4
5 changed files with 21 additions and 10 deletions
+2 -1
View File
@@ -8,6 +8,7 @@ import re
import shutil
import subprocess
import sys
from collections.abc import Set
from dataclasses import dataclass
from pathlib import Path
from typing import Sequence, Tuple, cast
@@ -69,7 +70,7 @@ class PythonConfiguration:
def get_python_configurations(
build_selector: BuildSelector, architectures: set[Architecture]
build_selector: BuildSelector, architectures: Set[Architecture]
) -> list[PythonConfiguration]:
full_python_configs = read_python_configs("macos")