Skip to content

Commit

Permalink
chore: clean up a little typing (#1291)
Browse files Browse the repository at this point in the history
  • Loading branch information
henryiii committed Oct 4, 2022
1 parent e98c3eb commit 35f2b8d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 9 deletions.
1 change: 1 addition & 0 deletions cibuildwheel/architecture.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ def all_archs(platform: PlatformName) -> set[Architecture]:
return all_archs_map[platform]

@staticmethod
# pylint: disable-next=inconsistent-return-statements
def bitness_archs(platform: PlatformName, bitness: Literal["64", "32"]) -> set[Architecture]:
archs_32 = {Architecture.i686, Architecture.x86}
auto_archs = Architecture.auto_archs(platform)
Expand Down
12 changes: 3 additions & 9 deletions cibuildwheel/typing.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,17 @@
import os
import subprocess
import sys
from typing import TYPE_CHECKING, NoReturn, Set, Union
from typing import TYPE_CHECKING, Union

if sys.version_info < (3, 8):
from typing_extensions import Final, Literal, OrderedDict, Protocol, TypedDict
else:
from typing import Final, Literal, OrderedDict, Protocol, TypedDict

if sys.version_info < (3, 11):
from typing_extensions import NotRequired
from typing_extensions import NotRequired, assert_never
else:
from typing import NotRequired
from typing import NotRequired, assert_never

__all__ = (
"Final",
Expand All @@ -25,10 +25,8 @@
"PLATFORMS",
"PopenBytes",
"Protocol",
"Set",
"TypedDict",
"OrderedDict",
"Union",
"assert_never",
"NotRequired",
)
Expand All @@ -44,7 +42,3 @@

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

0 comments on commit 35f2b8d

Please sign in to comment.