2023-04-18 23:05:34 -04:00
|
|
|
from __future__ import annotations
|
|
|
|
|
|
|
|
|
|
import os
|
|
|
|
|
import subprocess
|
|
|
|
|
import typing
|
2023-06-14 00:02:10 +02:00
|
|
|
from typing import Final, Literal, Protocol, Union
|
2023-04-18 23:05:34 -04:00
|
|
|
|
|
|
|
|
__all__ = (
|
|
|
|
|
"PLATFORMS",
|
|
|
|
|
"PathOrStr",
|
|
|
|
|
"PlatformName",
|
|
|
|
|
"PLATFORMS",
|
|
|
|
|
"PopenBytes",
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if typing.TYPE_CHECKING:
|
|
|
|
|
PopenBytes = subprocess.Popen[bytes]
|
|
|
|
|
PathOrStr = Union[str, os.PathLike[str]]
|
|
|
|
|
else:
|
|
|
|
|
PopenBytes = subprocess.Popen
|
|
|
|
|
PathOrStr = Union[str, "os.PathLike[str]"]
|
|
|
|
|
|
|
|
|
|
|
2024-05-28 05:31:36 -07:00
|
|
|
PlatformName = Literal["linux", "macos", "windows", "pyodide"]
|
|
|
|
|
PLATFORMS: Final[set[PlatformName]] = {"linux", "macos", "windows", "pyodide"}
|
2023-04-18 23:05:34 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
class GenericPythonConfiguration(Protocol):
|
|
|
|
|
@property
|
2024-03-15 13:27:39 -04:00
|
|
|
def identifier(self) -> str: ...
|