diff --git a/cibuildwheel/architecture.py b/cibuildwheel/architecture.py index 9d39d553..c6df9e36 100644 --- a/cibuildwheel/architecture.py +++ b/cibuildwheel/architecture.py @@ -4,9 +4,9 @@ import re from enum import Enum 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 diff --git a/cibuildwheel/logger.py b/cibuildwheel/logger.py index f79c51ad..6a12d782 100644 --- a/cibuildwheel/logger.py +++ b/cibuildwheel/logger.py @@ -5,16 +5,17 @@ import sys import time from typing import IO, AnyStr, Optional, Union +from cibuildwheel.typing import Final from cibuildwheel.util import CIProvider, detect_ci_provider -DEFAULT_FOLD_PATTERN = ("{name}", "") -FOLD_PATTERNS = { +DEFAULT_FOLD_PATTERN: Final = ("{name}", "") +FOLD_PATTERNS: Final = { "azure": ("##[group]{name}", "##[endgroup]"), "travis": ("travis_fold:start:{identifier}\n{name}", "travis_fold:end:{identifier}"), "github": ("::group::{name}", "::endgroup::{name}"), } -PLATFORM_IDENTIFIER_DESCRIPTIONS = { +PLATFORM_IDENTIFIER_DESCRIPTIONS: Final = { "manylinux_x86_64": "manylinux x86_64", "manylinux_i686": "manylinux i686", "manylinux_aarch64": "manylinux aarch64", diff --git a/cibuildwheel/util.py b/cibuildwheel/util.py index c116dc13..d0602fda 100644 --- a/cibuildwheel/util.py +++ b/cibuildwheel/util.py @@ -39,15 +39,15 @@ from packaging.specifiers import SpecifierSet from packaging.version import Version 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", "i686", "pypy_x86_64", @@ -58,7 +58,7 @@ MANYLINUX_ARCHS = ( "pypy_i686", ) -MUSLLINUX_ARCHS = ( +MUSLLINUX_ARCHS: Final = ( "x86_64", "i686", "aarch64", @@ -66,10 +66,10 @@ MUSLLINUX_ARCHS = ( "s390x", ) -DEFAULT_CIBW_CACHE_PATH = user_cache_path(appname="cibuildwheel", appauthor="pypa") -CIBW_CACHE_PATH = Path(os.environ.get("CIBW_CACHE_PATH", DEFAULT_CIBW_CACHE_PATH)).resolve() +DEFAULT_CIBW_CACHE_PATH: Final = user_cache_path(appname="cibuildwheel", appauthor="pypa") +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