refactor: identifiers in a file (#511)
* refactor: identifiers in a file * chore: more typing * refactor: PlatStr -> PlatformName * refactor: load in file, use importlib.resources * refactor: change toml structure * refactor: use common Traversable * fix: ensure reasonable version of importlib_resources * style: fix extra line
This commit is contained in:
+16
-1
@@ -1,6 +1,13 @@
|
||||
import os
|
||||
import subprocess
|
||||
from typing import TYPE_CHECKING, Union
|
||||
import sys
|
||||
from typing import TYPE_CHECKING, NoReturn, Set, Union
|
||||
|
||||
if sys.version_info < (3, 8):
|
||||
from typing_extensions import Final, Literal
|
||||
else:
|
||||
from typing import Final, Literal
|
||||
|
||||
|
||||
if TYPE_CHECKING:
|
||||
PopenBytes = subprocess.Popen[bytes]
|
||||
@@ -8,3 +15,11 @@ if TYPE_CHECKING:
|
||||
else:
|
||||
PopenBytes = subprocess.Popen
|
||||
PathOrStr = Union[str, "os.PathLike[str]"]
|
||||
|
||||
|
||||
PlatformName = Literal["linux", "macos", "windows"]
|
||||
PLATFORMS: Final[Set[PlatformName]] = {"linux", "macos", "windows"}
|
||||
|
||||
|
||||
def assert_never(value: NoReturn) -> NoReturn:
|
||||
assert False, f'Unhandled value: {value} ({type(value).__name__})' # noqa: B011
|
||||
|
||||
Reference in New Issue
Block a user