setuptools & distutils: ClassVar mutables (and tuples) (#12403)

This commit is contained in:
Avasam
2024-07-23 08:17:02 -04:00
committed by GitHub
parent ef42f3b765
commit 0b1d35829b
49 changed files with 190 additions and 159 deletions

View File

@@ -1,4 +1,6 @@
from typing import Any
from _typeshed import Unused
from collections.abc import Callable
from typing import Any, ClassVar
from ..cmd import Command
@@ -6,13 +8,13 @@ def show_formats() -> None: ...
class bdist(Command):
description: str
user_options: Any
boolean_options: Any
help_options: Any
no_format_option: Any
default_format: Any
format_commands: Any
format_command: Any
user_options: ClassVar[list[tuple[str, str | None, str]]]
boolean_options: ClassVar[list[str]]
help_options: ClassVar[list[tuple[str, str | None, str, Callable[[], Unused]]]]
no_format_option: ClassVar[tuple[str, ...]]
default_format: ClassVar[dict[str, str]]
format_commands: ClassVar[list[str]]
format_command: ClassVar[dict[str, tuple[str, str]]]
bdist_base: Any
plat_name: Any
formats: Any

View File

@@ -1,12 +1,12 @@
from typing import Any
from typing import Any, ClassVar
from ..cmd import Command
class bdist_dumb(Command):
description: str
user_options: Any
boolean_options: Any
default_format: Any
user_options: ClassVar[list[tuple[str, str | None, str]]]
boolean_options: ClassVar[list[str]]
default_format: ClassVar[dict[str, str]]
bdist_dir: Any
plat_name: Any
format: Any

View File

@@ -1,5 +1,5 @@
import sys
from typing import Any, Literal
from typing import Any, ClassVar, Literal
from ..cmd import Command
@@ -16,8 +16,8 @@ if sys.platform == "win32":
class bdist_msi(Command):
description: str
user_options: Any
boolean_options: Any
user_options: ClassVar[list[tuple[str, str | None, str]]]
boolean_options: ClassVar[list[str]]
all_versions: Any
other_version: str
if sys.version_info >= (3, 9):

View File

@@ -1,12 +1,12 @@
from typing import Any
from typing import Any, ClassVar
from ..cmd import Command
class bdist_rpm(Command):
description: str
user_options: Any
boolean_options: Any
negative_opt: Any
user_options: ClassVar[list[tuple[str, str | None, str]]]
boolean_options: ClassVar[list[str]]
negative_opt: ClassVar[dict[str, str]]
bdist_base: Any
rpm_base: Any
dist_dir: Any

View File

@@ -1,10 +1,10 @@
from _typeshed import StrOrBytesPath
from distutils.cmd import Command
from typing import Any, ClassVar
from typing import ClassVar
class bdist_wininst(Command):
description: ClassVar[str]
user_options: ClassVar[list[tuple[Any, ...]]]
user_options: ClassVar[list[tuple[str, str | None, str]]]
boolean_options: ClassVar[list[str]]
def initialize_options(self) -> None: ...

View File

@@ -1,3 +1,4 @@
from _typeshed import Unused
from collections.abc import Callable
from typing import Any, ClassVar
@@ -7,9 +8,9 @@ def show_compilers() -> None: ...
class build(Command):
description: str
user_options: Any
boolean_options: Any
help_options: Any
user_options: ClassVar[list[tuple[str, str | None, str]]]
boolean_options: ClassVar[list[str]]
help_options: ClassVar[list[tuple[str, str | None, str, Callable[[], Unused]]]]
build_base: str
build_purelib: Any
build_platlib: Any

View File

@@ -1,4 +1,6 @@
from typing import Any
from _typeshed import Unused
from collections.abc import Callable
from typing import Any, ClassVar
from ..cmd import Command
@@ -6,9 +8,9 @@ def show_compilers() -> None: ...
class build_clib(Command):
description: str
user_options: Any
boolean_options: Any
help_options: Any
user_options: ClassVar[list[tuple[str, str, str]]]
boolean_options: ClassVar[list[str]]
help_options: ClassVar[list[tuple[str, str | None, str, Callable[[], Unused]]]]
build_clib: Any
build_temp: Any
libraries: Any

View File

@@ -1,4 +1,6 @@
from typing import Any
from _typeshed import Unused
from collections.abc import Callable
from typing import Any, ClassVar
from ..cmd import Command
@@ -9,9 +11,9 @@ def show_compilers() -> None: ...
class build_ext(Command):
description: str
sep_by: Any
user_options: Any
boolean_options: Any
help_options: Any
user_options: ClassVar[list[tuple[str, str | None, str]]]
boolean_options: ClassVar[list[str]]
help_options: ClassVar[list[tuple[str, str | None, str, Callable[[], Unused]]]]
extensions: Any
build_lib: Any
plat_name: Any

View File

@@ -1,13 +1,13 @@
from typing import Any, Literal
from typing import Any, ClassVar, Literal
from ..cmd import Command
from ..util import Mixin2to3 as Mixin2to3
class build_py(Command):
description: str
user_options: Any
boolean_options: Any
negative_opt: Any
user_options: ClassVar[list[tuple[str, str | None, str]]]
boolean_options: ClassVar[list[str]]
negative_opt: ClassVar[dict[str, str]]
build_lib: Any
py_modules: Any
package: Any

View File

@@ -1,4 +1,4 @@
from typing import Any
from typing import Any, ClassVar
from ..cmd import Command
from ..util import Mixin2to3 as Mixin2to3
@@ -7,8 +7,8 @@ first_line_re: Any
class build_scripts(Command):
description: str
user_options: Any
boolean_options: Any
user_options: ClassVar[list[tuple[str, str, str]]]
boolean_options: ClassVar[list[str]]
build_dir: Any
scripts: Any
force: Any

View File

@@ -1,4 +1,4 @@
from typing import Any, Literal
from typing import Any, ClassVar, Literal
from typing_extensions import TypeAlias
from ..cmd import Command
@@ -26,8 +26,8 @@ HAS_DOCUTILS: bool
class check(Command):
description: str
user_options: Any
boolean_options: Any
user_options: ClassVar[list[tuple[str, str, str]]]
boolean_options: ClassVar[list[str]]
restructuredtext: int
metadata: int
strict: int

View File

@@ -1,11 +1,11 @@
from typing import Any
from typing import Any, ClassVar
from ..cmd import Command
class clean(Command):
description: str
user_options: Any
boolean_options: Any
user_options: ClassVar[list[tuple[str, str | None, str]]]
boolean_options: ClassVar[list[str]]
build_base: Any
build_lib: Any
build_temp: Any

View File

@@ -1,7 +1,7 @@
from _typeshed import StrOrBytesPath
from collections.abc import Sequence
from re import Pattern
from typing import Any, Literal
from typing import Any, ClassVar, Literal
from ..ccompiler import CCompiler
from ..cmd import Command
@@ -11,7 +11,7 @@ LANG_EXT: dict[str, str]
class config(Command):
description: str
# Tuple is full name, short name, description
user_options: Sequence[tuple[str, str | None, str]]
user_options: ClassVar[list[tuple[str, str | None, str]]]
compiler: str | CCompiler
cc: str | None
include_dirs: Sequence[str] | None

View File

@@ -9,9 +9,9 @@ INSTALL_SCHEMES: dict[str, dict[Any, Any]]
class install(Command):
description: str
user_options: Any
boolean_options: Any
negative_opt: Any
user_options: ClassVar[list[tuple[str, str | None, str]]]
boolean_options: ClassVar[list[str]]
negative_opt: ClassVar[dict[str, str]]
prefix: str | None
exec_prefix: Any
home: str | None

View File

@@ -1,11 +1,11 @@
from typing import Any
from typing import Any, ClassVar
from ..cmd import Command
class install_data(Command):
description: str
user_options: Any
boolean_options: Any
user_options: ClassVar[list[tuple[str, str | None, str]]]
boolean_options: ClassVar[list[str]]
install_dir: Any
outfiles: Any
root: Any

View File

@@ -4,7 +4,7 @@ from ..cmd import Command
class install_egg_info(Command):
description: ClassVar[str]
user_options: ClassVar[list[tuple[str, str | None, str]]]
user_options: ClassVar[list[tuple[str, str, str]]]
install_dir: Any
def initialize_options(self) -> None: ...
target: Any

View File

@@ -1,11 +1,11 @@
from typing import Any
from typing import Any, ClassVar
from ..cmd import Command
class install_headers(Command):
description: str
user_options: Any
boolean_options: Any
user_options: ClassVar[list[tuple[str, str, str]]]
boolean_options: ClassVar[list[str]]
install_dir: Any
force: int
outfiles: Any

View File

@@ -1,4 +1,4 @@
from typing import Any
from typing import Any, ClassVar
from ..cmd import Command
@@ -6,9 +6,9 @@ PYTHON_SOURCE_EXTENSION: str
class install_lib(Command):
description: str
user_options: Any
boolean_options: Any
negative_opt: Any
user_options: ClassVar[list[tuple[str, str | None, str]]]
boolean_options: ClassVar[list[str]]
negative_opt: ClassVar[dict[str, str]]
install_dir: Any
build_dir: Any
force: int

View File

@@ -1,11 +1,11 @@
from typing import Any
from typing import Any, ClassVar
from ..cmd import Command
class install_scripts(Command):
description: str
user_options: Any
boolean_options: Any
user_options: ClassVar[list[tuple[str, str | None, str]]]
boolean_options: ClassVar[list[str]]
install_dir: Any
force: int
build_dir: Any

View File

@@ -1,3 +1,4 @@
from _typeshed import Unused
from collections.abc import Callable
from typing import Any, ClassVar
@@ -8,13 +9,13 @@ def show_formats() -> None: ...
class sdist(Command):
description: str
def checking_metadata(self): ...
user_options: Any
boolean_options: Any
help_options: Any
negative_opt: Any
user_options: ClassVar[list[tuple[str, str | None, str]]]
boolean_options: ClassVar[list[str]]
help_options: ClassVar[list[tuple[str, str | None, str, Callable[[], Unused]]]]
negative_opt: ClassVar[dict[str, str]]
# Any to work around variance issues
sub_commands: ClassVar[list[tuple[str, Callable[[Any], bool] | None]]]
READMES: Any
READMES: ClassVar[tuple[str, ...]]
template: Any
manifest: Any
use_defaults: int