Skip to content

Commit fee5f1b

Browse files
authored
Remove most of setuptools._distutils (#9795)
1 parent 2c5df19 commit fee5f1b

Some content is hidden

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

70 files changed

+174
-1001
lines changed

stubs/setuptools/@tests/stubtest_allowlist.txt

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,19 @@ pkg_resources.declare_namespace
2323
pkg_resources.fixup_namespace_packages
2424
pkg_resources.get_entry_map
2525
pkg_resources.get_provider
26-
pkg_resources.py31compat
2726
pkg_resources.split_sections
2827
pkg_resources.to_filename
2928

30-
# Only present if docutils is installed
31-
setuptools._distutils.command.check.SilentReporter
29+
# Uncomment once ignore_missing_stub is turned off
30+
# # Not supported by typeshed
31+
# setuptools.py34compat
3232

33-
# Discrepancy in the value of the default
34-
# between setuptools's version of distutils and the stdlib distutils
35-
setuptools._distutils.core.Command.announce
33+
# # Private modules
34+
# setuptools.config._validate_pyproject.*
35+
# setuptools.build_meta._BuildMetaBackend.*
36+
37+
# # Vendored and modified version of stdlib's distutils. Basically implementation details
38+
# setuptools._distutils.*
39+
# # Other vendored code
40+
# setuptools._vendor.*
41+
# pkg_resources._vendor.*

stubs/setuptools/METADATA.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
version = "67.4.*"
2-
requires = ["types-docutils"]
32

43
[tool.stubtest]
54
ignore_missing_stub = true

stubs/setuptools/pkg_resources/py31compat.pyi

Lines changed: 0 additions & 5 deletions
This file was deleted.

stubs/setuptools/setuptools/__init__.pyi

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
from abc import abstractmethod
22
from collections.abc import Iterable, Mapping, Sequence
3-
from distutils.core import Command as _Command
43
from typing import Any
54

65
from setuptools._deprecation_warning import SetuptoolsDeprecationWarning as SetuptoolsDeprecationWarning
76
from setuptools.depends import Require as Require
87
from setuptools.dist import Distribution as Distribution
98
from setuptools.extension import Extension as Extension
109

10+
from ._distutils.cmd import Command as _Command
11+
1112
__version__: str
1213

1314
class PackageFinder:

stubs/setuptools/setuptools/_distutils/__init__.pyi

Whitespace-only changes.

stubs/setuptools/setuptools/_distutils/archive_util.pyi

Lines changed: 0 additions & 20 deletions
This file was deleted.

stubs/setuptools/setuptools/_distutils/bcppcompiler.pyi

Lines changed: 0 additions & 3 deletions
This file was deleted.

stubs/setuptools/setuptools/_distutils/ccompiler.pyi

Lines changed: 0 additions & 152 deletions
This file was deleted.

stubs/setuptools/setuptools/_distutils/cmd.pyi

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
1+
from _typeshed import Incomplete
12
from abc import abstractmethod
23
from collections.abc import Callable, Iterable
3-
from distutils.dist import Distribution
4-
from typing import Any
4+
from typing import ClassVar
5+
from typing_extensions import Self
6+
7+
from .dist import Distribution
58

69
class Command:
7-
sub_commands: list[tuple[str, Callable[[Command], bool] | None]]
10+
sub_commands: ClassVar[list[tuple[str, Callable[[Self], bool] | None]]]
811
def __init__(self, dist: Distribution) -> None: ...
912
@abstractmethod
1013
def initialize_options(self) -> None: ...
@@ -25,7 +28,9 @@ class Command:
2528
def run_command(self, command: str) -> None: ...
2629
def get_sub_commands(self) -> list[str]: ...
2730
def warn(self, msg: str) -> None: ...
28-
def execute(self, func: Callable[..., object], args: Iterable[Any], msg: str | None = ..., level: int = ...) -> None: ...
31+
def execute(
32+
self, func: Callable[..., object], args: Iterable[Incomplete], msg: str | None = ..., level: int = ...
33+
) -> None: ...
2934
def mkpath(self, name: str, mode: int = ...) -> None: ...
3035
def copy_file(
3136
self,
@@ -34,7 +39,7 @@ class Command:
3439
preserve_mode: int = ...,
3540
preserve_times: int = ...,
3641
link: str | None = ...,
37-
level: Any = ...,
42+
level: int = ...,
3843
) -> tuple[str, bool]: ... # level is not used
3944
def copy_tree(
4045
self,
@@ -43,10 +48,10 @@ class Command:
4348
preserve_mode: int = ...,
4449
preserve_times: int = ...,
4550
preserve_symlinks: int = ...,
46-
level: Any = ...,
51+
level: int = ...,
4752
) -> list[str]: ... # level is not used
48-
def move_file(self, src: str, dst: str, level: Any = ...) -> str: ... # level is not used
49-
def spawn(self, cmd: Iterable[str], search_path: int = ..., level: Any = ...) -> None: ... # level is not used
53+
def move_file(self, src: str, dst: str, level: int = ...) -> str: ... # level is not used
54+
def spawn(self, cmd: Iterable[str], search_path: int = ..., level: int = ...) -> None: ... # level is not used
5055
def make_archive(
5156
self,
5257
base_name: str,
@@ -61,8 +66,8 @@ class Command:
6166
infiles: str | list[str] | tuple[str, ...],
6267
outfile: str,
6368
func: Callable[..., object],
64-
args: list[Any],
69+
args: list[Incomplete],
6570
exec_msg: str | None = ...,
6671
skip_msg: str | None = ...,
67-
level: Any = ...,
72+
level: int = ...,
6873
) -> None: ... # level is not used

stubs/setuptools/setuptools/_distutils/command/__init__.pyi

Whitespace-only changes.

stubs/setuptools/setuptools/_distutils/command/bdist.pyi

Lines changed: 0 additions & 25 deletions
This file was deleted.

stubs/setuptools/setuptools/_distutils/command/bdist_dumb.pyi

Lines changed: 0 additions & 21 deletions
This file was deleted.

stubs/setuptools/setuptools/_distutils/command/bdist_rpm.pyi

Lines changed: 0 additions & 52 deletions
This file was deleted.

0 commit comments

Comments
 (0)