chore: use Final type annotation on every top-level constant (#1010)
This commit is contained in:
@@ -4,9 +4,9 @@ import re
|
|||||||
from enum import Enum
|
from enum import Enum
|
||||||
from typing import Set
|
from typing import Set
|
||||||
|
|
||||||
from .typing import Literal, PlatformName, assert_never
|
from .typing import Final, Literal, PlatformName, assert_never
|
||||||
|
|
||||||
PRETTY_NAMES = {"linux": "Linux", "macos": "macOS", "windows": "Windows"}
|
PRETTY_NAMES: Final = {"linux": "Linux", "macos": "macOS", "windows": "Windows"}
|
||||||
|
|
||||||
|
|
||||||
@functools.total_ordering
|
@functools.total_ordering
|
||||||
|
|||||||
@@ -5,16 +5,17 @@ import sys
|
|||||||
import time
|
import time
|
||||||
from typing import IO, AnyStr, Optional, Union
|
from typing import IO, AnyStr, Optional, Union
|
||||||
|
|
||||||
|
from cibuildwheel.typing import Final
|
||||||
from cibuildwheel.util import CIProvider, detect_ci_provider
|
from cibuildwheel.util import CIProvider, detect_ci_provider
|
||||||
|
|
||||||
DEFAULT_FOLD_PATTERN = ("{name}", "")
|
DEFAULT_FOLD_PATTERN: Final = ("{name}", "")
|
||||||
FOLD_PATTERNS = {
|
FOLD_PATTERNS: Final = {
|
||||||
"azure": ("##[group]{name}", "##[endgroup]"),
|
"azure": ("##[group]{name}", "##[endgroup]"),
|
||||||
"travis": ("travis_fold:start:{identifier}\n{name}", "travis_fold:end:{identifier}"),
|
"travis": ("travis_fold:start:{identifier}\n{name}", "travis_fold:end:{identifier}"),
|
||||||
"github": ("::group::{name}", "::endgroup::{name}"),
|
"github": ("::group::{name}", "::endgroup::{name}"),
|
||||||
}
|
}
|
||||||
|
|
||||||
PLATFORM_IDENTIFIER_DESCRIPTIONS = {
|
PLATFORM_IDENTIFIER_DESCRIPTIONS: Final = {
|
||||||
"manylinux_x86_64": "manylinux x86_64",
|
"manylinux_x86_64": "manylinux x86_64",
|
||||||
"manylinux_i686": "manylinux i686",
|
"manylinux_i686": "manylinux i686",
|
||||||
"manylinux_aarch64": "manylinux aarch64",
|
"manylinux_aarch64": "manylinux aarch64",
|
||||||
|
|||||||
@@ -39,15 +39,15 @@ from packaging.specifiers import SpecifierSet
|
|||||||
from packaging.version import Version
|
from packaging.version import Version
|
||||||
from platformdirs import user_cache_path
|
from platformdirs import user_cache_path
|
||||||
|
|
||||||
from cibuildwheel.typing import Literal, PathOrStr, PlatformName
|
from cibuildwheel.typing import Final, Literal, PathOrStr, PlatformName
|
||||||
|
|
||||||
resources_dir = Path(__file__).parent / "resources"
|
resources_dir: Final = Path(__file__).parent / "resources"
|
||||||
|
|
||||||
install_certifi_script = resources_dir / "install_certifi.py"
|
install_certifi_script: Final = resources_dir / "install_certifi.py"
|
||||||
|
|
||||||
BuildFrontend = Literal["pip", "build"]
|
BuildFrontend: Final = Literal["pip", "build"]
|
||||||
|
|
||||||
MANYLINUX_ARCHS = (
|
MANYLINUX_ARCHS: Final = (
|
||||||
"x86_64",
|
"x86_64",
|
||||||
"i686",
|
"i686",
|
||||||
"pypy_x86_64",
|
"pypy_x86_64",
|
||||||
@@ -58,7 +58,7 @@ MANYLINUX_ARCHS = (
|
|||||||
"pypy_i686",
|
"pypy_i686",
|
||||||
)
|
)
|
||||||
|
|
||||||
MUSLLINUX_ARCHS = (
|
MUSLLINUX_ARCHS: Final = (
|
||||||
"x86_64",
|
"x86_64",
|
||||||
"i686",
|
"i686",
|
||||||
"aarch64",
|
"aarch64",
|
||||||
@@ -66,10 +66,10 @@ MUSLLINUX_ARCHS = (
|
|||||||
"s390x",
|
"s390x",
|
||||||
)
|
)
|
||||||
|
|
||||||
DEFAULT_CIBW_CACHE_PATH = user_cache_path(appname="cibuildwheel", appauthor="pypa")
|
DEFAULT_CIBW_CACHE_PATH: Final = user_cache_path(appname="cibuildwheel", appauthor="pypa")
|
||||||
CIBW_CACHE_PATH = Path(os.environ.get("CIBW_CACHE_PATH", DEFAULT_CIBW_CACHE_PATH)).resolve()
|
CIBW_CACHE_PATH: Final = Path(os.environ.get("CIBW_CACHE_PATH", DEFAULT_CIBW_CACHE_PATH)).resolve()
|
||||||
|
|
||||||
IS_WIN = sys.platform.startswith("win")
|
IS_WIN: Final = sys.platform.startswith("win")
|
||||||
|
|
||||||
|
|
||||||
@overload
|
@overload
|
||||||
|
|||||||
Reference in New Issue
Block a user