Skip to content

Commit 614aa1a

Browse files
authored
Bring back a few setuptools._distutils files (#10401)
1 parent 31dca1d commit 614aa1a

File tree

5 files changed

+219
-0
lines changed

5 files changed

+219
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
def make_archive(
2+
base_name: str,
3+
format: str,
4+
root_dir: str | None = ...,
5+
base_dir: str | None = ...,
6+
verbose: int = ...,
7+
dry_run: int = ...,
8+
owner: str | None = ...,
9+
group: str | None = ...,
10+
) -> str: ...
11+
def make_tarball(
12+
base_name: str,
13+
base_dir: str,
14+
compress: str | None = ...,
15+
verbose: int = ...,
16+
dry_run: int = ...,
17+
owner: str | None = ...,
18+
group: str | None = ...,
19+
) -> str: ...
20+
def make_zipfile(base_name: str, base_dir: str, verbose: int = ..., dry_run: int = ...) -> str: ...
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,152 @@
1+
from collections.abc import Callable
2+
from typing import Any
3+
from typing_extensions import TypeAlias
4+
5+
_Macro: TypeAlias = tuple[str] | tuple[str, str | None]
6+
7+
def gen_lib_options(
8+
compiler: CCompiler, library_dirs: list[str], runtime_library_dirs: list[str], libraries: list[str]
9+
) -> list[str]: ...
10+
def gen_preprocess_options(macros: list[_Macro], include_dirs: list[str]) -> list[str]: ...
11+
def get_default_compiler(osname: str | None = ..., platform: str | None = ...) -> str: ...
12+
def new_compiler(
13+
plat: str | None = ..., compiler: str | None = ..., verbose: int = ..., dry_run: int = ..., force: int = ...
14+
) -> CCompiler: ...
15+
def show_compilers() -> None: ...
16+
17+
class CCompiler:
18+
dry_run: bool
19+
force: bool
20+
verbose: bool
21+
output_dir: str | None
22+
macros: list[_Macro]
23+
include_dirs: list[str]
24+
libraries: list[str]
25+
library_dirs: list[str]
26+
runtime_library_dirs: list[str]
27+
objects: list[str]
28+
def __init__(self, verbose: int = ..., dry_run: int = ..., force: int = ...) -> None: ...
29+
def add_include_dir(self, dir: str) -> None: ...
30+
def set_include_dirs(self, dirs: list[str]) -> None: ...
31+
def add_library(self, libname: str) -> None: ...
32+
def set_libraries(self, libnames: list[str]) -> None: ...
33+
def add_library_dir(self, dir: str) -> None: ...
34+
def set_library_dirs(self, dirs: list[str]) -> None: ...
35+
def add_runtime_library_dir(self, dir: str) -> None: ...
36+
def set_runtime_library_dirs(self, dirs: list[str]) -> None: ...
37+
def define_macro(self, name: str, value: str | None = ...) -> None: ...
38+
def undefine_macro(self, name: str) -> None: ...
39+
def add_link_object(self, object: str) -> None: ...
40+
def set_link_objects(self, objects: list[str]) -> None: ...
41+
def detect_language(self, sources: str | list[str]) -> str | None: ...
42+
def find_library_file(self, dirs: list[str], lib: str, debug: bool = ...) -> str | None: ...
43+
def has_function(
44+
self,
45+
funcname: str,
46+
includes: list[str] | None = ...,
47+
include_dirs: list[str] | None = ...,
48+
libraries: list[str] | None = ...,
49+
library_dirs: list[str] | None = ...,
50+
) -> bool: ...
51+
def library_dir_option(self, dir: str) -> str: ...
52+
def library_option(self, lib: str) -> str: ...
53+
def runtime_library_dir_option(self, dir: str) -> str: ...
54+
def set_executables(self, **args: str) -> None: ...
55+
def compile(
56+
self,
57+
sources: list[str],
58+
output_dir: str | None = ...,
59+
macros: _Macro | None = ...,
60+
include_dirs: list[str] | None = ...,
61+
debug: bool = ...,
62+
extra_preargs: list[str] | None = ...,
63+
extra_postargs: list[str] | None = ...,
64+
depends: list[str] | None = ...,
65+
) -> list[str]: ...
66+
def create_static_lib(
67+
self,
68+
objects: list[str],
69+
output_libname: str,
70+
output_dir: str | None = ...,
71+
debug: bool = ...,
72+
target_lang: str | None = ...,
73+
) -> None: ...
74+
def link(
75+
self,
76+
target_desc: str,
77+
objects: list[str],
78+
output_filename: str,
79+
output_dir: str | None = ...,
80+
libraries: list[str] | None = ...,
81+
library_dirs: list[str] | None = ...,
82+
runtime_library_dirs: list[str] | None = ...,
83+
export_symbols: list[str] | None = ...,
84+
debug: bool = ...,
85+
extra_preargs: list[str] | None = ...,
86+
extra_postargs: list[str] | None = ...,
87+
build_temp: str | None = ...,
88+
target_lang: str | None = ...,
89+
) -> None: ...
90+
def link_executable(
91+
self,
92+
objects: list[str],
93+
output_progname: str,
94+
output_dir: str | None = ...,
95+
libraries: list[str] | None = ...,
96+
library_dirs: list[str] | None = ...,
97+
runtime_library_dirs: list[str] | None = ...,
98+
debug: bool = ...,
99+
extra_preargs: list[str] | None = ...,
100+
extra_postargs: list[str] | None = ...,
101+
target_lang: str | None = ...,
102+
) -> None: ...
103+
def link_shared_lib(
104+
self,
105+
objects: list[str],
106+
output_libname: str,
107+
output_dir: str | None = ...,
108+
libraries: list[str] | None = ...,
109+
library_dirs: list[str] | None = ...,
110+
runtime_library_dirs: list[str] | None = ...,
111+
export_symbols: list[str] | None = ...,
112+
debug: bool = ...,
113+
extra_preargs: list[str] | None = ...,
114+
extra_postargs: list[str] | None = ...,
115+
build_temp: str | None = ...,
116+
target_lang: str | None = ...,
117+
) -> None: ...
118+
def link_shared_object(
119+
self,
120+
objects: list[str],
121+
output_filename: str,
122+
output_dir: str | None = ...,
123+
libraries: list[str] | None = ...,
124+
library_dirs: list[str] | None = ...,
125+
runtime_library_dirs: list[str] | None = ...,
126+
export_symbols: list[str] | None = ...,
127+
debug: bool = ...,
128+
extra_preargs: list[str] | None = ...,
129+
extra_postargs: list[str] | None = ...,
130+
build_temp: str | None = ...,
131+
target_lang: str | None = ...,
132+
) -> None: ...
133+
def preprocess(
134+
self,
135+
source: str,
136+
output_file: str | None = ...,
137+
macros: list[_Macro] | None = ...,
138+
include_dirs: list[str] | None = ...,
139+
extra_preargs: list[str] | None = ...,
140+
extra_postargs: list[str] | None = ...,
141+
) -> None: ...
142+
def executable_filename(self, basename: str, strip_dir: int = ..., output_dir: str = ...) -> str: ...
143+
def library_filename(self, libname: str, lib_type: str = ..., strip_dir: int = ..., output_dir: str = ...) -> str: ...
144+
def object_filenames(self, source_filenames: list[str], strip_dir: int = ..., output_dir: str = ...) -> list[str]: ...
145+
def shared_object_filename(self, basename: str, strip_dir: int = ..., output_dir: str = ...) -> str: ...
146+
def execute(self, func: Callable[..., object], args: tuple[Any, ...], msg: str | None = ..., level: int = ...) -> None: ...
147+
def spawn(self, cmd: list[str]) -> None: ...
148+
def mkpath(self, name: str, mode: int = ...) -> None: ...
149+
def move_file(self, src: str, dst: str) -> str: ...
150+
def announce(self, msg: str, level: int = ...) -> None: ...
151+
def warn(self, msg: str) -> None: ...
152+
def debug_print(self, msg: str) -> None: ...
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
def newer(source: str, target: str) -> bool: ...
2+
def newer_pairwise(sources: list[str], targets: list[str]) -> list[tuple[str, str]]: ...
3+
def newer_group(sources: list[str], target: str, missing: str = ...) -> bool: ...
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
from collections.abc import Mapping
2+
3+
from setuptools._distutils.ccompiler import CCompiler
4+
5+
PREFIX: str
6+
EXEC_PREFIX: str
7+
8+
def get_config_var(name: str) -> int | str | None: ...
9+
def get_config_vars(*args: str) -> Mapping[str, int | str]: ...
10+
def get_config_h_filename() -> str: ...
11+
def get_makefile_filename() -> str: ...
12+
def get_python_inc(plat_specific: bool = ..., prefix: str | None = ...) -> str: ...
13+
def get_python_lib(plat_specific: bool = ..., standard_lib: bool = ..., prefix: str | None = ...) -> str: ...
14+
def customize_compiler(compiler: CCompiler) -> None: ...
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
from collections.abc import Callable, Mapping
2+
from typing import Any
3+
from typing_extensions import Literal
4+
5+
def get_host_platform() -> str: ...
6+
def get_platform() -> str: ...
7+
def get_macosx_target_ver_from_syscfg(): ...
8+
def get_macosx_target_ver(): ...
9+
def split_version(s: str) -> list[int]: ...
10+
def convert_path(pathname: str) -> str: ...
11+
def change_root(new_root: str, pathname: str) -> str: ...
12+
def check_environ() -> None: ...
13+
def subst_vars(s: str, local_vars: Mapping[str, str]) -> None: ...
14+
def grok_environment_error(exc: object, prefix: str = ...) -> str: ...
15+
def split_quoted(s: str) -> list[str]: ...
16+
def execute(
17+
func: Callable[..., object], args: tuple[Any, ...], msg: str | None = ..., verbose: bool = ..., dry_run: bool = ...
18+
) -> None: ...
19+
def strtobool(val: str) -> Literal[0, 1]: ...
20+
def byte_compile(
21+
py_files: list[str],
22+
optimize: int = ...,
23+
force: bool = ...,
24+
prefix: str | None = ...,
25+
base_dir: str | None = ...,
26+
verbose: bool = ...,
27+
dry_run: bool = ...,
28+
direct: bool | None = ...,
29+
) -> None: ...
30+
def rfc822_escape(header: str) -> str: ...

0 commit comments

Comments
 (0)