mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-08 13:04:46 +08:00
Final for distutils constants (#12454)
Co-authored-by: Avasam <samuel.06@hotmail.com> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
from typing import Any, ClassVar, Literal
|
||||
from typing import Any, ClassVar, Final, Literal
|
||||
from typing_extensions import TypeAlias
|
||||
|
||||
from ..cmd import Command
|
||||
@@ -22,7 +22,7 @@ class SilentReporter(_Reporter):
|
||||
) -> None: ...
|
||||
def system_message(self, level, message, *children, **kwargs): ...
|
||||
|
||||
HAS_DOCUTILS: bool
|
||||
HAS_DOCUTILS: Final[bool]
|
||||
|
||||
class check(Command):
|
||||
description: str
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
from _typeshed import StrOrBytesPath
|
||||
from collections.abc import Sequence
|
||||
from re import Pattern
|
||||
from typing import Any, ClassVar, Literal
|
||||
from typing import Any, ClassVar, Final, Literal
|
||||
|
||||
from ..ccompiler import CCompiler
|
||||
from ..cmd import Command
|
||||
|
||||
LANG_EXT: dict[str, str]
|
||||
LANG_EXT: Final[dict[str, str]]
|
||||
|
||||
class config(Command):
|
||||
description: str
|
||||
|
||||
@@ -1,11 +1,12 @@
|
||||
import sys
|
||||
from collections.abc import Callable
|
||||
from typing import Any, ClassVar, Final
|
||||
from typing import Any, ClassVar, Final, Literal
|
||||
|
||||
from ..cmd import Command
|
||||
|
||||
HAS_USER_SITE: bool
|
||||
SCHEME_KEYS: tuple[str, ...]
|
||||
HAS_USER_SITE: Final[bool]
|
||||
|
||||
SCHEME_KEYS: Final[tuple[Literal["purelib"], Literal["platlib"], Literal["headers"], Literal["scripts"], Literal["data"]]]
|
||||
INSTALL_SCHEMES: Final[dict[str, dict[str, str]]]
|
||||
|
||||
if sys.version_info < (3, 10):
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
from typing import Any, ClassVar
|
||||
from typing import Any, ClassVar, Final
|
||||
|
||||
from ..cmd import Command
|
||||
|
||||
PYTHON_SOURCE_EXTENSION: str
|
||||
PYTHON_SOURCE_EXTENSION: Final = ".py"
|
||||
|
||||
class install_lib(Command):
|
||||
description: str
|
||||
|
||||
@@ -3,9 +3,9 @@ from collections.abc import Mapping
|
||||
from distutils.cmd import Command as Command
|
||||
from distutils.dist import Distribution as Distribution
|
||||
from distutils.extension import Extension as Extension
|
||||
from typing import Any, Literal
|
||||
from typing import Any, Final, Literal
|
||||
|
||||
USAGE: str
|
||||
USAGE: Final[str]
|
||||
|
||||
def gen_usage(script_name: StrOrBytesPath) -> str: ...
|
||||
|
||||
|
||||
@@ -1,20 +1,20 @@
|
||||
from distutils.unixccompiler import UnixCCompiler
|
||||
from distutils.version import LooseVersion
|
||||
from re import Pattern
|
||||
from typing import Literal
|
||||
from typing import Final, Literal
|
||||
|
||||
def get_msvcr() -> list[str] | None: ...
|
||||
|
||||
class CygwinCCompiler(UnixCCompiler): ...
|
||||
class Mingw32CCompiler(CygwinCCompiler): ...
|
||||
|
||||
CONFIG_H_OK: str
|
||||
CONFIG_H_NOTOK: str
|
||||
CONFIG_H_UNCERTAIN: str
|
||||
CONFIG_H_OK: Final = "ok"
|
||||
CONFIG_H_NOTOK: Final = "not ok"
|
||||
CONFIG_H_UNCERTAIN: Final = "uncertain"
|
||||
|
||||
def check_config_h() -> tuple[Literal["ok", "not ok", "uncertain"], str]: ...
|
||||
|
||||
RE_VERSION: Pattern[bytes]
|
||||
RE_VERSION: Final[Pattern[bytes]]
|
||||
|
||||
def get_versions() -> tuple[LooseVersion | None, ...]: ...
|
||||
def is_cygwingcc() -> bool: ...
|
||||
|
||||
@@ -1,15 +1,15 @@
|
||||
from collections.abc import Iterable, Mapping
|
||||
from re import Pattern
|
||||
from typing import Any, overload
|
||||
from typing import Any, Final, overload
|
||||
from typing_extensions import TypeAlias
|
||||
|
||||
_Option: TypeAlias = tuple[str, str | None, str]
|
||||
_GR: TypeAlias = tuple[list[str], OptionDummy]
|
||||
|
||||
longopt_pat: str
|
||||
longopt_re: Pattern[str]
|
||||
neg_alias_re: Pattern[str]
|
||||
longopt_xlate: dict[int, int]
|
||||
longopt_pat: Final = r"[a-zA-Z](?:[a-zA-Z0-9-]*)"
|
||||
longopt_re: Final[Pattern[str]]
|
||||
neg_alias_re: Final[Pattern[str]]
|
||||
longopt_xlate: Final[dict[int, int]]
|
||||
|
||||
class FancyGetopt:
|
||||
def __init__(self, option_table: list[_Option] | None = None) -> None: ...
|
||||
@@ -25,7 +25,7 @@ def fancy_getopt(
|
||||
options: list[_Option], negative_opt: Mapping[_Option, _Option], object: Any, args: list[str] | None
|
||||
) -> list[str] | _GR: ...
|
||||
|
||||
WS_TRANS: dict[int, str]
|
||||
WS_TRANS: Final[dict[int, str]]
|
||||
|
||||
def wrap_text(text: str, width: int) -> list[str]: ...
|
||||
def translate_longopt(opt: str) -> str: ...
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
from typing import Any
|
||||
from typing import Any, Final
|
||||
|
||||
DEBUG: int
|
||||
INFO: int
|
||||
WARN: int
|
||||
ERROR: int
|
||||
FATAL: int
|
||||
DEBUG: Final = 1
|
||||
INFO: Final = 2
|
||||
WARN: Final = 3
|
||||
ERROR: Final = 4
|
||||
FATAL: Final = 5
|
||||
|
||||
class Log:
|
||||
def __init__(self, threshold: int = 3) -> None: ...
|
||||
|
||||
@@ -1,15 +1,15 @@
|
||||
import sys
|
||||
from collections.abc import Mapping
|
||||
from distutils.ccompiler import CCompiler
|
||||
from typing import Literal, overload
|
||||
from typing import Final, Literal, overload
|
||||
from typing_extensions import deprecated
|
||||
|
||||
PREFIX: str
|
||||
EXEC_PREFIX: str
|
||||
BASE_PREFIX: str
|
||||
BASE_EXEC_PREFIX: str
|
||||
project_base: str
|
||||
python_build: bool
|
||||
PREFIX: Final[str]
|
||||
EXEC_PREFIX: Final[str]
|
||||
BASE_PREFIX: Final[str]
|
||||
BASE_EXEC_PREFIX: Final[str]
|
||||
project_base: Final[str]
|
||||
python_build: Final[bool]
|
||||
|
||||
def expand_makefile_vars(s: str, vars: Mapping[str, str]) -> str: ...
|
||||
@overload
|
||||
|
||||
Reference in New Issue
Block a user