Replace Any with Incomplete in distutils (#12842)

This commit is contained in:
Avasam
2024-10-18 11:26:08 -04:00
committed by GitHub
parent 281dd351a2
commit de4842db26
24 changed files with 216 additions and 198 deletions

View File

@@ -1,6 +1,6 @@
from _typeshed import Unused
from _typeshed import Incomplete, Unused
from collections.abc import Callable
from typing import Any, ClassVar
from typing import ClassVar
from ..cmd import Command
@@ -15,13 +15,13 @@ class bdist(Command):
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
dist_dir: Any
bdist_base: Incomplete
plat_name: Incomplete
formats: Incomplete
dist_dir: Incomplete
skip_build: int
group: Any
owner: Any
group: Incomplete
owner: Incomplete
def initialize_options(self) -> None: ...
def finalize_options(self) -> None: ...
def run(self) -> None: ...

View File

@@ -1,4 +1,5 @@
from typing import Any, ClassVar
from _typeshed import Incomplete
from typing import ClassVar
from ..cmd import Command
@@ -7,15 +8,15 @@ class bdist_dumb(Command):
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
bdist_dir: Incomplete
plat_name: Incomplete
format: Incomplete
keep_temp: int
dist_dir: Any
skip_build: Any
dist_dir: Incomplete
skip_build: Incomplete
relative: int
owner: Any
group: Any
owner: Incomplete
group: Incomplete
def initialize_options(self) -> None: ...
def finalize_options(self) -> None: ...
def run(self) -> None: ...

View File

@@ -1,5 +1,6 @@
import sys
from typing import Any, ClassVar, Literal
from _typeshed import Incomplete
from typing import ClassVar, Literal
from ..cmd import Command
@@ -18,25 +19,25 @@ if sys.platform == "win32":
description: str
user_options: ClassVar[list[tuple[str, str | None, str]]]
boolean_options: ClassVar[list[str]]
all_versions: Any
all_versions: Incomplete
other_version: str
if sys.version_info >= (3, 9):
def __init__(self, *args, **kw) -> None: ...
bdist_dir: Any
plat_name: Any
bdist_dir: Incomplete
plat_name: Incomplete
keep_temp: int
no_target_compile: int
no_target_optimize: int
target_version: Any
dist_dir: Any
skip_build: Any
install_script: Any
pre_install_script: Any
versions: Any
target_version: Incomplete
dist_dir: Incomplete
skip_build: Incomplete
install_script: Incomplete
pre_install_script: Incomplete
versions: Incomplete
def initialize_options(self) -> None: ...
install_script_key: Any
install_script_key: Incomplete
def finalize_options(self) -> None: ...
db: Any
db: Incomplete
def run(self) -> None: ...
def add_files(self) -> None: ...
def add_find_python(self) -> None: ...

View File

@@ -1,4 +1,5 @@
from typing import Any, ClassVar
from _typeshed import Incomplete
from typing import ClassVar
from ..cmd import Command
@@ -7,44 +8,44 @@ class bdist_rpm(Command):
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
python: Any
fix_python: Any
spec_only: Any
binary_only: Any
source_only: Any
use_bzip2: Any
distribution_name: Any
group: Any
release: Any
serial: Any
vendor: Any
packager: Any
doc_files: Any
changelog: Any
icon: Any
prep_script: Any
build_script: Any
install_script: Any
clean_script: Any
verify_script: Any
pre_install: Any
post_install: Any
pre_uninstall: Any
post_uninstall: Any
prep: Any
provides: Any
requires: Any
conflicts: Any
build_requires: Any
obsoletes: Any
bdist_base: Incomplete
rpm_base: Incomplete
dist_dir: Incomplete
python: Incomplete
fix_python: Incomplete
spec_only: Incomplete
binary_only: Incomplete
source_only: Incomplete
use_bzip2: Incomplete
distribution_name: Incomplete
group: Incomplete
release: Incomplete
serial: Incomplete
vendor: Incomplete
packager: Incomplete
doc_files: Incomplete
changelog: Incomplete
icon: Incomplete
prep_script: Incomplete
build_script: Incomplete
install_script: Incomplete
clean_script: Incomplete
verify_script: Incomplete
pre_install: Incomplete
post_install: Incomplete
pre_uninstall: Incomplete
post_uninstall: Incomplete
prep: Incomplete
provides: Incomplete
requires: Incomplete
conflicts: Incomplete
build_requires: Incomplete
obsoletes: Incomplete
keep_temp: int
use_rpm_opt_flags: int
rpm3_mode: int
no_autoreq: int
force_arch: Any
force_arch: Incomplete
quiet: int
def initialize_options(self) -> None: ...
def finalize_options(self) -> None: ...

View File

@@ -1,4 +1,4 @@
from _typeshed import Unused
from _typeshed import Incomplete, Unused
from collections.abc import Callable
from typing import Any, ClassVar
@@ -12,17 +12,17 @@ class build(Command):
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
build_lib: Any
build_temp: Any
build_scripts: Any
compiler: Any
plat_name: Any
debug: Any
build_purelib: Incomplete
build_platlib: Incomplete
build_lib: Incomplete
build_temp: Incomplete
build_scripts: Incomplete
compiler: Incomplete
plat_name: Incomplete
debug: Incomplete
force: int
executable: Any
parallel: Any
executable: Incomplete
parallel: Incomplete
def initialize_options(self) -> None: ...
def finalize_options(self) -> None: ...
def run(self) -> None: ...

View File

@@ -1,6 +1,6 @@
from _typeshed import Unused
from _typeshed import Incomplete, Unused
from collections.abc import Callable
from typing import Any, ClassVar
from typing import ClassVar
from ..cmd import Command
@@ -11,15 +11,15 @@ class build_clib(Command):
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
include_dirs: Any
define: Any
undef: Any
debug: Any
build_clib: Incomplete
build_temp: Incomplete
libraries: Incomplete
include_dirs: Incomplete
define: Incomplete
undef: Incomplete
debug: Incomplete
force: int
compiler: Any
compiler: Incomplete
def initialize_options(self) -> None: ...
def finalize_options(self) -> None: ...
def run(self) -> None: ...

View File

@@ -1,40 +1,40 @@
from _typeshed import Unused
from _typeshed import Incomplete, Unused
from collections.abc import Callable
from typing import Any, ClassVar
from typing import ClassVar
from ..cmd import Command
extension_name_re: Any
extension_name_re: Incomplete
def show_compilers() -> None: ...
class build_ext(Command):
description: str
sep_by: Any
sep_by: Incomplete
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
build_temp: Any
extensions: Incomplete
build_lib: Incomplete
plat_name: Incomplete
build_temp: Incomplete
inplace: int
package: Any
include_dirs: Any
define: Any
undef: Any
libraries: Any
library_dirs: Any
rpath: Any
link_objects: Any
debug: Any
force: Any
compiler: Any
swig: Any
swig_cpp: Any
swig_opts: Any
user: Any
parallel: Any
package: Incomplete
include_dirs: Incomplete
define: Incomplete
undef: Incomplete
libraries: Incomplete
library_dirs: Incomplete
rpath: Incomplete
link_objects: Incomplete
debug: Incomplete
force: Incomplete
compiler: Incomplete
swig: Incomplete
swig_cpp: Incomplete
swig_opts: Incomplete
user: Incomplete
parallel: Incomplete
def initialize_options(self) -> None: ...
def finalize_options(self) -> None: ...
def run(self) -> None: ...

View File

@@ -1,4 +1,5 @@
from typing import Any, ClassVar, Literal
from _typeshed import Incomplete
from typing import ClassVar, Literal
from ..cmd import Command
from ..util import Mixin2to3 as Mixin2to3
@@ -8,17 +9,17 @@ class build_py(Command):
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
package_data: Any
package_dir: Any
build_lib: Incomplete
py_modules: Incomplete
package: Incomplete
package_data: Incomplete
package_dir: Incomplete
compile: int
optimize: int
force: Any
force: Incomplete
def initialize_options(self) -> None: ...
packages: Any
data_files: Any
packages: Incomplete
data_files: Incomplete
def finalize_options(self) -> None: ...
def run(self) -> None: ...
def get_data_files(self): ...
@@ -39,6 +40,6 @@ class build_py(Command):
def byte_compile(self, files) -> None: ...
class build_py_2to3(build_py, Mixin2to3):
updated_files: Any
updated_files: Incomplete
def run(self) -> None: ...
def build_module(self, module, module_file, package): ...

View File

@@ -1,19 +1,20 @@
from typing import Any, ClassVar
from _typeshed import Incomplete
from typing import ClassVar
from ..cmd import Command
from ..util import Mixin2to3 as Mixin2to3
first_line_re: Any
first_line_re: Incomplete
class build_scripts(Command):
description: str
user_options: ClassVar[list[tuple[str, str, str]]]
boolean_options: ClassVar[list[str]]
build_dir: Any
scripts: Any
force: Any
executable: Any
outfiles: Any
build_dir: Incomplete
scripts: Incomplete
force: Incomplete
executable: Incomplete
outfiles: Incomplete
def initialize_options(self) -> None: ...
def finalize_options(self) -> None: ...
def get_source_files(self): ...

View File

@@ -1,3 +1,4 @@
from _typeshed import Incomplete
from typing import Any, ClassVar, Final, Literal
from typing_extensions import TypeAlias
@@ -9,13 +10,13 @@ _Reporter: TypeAlias = Any # really docutils.utils.Reporter
# Depends on a third-party stub. Since distutils is deprecated anyway,
# it's easier to just suppress the "any subclassing" error.
class SilentReporter(_Reporter):
messages: Any
messages: Incomplete
def __init__(
self,
source,
report_level,
halt_level,
stream: Any | None = ...,
stream: Incomplete | None = ...,
debug: bool | Literal[0, 1] = 0,
encoding: str = ...,
error_handler: str = ...,

View File

@@ -1,4 +1,5 @@
from typing import Any, ClassVar
from _typeshed import Incomplete
from typing import ClassVar
from ..cmd import Command
@@ -6,12 +7,12 @@ class clean(Command):
description: str
user_options: ClassVar[list[tuple[str, str | None, str]]]
boolean_options: ClassVar[list[str]]
build_base: Any
build_lib: Any
build_temp: Any
build_scripts: Any
bdist_base: Any
all: Any
build_base: Incomplete
build_lib: Incomplete
build_temp: Incomplete
build_scripts: Incomplete
bdist_base: Incomplete
all: Incomplete
def initialize_options(self) -> None: ...
def finalize_options(self) -> None: ...
def run(self) -> None: ...

View File

@@ -1,7 +1,7 @@
from _typeshed import StrOrBytesPath
from _typeshed import Incomplete, StrOrBytesPath
from collections.abc import Sequence
from re import Pattern
from typing import Any, ClassVar, Final, Literal
from typing import ClassVar, Final, Literal
from ..ccompiler import CCompiler
from ..cmd import Command
@@ -81,4 +81,4 @@ class config(Command):
self, header: str, include_dirs: Sequence[str] | None = None, library_dirs: Sequence[str] | None = None, lang: str = "c"
) -> bool: ...
def dump_file(filename: StrOrBytesPath, head: Any | None = None) -> None: ...
def dump_file(filename: StrOrBytesPath, head: Incomplete | None = None) -> None: ...

View File

@@ -1,4 +1,5 @@
import sys
from _typeshed import Incomplete
from collections.abc import Callable
from typing import Any, ClassVar, Final, Literal
@@ -18,33 +19,33 @@ class install(Command):
boolean_options: ClassVar[list[str]]
negative_opt: ClassVar[dict[str, str]]
prefix: str | None
exec_prefix: Any
exec_prefix: Incomplete
home: str | None
user: bool
install_base: Any
install_platbase: Any
install_base: Incomplete
install_platbase: Incomplete
root: str | None
install_purelib: Any
install_platlib: Any
install_headers: Any
install_purelib: Incomplete
install_platlib: Incomplete
install_headers: Incomplete
install_lib: str | None
install_scripts: Any
install_data: Any
install_userbase: Any
install_usersite: Any
compile: Any
optimize: Any
extra_path: Any
install_scripts: Incomplete
install_data: Incomplete
install_userbase: Incomplete
install_usersite: Incomplete
compile: Incomplete
optimize: Incomplete
extra_path: Incomplete
install_path_file: int
force: int
skip_build: int
warn_dir: int
build_base: Any
build_lib: Any
record: Any
build_base: Incomplete
build_lib: Incomplete
record: Incomplete
def initialize_options(self) -> None: ...
config_vars: Any
install_libbase: Any
config_vars: Incomplete
install_libbase: Incomplete
def finalize_options(self) -> None: ...
def dump_dirs(self, msg) -> None: ...
def finalize_unix(self) -> None: ...
@@ -53,8 +54,8 @@ class install(Command):
def expand_basedirs(self) -> None: ...
def expand_dirs(self) -> None: ...
def convert_paths(self, *names) -> None: ...
path_file: Any
extra_dirs: Any
path_file: Incomplete
extra_dirs: Incomplete
def handle_extra_path(self) -> None: ...
def change_roots(self, *names) -> None: ...
def create_home_path(self) -> None: ...

View File

@@ -1,4 +1,5 @@
from typing import Any, ClassVar
from _typeshed import Incomplete
from typing import ClassVar
from ..cmd import Command
@@ -6,11 +7,11 @@ class install_data(Command):
description: str
user_options: ClassVar[list[tuple[str, str | None, str]]]
boolean_options: ClassVar[list[str]]
install_dir: Any
outfiles: Any
root: Any
install_dir: Incomplete
outfiles: Incomplete
root: Incomplete
force: int
data_files: Any
data_files: Incomplete
warn_dir: int
def initialize_options(self) -> None: ...
def finalize_options(self) -> None: ...

View File

@@ -1,14 +1,15 @@
from typing import Any, ClassVar
from _typeshed import Incomplete
from typing import ClassVar
from ..cmd import Command
class install_egg_info(Command):
description: ClassVar[str]
user_options: ClassVar[list[tuple[str, str, str]]]
install_dir: Any
install_dir: Incomplete
def initialize_options(self) -> None: ...
target: Any
outputs: Any
target: Incomplete
outputs: Incomplete
def finalize_options(self) -> None: ...
def run(self) -> None: ...
def get_outputs(self) -> list[str]: ...

View File

@@ -1,4 +1,5 @@
from typing import Any, ClassVar
from _typeshed import Incomplete
from typing import ClassVar
from ..cmd import Command
@@ -6,9 +7,9 @@ class install_headers(Command):
description: str
user_options: ClassVar[list[tuple[str, str, str]]]
boolean_options: ClassVar[list[str]]
install_dir: Any
install_dir: Incomplete
force: int
outfiles: Any
outfiles: Incomplete
def initialize_options(self) -> None: ...
def finalize_options(self) -> None: ...
def run(self) -> None: ...

View File

@@ -1,4 +1,5 @@
from typing import Any, ClassVar, Final
from _typeshed import Incomplete
from typing import ClassVar, Final
from ..cmd import Command
@@ -9,12 +10,12 @@ class install_lib(Command):
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
install_dir: Incomplete
build_dir: Incomplete
force: int
compile: Any
optimize: Any
skip_build: Any
compile: Incomplete
optimize: Incomplete
skip_build: Incomplete
def initialize_options(self) -> None: ...
def finalize_options(self) -> None: ...
def run(self) -> None: ...

View File

@@ -1,4 +1,5 @@
from typing import Any, ClassVar
from _typeshed import Incomplete
from typing import ClassVar
from ..cmd import Command
@@ -6,13 +7,13 @@ class install_scripts(Command):
description: str
user_options: ClassVar[list[tuple[str, str | None, str]]]
boolean_options: ClassVar[list[str]]
install_dir: Any
install_dir: Incomplete
force: int
build_dir: Any
skip_build: Any
build_dir: Incomplete
skip_build: Incomplete
def initialize_options(self) -> None: ...
def finalize_options(self) -> None: ...
outfiles: Any
outfiles: Incomplete
def run(self) -> None: ...
def get_inputs(self): ...
def get_outputs(self): ...

View File

@@ -1,3 +1,4 @@
from _typeshed import Incomplete
from collections.abc import Callable
from typing import Any, ClassVar
@@ -17,4 +18,4 @@ class register(PyPIRCCommand):
def verify_metadata(self) -> None: ...
def send_metadata(self) -> None: ...
def build_post_data(self, action): ...
def post_to_server(self, data, auth: Any | None = None): ...
def post_to_server(self, data, auth: Incomplete | None = None): ...

View File

@@ -1,4 +1,4 @@
from _typeshed import Unused
from _typeshed import Incomplete, Unused
from collections.abc import Callable
from typing import Any, ClassVar
@@ -16,22 +16,22 @@ class sdist(Command):
# Any to work around variance issues
sub_commands: ClassVar[list[tuple[str, Callable[[Any], bool] | None]]]
READMES: ClassVar[tuple[str, ...]]
template: Any
manifest: Any
template: Incomplete
manifest: Incomplete
use_defaults: int
prune: int
manifest_only: int
force_manifest: int
formats: Any
formats: Incomplete
keep_temp: int
dist_dir: Any
archive_files: Any
dist_dir: Incomplete
archive_files: Incomplete
metadata_check: int
owner: Any
group: Any
owner: Incomplete
group: Incomplete
def initialize_options(self) -> None: ...
def finalize_options(self) -> None: ...
filelist: Any
filelist: Incomplete
def run(self) -> None: ...
def check_metadata(self) -> None: ...
def get_file_list(self) -> None: ...

View File

@@ -1,4 +1,5 @@
from typing import Any, ClassVar
from _typeshed import Incomplete
from typing import ClassVar
from ..config import PyPIRCCommand
@@ -8,10 +9,10 @@ class upload(PyPIRCCommand):
password: str
show_response: int
sign: bool
identity: Any
identity: Incomplete
def initialize_options(self) -> None: ...
repository: Any
realm: Any
repository: Incomplete
realm: Incomplete
def finalize_options(self) -> None: ...
def run(self) -> None: ...
def upload_file(self, command: str, pyversion: str, filename: str) -> None: ...

View File

@@ -1,4 +1,4 @@
from _typeshed import StrOrBytesPath
from _typeshed import Incomplete, StrOrBytesPath
from collections.abc import Mapping
from distutils.cmd import Command as Command
from distutils.dist import Distribution as Distribution
@@ -32,7 +32,7 @@ def setup(
distclass: type[Distribution] = ...,
script_name: str = ...,
script_args: list[str] = ...,
options: Mapping[str, Any] = ...,
options: Mapping[str, Incomplete] = ...,
license: str = ...,
keywords: list[str] | str = ...,
platforms: list[str] | str = ...,
@@ -43,7 +43,7 @@ def setup(
provides: list[str] = ...,
requires: list[str] = ...,
command_packages: list[str] = ...,
command_options: Mapping[str, Mapping[str, tuple[Any, Any]]] = ...,
command_options: Mapping[str, Mapping[str, tuple[Incomplete, Incomplete]]] = ...,
package_data: Mapping[str, list[str]] = ...,
include_package_data: bool | Literal[0, 1] = ...,
libraries: list[str] = ...,
@@ -52,6 +52,7 @@ def setup(
include_dirs: list[str] = ...,
password: str = ...,
fullname: str = ...,
# Custom Distributions could accept more params
**attrs: Any,
) -> Distribution: ...
def run_setup(script_name: str, script_args: list[str] | None = None, stop_after: str = "run") -> Distribution: ...

View File

@@ -8,6 +8,7 @@ FATAL: Final = 5
class Log:
def __init__(self, threshold: int = 3) -> None: ...
# Arbitrary msg args' type depends on the format method
def log(self, level: int, msg: str, *args: Any) -> None: ...
def debug(self, msg: str, *args: Any) -> None: ...
def info(self, msg: str, *args: Any) -> None: ...

View File

@@ -101,7 +101,8 @@ def setup(
include_dirs: list[str] = ...,
password: str = ...,
fullname: str = ...,
**attrs,
# Custom Distributions could accept more params
**attrs: Any,
) -> Distribution: ...
class Command(_Command):