Skip to content

Commit db69e41

Browse files
authored
Add setuptools stubs (#5762)
1 parent d74a5a9 commit db69e41

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+1163
-1
lines changed

pyrightconfig.stricter.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@
5656
"stubs/requests",
5757
"stubs/selenium",
5858
"stubs/Send2Trash",
59+
"stubs/setuptools",
5960
"stubs/simplejson",
6061
"stubs/slumber",
6162
"stubs/stripe",

stubs/setuptools/METADATA.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
version = "57.0"
1+
version = "57.4"
Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
from abc import abstractmethod
2+
from collections.abc import Iterable, Mapping
3+
from distutils.core import Command as _Command
4+
from typing import Any, Type
5+
6+
from setuptools._deprecation_warning import SetuptoolsDeprecationWarning as SetuptoolsDeprecationWarning
7+
from setuptools.depends import Require as Require
8+
from setuptools.dist import Distribution as Distribution
9+
from setuptools.extension import Extension as Extension
10+
11+
__version__: str
12+
13+
class PackageFinder:
14+
@classmethod
15+
def find(cls, where: str = ..., exclude: Iterable[str] = ..., include: Iterable[str] = ...) -> list[str]: ...
16+
17+
class PEP420PackageFinder(PackageFinder): ...
18+
19+
find_packages = PackageFinder.find
20+
find_namespace_packages = PEP420PackageFinder.find
21+
22+
def setup(
23+
*,
24+
name: str = ...,
25+
version: str = ...,
26+
description: str = ...,
27+
long_description: str = ...,
28+
author: str = ...,
29+
author_email: str = ...,
30+
maintainer: str = ...,
31+
maintainer_email: str = ...,
32+
url: str = ...,
33+
download_url: str = ...,
34+
packages: list[str] = ...,
35+
py_modules: list[str] = ...,
36+
scripts: list[str] = ...,
37+
ext_modules: list[Extension] = ...,
38+
classifiers: list[str] = ...,
39+
distclass: Type[Distribution] = ...,
40+
script_name: str = ...,
41+
script_args: list[str] = ...,
42+
options: Mapping[str, Any] = ...,
43+
license: str = ...,
44+
keywords: list[str] | str = ...,
45+
platforms: list[str] | str = ...,
46+
cmdclass: Mapping[str, Type[Command]] = ...,
47+
data_files: list[tuple[str, list[str]]] = ...,
48+
package_dir: Mapping[str, str] = ...,
49+
obsoletes: list[str] = ...,
50+
provides: list[str] = ...,
51+
requires: list[str] = ...,
52+
command_packages: list[str] = ...,
53+
command_options: Mapping[str, Mapping[str, tuple[Any, Any]]] = ...,
54+
package_data: Mapping[str, list[str]] = ...,
55+
include_package_data: bool = ...,
56+
libraries: list[str] = ...,
57+
headers: list[str] = ...,
58+
ext_package: str = ...,
59+
include_dirs: list[str] = ...,
60+
password: str = ...,
61+
fullname: str = ...,
62+
**attrs: Any,
63+
) -> None: ...
64+
65+
class Command(_Command):
66+
command_consumes_arguments: bool
67+
def __init__(self, dist: Distribution, **kw: Any) -> None: ...
68+
def ensure_string_list(self, option: str | list[str]) -> None: ...
69+
def reinitialize_command(self, command: _Command | str, reinit_subcommands: int = ..., **kw: Any) -> _Command: ...
70+
@abstractmethod
71+
def initialize_options(self) -> None: ...
72+
@abstractmethod
73+
def finalize_options(self) -> None: ...
74+
@abstractmethod
75+
def run(self) -> None: ...
76+
77+
class sic(str): ...
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
class SetuptoolsDeprecationWarning(Warning): ...
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
from distutils.errors import DistutilsError
2+
from typing import Any
3+
4+
class UnrecognizedFormat(DistutilsError): ...
5+
6+
def default_filter(src, dst): ...
7+
def unpack_archive(filename, extract_dir, progress_filter=..., drivers: Any | None = ...) -> None: ...
8+
def unpack_directory(filename, extract_dir, progress_filter=...) -> None: ...
9+
def unpack_zipfile(filename, extract_dir, progress_filter=...) -> None: ...
10+
def unpack_tarfile(filename, extract_dir, progress_filter=...): ...
11+
12+
extraction_drivers: Any
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
from typing import Any
2+
3+
from setuptools import dist
4+
5+
class SetupRequirementsError(BaseException):
6+
specifiers: Any
7+
def __init__(self, specifiers) -> None: ...
8+
9+
class Distribution(dist.Distribution):
10+
def fetch_build_eggs(self, specifiers) -> None: ...
11+
@classmethod
12+
def patch(cls) -> None: ...
13+
14+
class _BuildMetaBackend:
15+
def run_setup(self, setup_script: str = ...) -> None: ...
16+
def get_requires_for_build_wheel(self, config_settings: Any | None = ...): ...
17+
def get_requires_for_build_sdist(self, config_settings: Any | None = ...): ...
18+
def prepare_metadata_for_build_wheel(self, metadata_directory, config_settings: Any | None = ...): ...
19+
def build_wheel(self, wheel_directory, config_settings: Any | None = ..., metadata_directory: Any | None = ...): ...
20+
def build_sdist(self, sdist_directory, config_settings: Any | None = ...): ...
21+
22+
class _BuildMetaLegacyBackend(_BuildMetaBackend):
23+
def run_setup(self, setup_script: str = ...) -> None: ...
24+
25+
get_requires_for_build_wheel: Any
26+
get_requires_for_build_sdist: Any
27+
prepare_metadata_for_build_wheel: Any
28+
build_wheel: Any
29+
build_sdist: Any
30+
__legacy__: Any

stubs/setuptools/setuptools/command/__init__.pyi

Whitespace-only changes.
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
from typing import Any
2+
3+
from setuptools.command.setopt import option_base
4+
5+
def shquote(arg): ...
6+
7+
class alias(option_base):
8+
description: str
9+
command_consumes_arguments: bool
10+
user_options: Any
11+
boolean_options: Any
12+
args: Any
13+
remove: Any
14+
def initialize_options(self) -> None: ...
15+
def finalize_options(self) -> None: ...
16+
def run(self) -> None: ...
17+
18+
def format_alias(name, aliases): ...
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
from typing import Any
2+
3+
from setuptools import Command
4+
5+
def strip_module(filename): ...
6+
def sorted_walk(dir) -> None: ...
7+
def write_stub(resource, pyfile) -> None: ...
8+
9+
class bdist_egg(Command):
10+
description: str
11+
user_options: Any
12+
boolean_options: Any
13+
bdist_dir: Any
14+
plat_name: Any
15+
keep_temp: int
16+
dist_dir: Any
17+
skip_build: int
18+
egg_output: Any
19+
exclude_source_files: Any
20+
def initialize_options(self) -> None: ...
21+
egg_info: Any
22+
def finalize_options(self) -> None: ...
23+
def do_install_data(self) -> None: ...
24+
def get_outputs(self): ...
25+
def call_command(self, cmdname, **kw): ...
26+
stubs: Any
27+
def run(self) -> None: ...
28+
def zap_pyfiles(self) -> None: ...
29+
def zip_safe(self): ...
30+
def gen_header(self): ...
31+
def copy_metadata_to(self, target_dir) -> None: ...
32+
def get_ext_outputs(self): ...
33+
34+
NATIVE_EXTENSIONS: Any
35+
36+
def walk_egg(egg_dir) -> None: ...
37+
def analyze_egg(egg_dir, stubs): ...
38+
def write_safety_flag(egg_dir, safe) -> None: ...
39+
40+
safety_flags: Any
41+
42+
def scan_module(egg_dir, base, name, stubs): ...
43+
def iter_symbols(code) -> None: ...
44+
def can_scan(): ...
45+
46+
INSTALL_DIRECTORY_ATTRS: Any
47+
48+
def make_zipfile(zip_filename, base_dir, verbose: int = ..., dry_run: int = ..., compress: bool = ..., mode: str = ...): ...
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
import distutils.command.bdist_rpm as orig
2+
3+
class bdist_rpm(orig.bdist_rpm):
4+
def run(self) -> None: ...
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
import distutils.command.build_clib as orig
2+
3+
class build_clib(orig.build_clib):
4+
def build_libraries(self, libraries) -> None: ...
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
from distutils.command.build_ext import build_ext as _build_ext
2+
from typing import Any
3+
4+
have_rtld: bool
5+
use_stubs: bool
6+
libtype: str
7+
8+
def if_dl(s): ...
9+
def get_abi3_suffix(): ...
10+
11+
class build_ext(_build_ext):
12+
inplace: Any
13+
def run(self) -> None: ...
14+
def copy_extensions_to_source(self) -> None: ...
15+
def get_ext_filename(self, fullname): ...
16+
shlib_compiler: Any
17+
shlibs: Any
18+
ext_map: Any
19+
def initialize_options(self) -> None: ...
20+
extensions: Any
21+
def finalize_options(self) -> None: ...
22+
def setup_shlib_compiler(self) -> None: ...
23+
def get_export_symbols(self, ext): ...
24+
compiler: Any
25+
def build_extension(self, ext) -> None: ...
26+
def links_to_dynamic(self, ext): ...
27+
def get_outputs(self): ...
28+
def write_stub(self, output_dir, ext, compile: bool = ...) -> None: ...
29+
30+
def link_shared_object(
31+
self,
32+
objects,
33+
output_libname,
34+
output_dir: Any | None = ...,
35+
libraries: Any | None = ...,
36+
library_dirs: Any | None = ...,
37+
runtime_library_dirs: Any | None = ...,
38+
export_symbols: Any | None = ...,
39+
debug: int = ...,
40+
extra_preargs: Any | None = ...,
41+
extra_postargs: Any | None = ...,
42+
build_temp: Any | None = ...,
43+
target_lang: Any | None = ...,
44+
) -> None: ...
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
import distutils.command.build_py as orig
2+
from typing import Any
3+
4+
from setuptools.lib2to3_ex import Mixin2to3
5+
6+
def make_writable(target) -> None: ...
7+
8+
class build_py(orig.build_py, Mixin2to3):
9+
package_data: Any
10+
exclude_package_data: Any
11+
def finalize_options(self) -> None: ...
12+
def run(self) -> None: ...
13+
data_files: Any
14+
def __getattr__(self, attr): ...
15+
def build_module(self, module, module_file, package): ...
16+
def find_data_files(self, package, src_dir): ...
17+
def build_package_data(self) -> None: ...
18+
manifest_files: Any
19+
def analyze_manifest(self) -> None: ...
20+
def get_data_files(self) -> None: ...
21+
def check_package(self, package, package_dir): ...
22+
packages_checked: Any
23+
def initialize_options(self) -> None: ...
24+
def get_package_dir(self, package): ...
25+
def exclude_data_files(self, package, src_dir, files): ...
26+
27+
def assert_relative(path): ...
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
from typing import Any
2+
3+
from setuptools import namespaces
4+
from setuptools.command.easy_install import easy_install
5+
6+
class develop(namespaces.DevelopInstaller, easy_install):
7+
description: str
8+
user_options: Any
9+
boolean_options: Any
10+
command_consumes_arguments: bool
11+
multi_version: bool
12+
def run(self) -> None: ... # type: ignore
13+
uninstall: Any
14+
egg_path: Any
15+
setup_path: Any
16+
always_copy_from: str
17+
def initialize_options(self) -> None: ...
18+
args: Any
19+
egg_link: Any
20+
egg_base: Any
21+
dist: Any
22+
def finalize_options(self) -> None: ...
23+
def install_for_development(self) -> None: ...
24+
def uninstall_link(self) -> None: ...
25+
def install_egg_scripts(self, dist): ...
26+
def install_wrapper_scripts(self, dist): ...
27+
28+
class VersionlessRequirement:
29+
def __init__(self, dist) -> None: ...
30+
def __getattr__(self, name): ...
31+
def as_requirement(self): ...
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
from distutils.core import Command
2+
from typing import Any
3+
4+
class dist_info(Command):
5+
description: str
6+
user_options: Any
7+
egg_base: Any
8+
def initialize_options(self) -> None: ...
9+
def finalize_options(self) -> None: ...
10+
def run(self) -> None: ...

0 commit comments

Comments
 (0)