From 2410c4f751a1dd1f4fff1714bb2fd6ca78591631 Mon Sep 17 00:00:00 2001 From: Sebastian Rittau Date: Sat, 24 Jul 2021 23:04:17 +0200 Subject: [PATCH] Add missing items for distutils.command.* (#5773) This was mostly generated by running stubgen. Existing annotations were kept, but converted to use PEP 604 and PEP 585. --- pyrightconfig.stricter.json | 1 + stdlib/distutils/command/bdist.pyi | 25 ++++++ stdlib/distutils/command/bdist_dumb.pyi | 21 +++++ stdlib/distutils/command/bdist_msi.pyi | 47 ++++++++-- stdlib/distutils/command/bdist_rpm.pyi | 52 +++++++++++ stdlib/distutils/command/build.pyi | 31 +++++++ stdlib/distutils/command/build_clib.pyi | 27 ++++++ stdlib/distutils/command/build_ext.pyi | 50 +++++++++++ stdlib/distutils/command/build_py.pyi | 40 ++++++++- stdlib/distutils/command/build_scripts.pyi | 24 +++++ stdlib/distutils/command/check.pyi | 36 ++++++++ stdlib/distutils/command/clean.pyi | 17 ++++ stdlib/distutils/command/config.pyi | 89 +++++++++---------- stdlib/distutils/command/install.pyi | 61 +++++++++++-- stdlib/distutils/command/install_data.pyi | 19 ++++ stdlib/distutils/command/install_egg_info.pyi | 16 +++- stdlib/distutils/command/install_headers.pyi | 16 ++++ stdlib/distutils/command/install_lib.pyi | 25 ++++++ stdlib/distutils/command/install_scripts.pyi | 18 ++++ stdlib/distutils/command/register.pyi | 18 ++++ stdlib/distutils/command/sdist.pyi | 42 +++++++++ stdlib/distutils/command/upload.pyi | 15 +++- stdlib/distutils/config.pyi | 6 +- tests/stubtest_allowlists/py3_common.txt | 1 + 24 files changed, 627 insertions(+), 70 deletions(-) diff --git a/pyrightconfig.stricter.json b/pyrightconfig.stricter.json index 715ec3347..129beea45 100644 --- a/pyrightconfig.stricter.json +++ b/pyrightconfig.stricter.json @@ -19,6 +19,7 @@ "stubs/scribe", "stubs/tornado", // Modules that are incomplete in some way. + "stdlib/distutils/command", "stdlib/lib2to3/refactor.pyi", "stdlib/sqlite3/dbapi2.pyi", "stdlib/tkinter", diff --git a/stdlib/distutils/command/bdist.pyi b/stdlib/distutils/command/bdist.pyi index e69de29bb..e1f141d3a 100644 --- a/stdlib/distutils/command/bdist.pyi +++ b/stdlib/distutils/command/bdist.pyi @@ -0,0 +1,25 @@ +from typing import Any + +from ..cmd import Command + +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 + bdist_base: Any + plat_name: Any + formats: Any + dist_dir: Any + skip_build: int + group: Any + owner: Any + def initialize_options(self) -> None: ... + def finalize_options(self) -> None: ... + def run(self) -> None: ... diff --git a/stdlib/distutils/command/bdist_dumb.pyi b/stdlib/distutils/command/bdist_dumb.pyi index e69de29bb..74cca4d13 100644 --- a/stdlib/distutils/command/bdist_dumb.pyi +++ b/stdlib/distutils/command/bdist_dumb.pyi @@ -0,0 +1,21 @@ +from typing import Any + +from ..cmd import Command + +class bdist_dumb(Command): + description: str + user_options: Any + boolean_options: Any + default_format: Any + bdist_dir: Any + plat_name: Any + format: Any + keep_temp: int + dist_dir: Any + skip_build: Any + relative: int + owner: Any + group: Any + def initialize_options(self) -> None: ... + def finalize_options(self) -> None: ... + def run(self) -> None: ... diff --git a/stdlib/distutils/command/bdist_msi.pyi b/stdlib/distutils/command/bdist_msi.pyi index a76179201..e4f64ff6a 100644 --- a/stdlib/distutils/command/bdist_msi.pyi +++ b/stdlib/distutils/command/bdist_msi.pyi @@ -1,6 +1,43 @@ -from distutils.cmd import Command +import sys +from typing import Any -class bdist_msi(Command): - def initialize_options(self) -> None: ... - def finalize_options(self) -> None: ... - def run(self) -> None: ... +from ..cmd import Command + +if sys.platform == "win32": + from msilib import Dialog + class PyDialog(Dialog): + def __init__(self, *args, **kw) -> None: ... + def title(self, title) -> None: ... + def back(self, title, next, name: str = ..., active: int = ...): ... + def cancel(self, title, next, name: str = ..., active: int = ...): ... + def next(self, title, next, name: str = ..., active: int = ...): ... + def xbutton(self, name, title, next, xpos): ... + class bdist_msi(Command): + description: str + user_options: Any + boolean_options: Any + all_versions: Any + other_version: str + if sys.version_info >= (3, 9): + def __init__(self, *args, **kw) -> None: ... + bdist_dir: Any + plat_name: Any + 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 + def initialize_options(self) -> None: ... + install_script_key: Any + def finalize_options(self) -> None: ... + db: Any + def run(self) -> None: ... + def add_files(self) -> None: ... + def add_find_python(self) -> None: ... + def add_scripts(self) -> None: ... + def add_ui(self) -> None: ... + def get_installer_filename(self, fullname): ... diff --git a/stdlib/distutils/command/bdist_rpm.pyi b/stdlib/distutils/command/bdist_rpm.pyi index e69de29bb..76691310b 100644 --- a/stdlib/distutils/command/bdist_rpm.pyi +++ b/stdlib/distutils/command/bdist_rpm.pyi @@ -0,0 +1,52 @@ +from typing import Any + +from ..cmd import Command + +class bdist_rpm(Command): + description: str + user_options: Any + boolean_options: Any + negative_opt: Any + 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 + keep_temp: int + use_rpm_opt_flags: int + rpm3_mode: int + no_autoreq: int + force_arch: Any + quiet: int + def initialize_options(self) -> None: ... + def finalize_options(self) -> None: ... + def finalize_package_data(self) -> None: ... + def run(self) -> None: ... diff --git a/stdlib/distutils/command/build.pyi b/stdlib/distutils/command/build.pyi index e69de29bb..cf3c8a562 100644 --- a/stdlib/distutils/command/build.pyi +++ b/stdlib/distutils/command/build.pyi @@ -0,0 +1,31 @@ +from typing import Any + +from ..cmd import Command + +def show_compilers() -> None: ... + +class build(Command): + description: str + user_options: Any + boolean_options: Any + help_options: Any + 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 + force: int + executable: Any + parallel: Any + def initialize_options(self) -> None: ... + def finalize_options(self) -> None: ... + def run(self) -> None: ... + def has_pure_modules(self): ... + def has_c_libraries(self): ... + def has_ext_modules(self): ... + def has_scripts(self): ... + sub_commands: Any diff --git a/stdlib/distutils/command/build_clib.pyi b/stdlib/distutils/command/build_clib.pyi index e69de29bb..32ab182b3 100644 --- a/stdlib/distutils/command/build_clib.pyi +++ b/stdlib/distutils/command/build_clib.pyi @@ -0,0 +1,27 @@ +from typing import Any + +from ..cmd import Command + +def show_compilers() -> None: ... + +class build_clib(Command): + description: str + user_options: Any + boolean_options: Any + help_options: Any + build_clib: Any + build_temp: Any + libraries: Any + include_dirs: Any + define: Any + undef: Any + debug: Any + force: int + compiler: Any + def initialize_options(self) -> None: ... + def finalize_options(self) -> None: ... + def run(self) -> None: ... + def check_library_list(self, libraries) -> None: ... + def get_library_names(self): ... + def get_source_files(self): ... + def build_libraries(self, libraries) -> None: ... diff --git a/stdlib/distutils/command/build_ext.pyi b/stdlib/distutils/command/build_ext.pyi index e69de29bb..80cd78936 100644 --- a/stdlib/distutils/command/build_ext.pyi +++ b/stdlib/distutils/command/build_ext.pyi @@ -0,0 +1,50 @@ +from typing import Any + +from ..cmd import Command + +extension_name_re: Any + +def show_compilers() -> None: ... + +class build_ext(Command): + description: str + sep_by: Any + user_options: Any + boolean_options: Any + help_options: Any + extensions: Any + build_lib: Any + plat_name: Any + build_temp: Any + 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 + def initialize_options(self) -> None: ... + def finalize_options(self) -> None: ... + def run(self) -> None: ... + def check_extensions_list(self, extensions) -> None: ... + def get_source_files(self): ... + def get_outputs(self): ... + def build_extensions(self) -> None: ... + def build_extension(self, ext) -> None: ... + def swig_sources(self, sources, extension): ... + def find_swig(self): ... + def get_ext_fullpath(self, ext_name): ... + def get_ext_fullname(self, ext_name): ... + def get_ext_filename(self, ext_name): ... + def get_export_symbols(self, ext): ... + def get_libraries(self, ext): ... diff --git a/stdlib/distutils/command/build_py.pyi b/stdlib/distutils/command/build_py.pyi index 4e8c9af4a..3c6e022c2 100644 --- a/stdlib/distutils/command/build_py.pyi +++ b/stdlib/distutils/command/build_py.pyi @@ -1,8 +1,44 @@ -from distutils.cmd import Command +from typing import Any + +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 + build_lib: Any + py_modules: Any + package: Any + package_data: Any + package_dir: Any + compile: int + optimize: int + force: Any def initialize_options(self) -> None: ... + packages: Any + data_files: Any def finalize_options(self) -> None: ... def run(self) -> None: ... + def get_data_files(self): ... + def find_data_files(self, package, src_dir): ... + def build_package_data(self) -> None: ... + def get_package_dir(self, package): ... + def check_package(self, package, package_dir): ... + def check_module(self, module, module_file): ... + def find_package_modules(self, package, package_dir): ... + def find_modules(self): ... + def find_all_modules(self): ... + def get_source_files(self): ... + def get_module_outfile(self, build_dir, package, module): ... + def get_outputs(self, include_bytecode: int = ...): ... + def build_module(self, module, module_file, package): ... + def build_modules(self) -> None: ... + def build_packages(self) -> None: ... + def byte_compile(self, files) -> None: ... -class build_py_2to3(build_py): ... +class build_py_2to3(build_py, Mixin2to3): + updated_files: Any + def run(self) -> None: ... + def build_module(self, module, module_file, package): ... diff --git a/stdlib/distutils/command/build_scripts.pyi b/stdlib/distutils/command/build_scripts.pyi index e69de29bb..42135ecea 100644 --- a/stdlib/distutils/command/build_scripts.pyi +++ b/stdlib/distutils/command/build_scripts.pyi @@ -0,0 +1,24 @@ +from typing import Any + +from ..cmd import Command +from ..util import Mixin2to3 as Mixin2to3 + +first_line_re: Any + +class build_scripts(Command): + description: str + user_options: Any + boolean_options: Any + build_dir: Any + scripts: Any + force: Any + executable: Any + outfiles: Any + def initialize_options(self) -> None: ... + def finalize_options(self) -> None: ... + def get_source_files(self): ... + def run(self) -> None: ... + def copy_scripts(self): ... + +class build_scripts_2to3(build_scripts, Mixin2to3): + def copy_scripts(self): ... diff --git a/stdlib/distutils/command/check.pyi b/stdlib/distutils/command/check.pyi index e69de29bb..9149b540f 100644 --- a/stdlib/distutils/command/check.pyi +++ b/stdlib/distutils/command/check.pyi @@ -0,0 +1,36 @@ +from typing import Any + +from ..cmd import Command + +_Reporter = Any # really docutils.utils.Reporter + +# Only defined if docutils is installed. +class SilentReporter(_Reporter): # type: ignore + messages: Any + def __init__( + self, + source, + report_level, + halt_level, + stream: Any | None = ..., + debug: int = ..., + encoding: str = ..., + error_handler: str = ..., + ) -> None: ... + def system_message(self, level, message, *children, **kwargs): ... + +HAS_DOCUTILS: bool + +class check(Command): + description: str + user_options: Any + boolean_options: Any + restructuredtext: int + metadata: int + strict: int + def initialize_options(self) -> None: ... + def finalize_options(self) -> None: ... + def warn(self, msg): ... + def run(self) -> None: ... + def check_metadata(self) -> None: ... + def check_restructuredtext(self) -> None: ... diff --git a/stdlib/distutils/command/clean.pyi b/stdlib/distutils/command/clean.pyi index e69de29bb..99560aa8a 100644 --- a/stdlib/distutils/command/clean.pyi +++ b/stdlib/distutils/command/clean.pyi @@ -0,0 +1,17 @@ +from typing import Any + +from ..cmd import Command + +class clean(Command): + description: str + user_options: Any + boolean_options: Any + build_base: Any + build_lib: Any + build_temp: Any + build_scripts: Any + bdist_base: Any + all: Any + def initialize_options(self) -> None: ... + def finalize_options(self) -> None: ... + def run(self) -> None: ... diff --git a/stdlib/distutils/command/config.pyi b/stdlib/distutils/command/config.pyi index 6b57a64b4..7ad71e185 100644 --- a/stdlib/distutils/command/config.pyi +++ b/stdlib/distutils/command/config.pyi @@ -1,87 +1,82 @@ -from distutils import log as log -from distutils.ccompiler import CCompiler -from distutils.core import Command as Command -from distutils.errors import DistutilsExecError as DistutilsExecError -from distutils.sysconfig import customize_compiler as customize_compiler -from typing import Dict, List, Optional, Pattern, Sequence, Tuple, Union +from collections.abc import Sequence +from typing import Any, Pattern -LANG_EXT: Dict[str, str] +from ..ccompiler import CCompiler +from ..cmd import Command + +LANG_EXT: dict[str, str] class config(Command): - description: str = ... + description: str # Tuple is full name, short name, description - user_options: Sequence[Tuple[str, Optional[str], str]] = ... - compiler: Optional[Union[str, CCompiler]] = ... - cc: Optional[str] = ... - include_dirs: Optional[Sequence[str]] = ... - libraries: Optional[Sequence[str]] = ... - library_dirs: Optional[Sequence[str]] = ... - noisy: int = ... - dump_source: int = ... - temp_files: Sequence[str] = ... + user_options: Sequence[tuple[str, str | None, str]] + compiler: str | CCompiler + cc: str | None + include_dirs: Sequence[str] | None + libraries: Sequence[str] | None + library_dirs: Sequence[str] | None + noisy: int + dump_source: int + temp_files: Sequence[str] def initialize_options(self) -> None: ... def finalize_options(self) -> None: ... def run(self) -> None: ... def try_cpp( self, - body: Optional[str] = ..., - headers: Optional[Sequence[str]] = ..., - include_dirs: Optional[Sequence[str]] = ..., + body: str | None = ..., + headers: Sequence[str] | None = ..., + include_dirs: Sequence[str] | None = ..., lang: str = ..., ) -> bool: ... def search_cpp( self, - pattern: Union[Pattern[str], str], - body: Optional[str] = ..., - headers: Optional[Sequence[str]] = ..., - include_dirs: Optional[Sequence[str]] = ..., + pattern: Pattern[str] | str, + body: str | None = ..., + headers: Sequence[str] | None = ..., + include_dirs: Sequence[str] | None = ..., lang: str = ..., ) -> bool: ... def try_compile( - self, body: str, headers: Optional[Sequence[str]] = ..., include_dirs: Optional[Sequence[str]] = ..., lang: str = ... + self, body: str, headers: Sequence[str] | None = ..., include_dirs: Sequence[str] | None = ..., lang: str = ... ) -> bool: ... def try_link( self, body: str, - headers: Optional[Sequence[str]] = ..., - include_dirs: Optional[Sequence[str]] = ..., - libraries: Optional[Sequence[str]] = ..., - library_dirs: Optional[Sequence[str]] = ..., + headers: Sequence[str] | None = ..., + include_dirs: Sequence[str] | None = ..., + libraries: Sequence[str] | None = ..., + library_dirs: Sequence[str] | None = ..., lang: str = ..., ) -> bool: ... def try_run( self, body: str, - headers: Optional[Sequence[str]] = ..., - include_dirs: Optional[Sequence[str]] = ..., - libraries: Optional[Sequence[str]] = ..., - library_dirs: Optional[Sequence[str]] = ..., + headers: Sequence[str] | None = ..., + include_dirs: Sequence[str] | None = ..., + libraries: Sequence[str] | None = ..., + library_dirs: Sequence[str] | None = ..., lang: str = ..., ) -> bool: ... def check_func( self, func: str, - headers: Optional[Sequence[str]] = ..., - include_dirs: Optional[Sequence[str]] = ..., - libraries: Optional[Sequence[str]] = ..., - library_dirs: Optional[Sequence[str]] = ..., + headers: Sequence[str] | None = ..., + include_dirs: Sequence[str] | None = ..., + libraries: Sequence[str] | None = ..., + library_dirs: Sequence[str] | None = ..., decl: int = ..., call: int = ..., ) -> bool: ... def check_lib( self, library: str, - library_dirs: Optional[Sequence[str]] = ..., - headers: Optional[Sequence[str]] = ..., - include_dirs: Optional[Sequence[str]] = ..., - other_libraries: List[str] = ..., + library_dirs: Sequence[str] | None = ..., + headers: Sequence[str] | None = ..., + include_dirs: Sequence[str] | None = ..., + other_libraries: list[str] = ..., ) -> bool: ... def check_header( - self, - header: str, - include_dirs: Optional[Sequence[str]] = ..., - library_dirs: Optional[Sequence[str]] = ..., - lang: str = ..., + self, header: str, include_dirs: Sequence[str] | None = ..., library_dirs: Sequence[str] | None = ..., lang: str = ... ) -> bool: ... -def dump_file(filename: str, head: Optional[str] = ...) -> None: ... +def dump_file(filename: str, head: Any | None = ...) -> None: ... diff --git a/stdlib/distutils/command/install.pyi b/stdlib/distutils/command/install.pyi index 12e83d976..47fa8b08d 100644 --- a/stdlib/distutils/command/install.pyi +++ b/stdlib/distutils/command/install.pyi @@ -1,14 +1,63 @@ -from distutils.cmd import Command -from typing import Optional, Tuple +from typing import Any, Tuple +from ..cmd import Command + +HAS_USER_SITE: bool SCHEME_KEYS: Tuple[str, ...] +INSTALL_SCHEMES: dict[str, dict[Any, Any]] class install(Command): + description: str + user_options: Any + boolean_options: Any + negative_opt: Any + prefix: str | None + exec_prefix: Any + home: str | None user: bool - prefix: Optional[str] - home: Optional[str] - root: Optional[str] - install_lib: Optional[str] + install_base: Any + install_platbase: Any + root: str | None + install_purelib: Any + install_platlib: Any + install_headers: Any + install_lib: str | None + install_scripts: Any + install_data: Any + install_userbase: Any + install_usersite: Any + compile: Any + optimize: Any + extra_path: Any + install_path_file: int + force: int + skip_build: int + warn_dir: int + build_base: Any + build_lib: Any + record: Any def initialize_options(self) -> None: ... + config_vars: Any + install_libbase: Any def finalize_options(self) -> None: ... + def dump_dirs(self, msg) -> None: ... + def finalize_unix(self) -> None: ... + def finalize_other(self) -> None: ... + def select_scheme(self, name) -> None: ... + def expand_basedirs(self) -> None: ... + def expand_dirs(self) -> None: ... + def convert_paths(self, *names) -> None: ... + path_file: Any + extra_dirs: Any + def handle_extra_path(self) -> None: ... + def change_roots(self, *names) -> None: ... + def create_home_path(self) -> None: ... def run(self) -> None: ... + def create_path_file(self) -> None: ... + def get_outputs(self): ... + def get_inputs(self): ... + def has_lib(self): ... + def has_headers(self): ... + def has_scripts(self): ... + def has_data(self): ... + sub_commands: Any diff --git a/stdlib/distutils/command/install_data.pyi b/stdlib/distutils/command/install_data.pyi index e69de29bb..6cc9b528a 100644 --- a/stdlib/distutils/command/install_data.pyi +++ b/stdlib/distutils/command/install_data.pyi @@ -0,0 +1,19 @@ +from typing import Any + +from ..cmd import Command + +class install_data(Command): + description: str + user_options: Any + boolean_options: Any + install_dir: Any + outfiles: Any + root: Any + force: int + data_files: Any + warn_dir: int + def initialize_options(self) -> None: ... + def finalize_options(self) -> None: ... + def run(self) -> None: ... + def get_inputs(self): ... + def get_outputs(self): ... diff --git a/stdlib/distutils/command/install_egg_info.pyi b/stdlib/distutils/command/install_egg_info.pyi index 80ffb19bd..776eafc1d 100644 --- a/stdlib/distutils/command/install_egg_info.pyi +++ b/stdlib/distutils/command/install_egg_info.pyi @@ -1,10 +1,18 @@ -from distutils.cmd import Command -from typing import ClassVar, List, Optional, Tuple +from typing import Any, ClassVar + +from ..cmd import Command class install_egg_info(Command): description: ClassVar[str] - user_options: ClassVar[List[Tuple[str, Optional[str], str]]] + user_options: ClassVar[list[tuple[str, str | None, str]]] + install_dir: Any def initialize_options(self) -> None: ... + target: Any + outputs: Any def finalize_options(self) -> None: ... def run(self) -> None: ... - def get_outputs(self) -> List[str]: ... + def get_outputs(self) -> list[str]: ... + +def safe_name(name): ... +def safe_version(version): ... +def to_filename(name): ... diff --git a/stdlib/distutils/command/install_headers.pyi b/stdlib/distutils/command/install_headers.pyi index e69de29bb..795bd1cf8 100644 --- a/stdlib/distutils/command/install_headers.pyi +++ b/stdlib/distutils/command/install_headers.pyi @@ -0,0 +1,16 @@ +from typing import Any + +from ..cmd import Command + +class install_headers(Command): + description: str + user_options: Any + boolean_options: Any + install_dir: Any + force: int + outfiles: Any + def initialize_options(self) -> None: ... + def finalize_options(self) -> None: ... + def run(self) -> None: ... + def get_inputs(self): ... + def get_outputs(self): ... diff --git a/stdlib/distutils/command/install_lib.pyi b/stdlib/distutils/command/install_lib.pyi index e69de29bb..a6a5e4e73 100644 --- a/stdlib/distutils/command/install_lib.pyi +++ b/stdlib/distutils/command/install_lib.pyi @@ -0,0 +1,25 @@ +from typing import Any + +from ..cmd import Command + +PYTHON_SOURCE_EXTENSION: str + +class install_lib(Command): + description: str + user_options: Any + boolean_options: Any + negative_opt: Any + install_dir: Any + build_dir: Any + force: int + compile: Any + optimize: Any + skip_build: Any + def initialize_options(self) -> None: ... + def finalize_options(self) -> None: ... + def run(self) -> None: ... + def build(self) -> None: ... + def install(self): ... + def byte_compile(self, files) -> None: ... + def get_outputs(self): ... + def get_inputs(self): ... diff --git a/stdlib/distutils/command/install_scripts.pyi b/stdlib/distutils/command/install_scripts.pyi index e69de29bb..92728a16a 100644 --- a/stdlib/distutils/command/install_scripts.pyi +++ b/stdlib/distutils/command/install_scripts.pyi @@ -0,0 +1,18 @@ +from typing import Any + +from ..cmd import Command + +class install_scripts(Command): + description: str + user_options: Any + boolean_options: Any + install_dir: Any + force: int + build_dir: Any + skip_build: Any + def initialize_options(self) -> None: ... + def finalize_options(self) -> None: ... + outfiles: Any + def run(self) -> None: ... + def get_inputs(self): ... + def get_outputs(self): ... diff --git a/stdlib/distutils/command/register.pyi b/stdlib/distutils/command/register.pyi index e69de29bb..a1a7a45fb 100644 --- a/stdlib/distutils/command/register.pyi +++ b/stdlib/distutils/command/register.pyi @@ -0,0 +1,18 @@ +from typing import Any + +from ..config import PyPIRCCommand + +class register(PyPIRCCommand): + description: str + sub_commands: Any + list_classifiers: int + strict: int + def initialize_options(self) -> None: ... + def finalize_options(self) -> None: ... + def run(self) -> None: ... + def check_metadata(self) -> None: ... + def classifiers(self) -> None: ... + 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 = ...): ... diff --git a/stdlib/distutils/command/sdist.pyi b/stdlib/distutils/command/sdist.pyi index e69de29bb..636c4a351 100644 --- a/stdlib/distutils/command/sdist.pyi +++ b/stdlib/distutils/command/sdist.pyi @@ -0,0 +1,42 @@ +from typing import Any + +from ..cmd import Command + +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 + sub_commands: Any + READMES: Any + template: Any + manifest: Any + use_defaults: int + prune: int + manifest_only: int + force_manifest: int + formats: Any + keep_temp: int + dist_dir: Any + archive_files: Any + metadata_check: int + owner: Any + group: Any + def initialize_options(self) -> None: ... + def finalize_options(self) -> None: ... + filelist: Any + def run(self) -> None: ... + def check_metadata(self) -> None: ... + def get_file_list(self) -> None: ... + def add_defaults(self) -> None: ... + def read_template(self) -> None: ... + def prune_file_list(self) -> None: ... + def write_manifest(self) -> None: ... + def read_manifest(self) -> None: ... + def make_release_tree(self, base_dir, files) -> None: ... + def make_distribution(self) -> None: ... + def get_archive_files(self): ... diff --git a/stdlib/distutils/command/upload.pyi b/stdlib/distutils/command/upload.pyi index ef4bbc332..e6b77825c 100644 --- a/stdlib/distutils/command/upload.pyi +++ b/stdlib/distutils/command/upload.pyi @@ -1,8 +1,17 @@ -from distutils.config import PyPIRCCommand -from typing import ClassVar, List +from typing import Any, ClassVar + +from ..config import PyPIRCCommand class upload(PyPIRCCommand): description: ClassVar[str] - boolean_options: ClassVar[List[str]] + username: str + password: str + show_response: int + sign: bool + identity: Any + def initialize_options(self) -> None: ... + repository: Any + realm: Any + def finalize_options(self) -> None: ... def run(self) -> None: ... def upload_file(self, command: str, pyversion: str, filename: str) -> None: ... diff --git a/stdlib/distutils/config.pyi b/stdlib/distutils/config.pyi index e60507e0b..5814a8284 100644 --- a/stdlib/distutils/config.pyi +++ b/stdlib/distutils/config.pyi @@ -1,6 +1,6 @@ from abc import abstractmethod from distutils.cmd import Command -from typing import ClassVar, List, Optional, Tuple +from typing import ClassVar DEFAULT_PYPIRC: str @@ -9,8 +9,8 @@ class PyPIRCCommand(Command): DEFAULT_REALM: ClassVar[str] repository: None realm: None - user_options: ClassVar[List[Tuple[str, Optional[str], str]]] - boolean_options: ClassVar[List[str]] + user_options: ClassVar[list[tuple[str, str | None, str]]] + boolean_options: ClassVar[list[str]] def initialize_options(self) -> None: ... def finalize_options(self) -> None: ... @abstractmethod diff --git a/tests/stubtest_allowlists/py3_common.txt b/tests/stubtest_allowlists/py3_common.txt index d513aad2f..70ecd06ee 100644 --- a/tests/stubtest_allowlists/py3_common.txt +++ b/tests/stubtest_allowlists/py3_common.txt @@ -235,6 +235,7 @@ builtins.quit builtins.reveal_locals builtins.reveal_type collections.abc.* # Types are re-exported from _collections_abc, so errors should be fixed there +distutils.command.check.SilentReporter # only defined if docutils in installed # Dynamically specified by __getattr__, and thus don't exist on the class tempfile._TemporaryFileWrapper.[\w_]+ # Various classes in typing aren't types at runtime. In addition, mypy thinks some special forms are tautologically defined.