Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove most of setuptools._distutils #9795

Merged
merged 9 commits into from
Feb 26, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 12 additions & 6 deletions stubs/setuptools/@tests/stubtest_allowlist.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,19 @@ pkg_resources.declare_namespace
pkg_resources.fixup_namespace_packages
pkg_resources.get_entry_map
pkg_resources.get_provider
pkg_resources.py31compat
pkg_resources.split_sections
pkg_resources.to_filename

# Only present if docutils is installed
setuptools._distutils.command.check.SilentReporter
# Uncomment once ignore_missing_stub is turned off
# # Not supported by typeshed
# setuptools.py34compat

# Discrepancy in the value of the default
# between setuptools's version of distutils and the stdlib distutils
setuptools._distutils.core.Command.announce
# # Private modules
# setuptools.config._validate_pyproject.*
# setuptools.build_meta._BuildMetaBackend.*

# # Vendored and modified version of stdlib's distutils. Basically implementation details
# setuptools._distutils.*
# # Other vendored code
# setuptools._vendor.*
# pkg_resources._vendor.*
1 change: 0 additions & 1 deletion stubs/setuptools/METADATA.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
version = "67.4.*"
requires = ["types-docutils"]

[tool.stubtest]
ignore_missing_stub = true
5 changes: 0 additions & 5 deletions stubs/setuptools/pkg_resources/py31compat.pyi

This file was deleted.

3 changes: 2 additions & 1 deletion stubs/setuptools/setuptools/__init__.pyi
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
from abc import abstractmethod
from collections.abc import Iterable, Mapping, Sequence
from distutils.core import Command as _Command
from typing import Any

from setuptools._deprecation_warning import SetuptoolsDeprecationWarning as SetuptoolsDeprecationWarning
from setuptools.depends import Require as Require
from setuptools.dist import Distribution as Distribution
from setuptools.extension import Extension as Extension

from ._distutils.cmd import Command as _Command

__version__: str

class PackageFinder:
Expand Down
Empty file.
20 changes: 0 additions & 20 deletions stubs/setuptools/setuptools/_distutils/archive_util.pyi

This file was deleted.

3 changes: 0 additions & 3 deletions stubs/setuptools/setuptools/_distutils/bcppcompiler.pyi

This file was deleted.

152 changes: 0 additions & 152 deletions stubs/setuptools/setuptools/_distutils/ccompiler.pyi

This file was deleted.

25 changes: 15 additions & 10 deletions stubs/setuptools/setuptools/_distutils/cmd.pyi
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
from _typeshed import Incomplete
from abc import abstractmethod
from collections.abc import Callable, Iterable
from distutils.dist import Distribution
from typing import Any
from typing import ClassVar
from typing_extensions import Self

from .dist import Distribution

class Command:
sub_commands: list[tuple[str, Callable[[Command], bool] | None]]
sub_commands: ClassVar[list[tuple[str, Callable[[Self], bool] | None]]]
def __init__(self, dist: Distribution) -> None: ...
@abstractmethod
def initialize_options(self) -> None: ...
Expand All @@ -25,7 +28,9 @@ class Command:
def run_command(self, command: str) -> None: ...
def get_sub_commands(self) -> list[str]: ...
def warn(self, msg: str) -> None: ...
def execute(self, func: Callable[..., object], args: Iterable[Any], msg: str | None = ..., level: int = ...) -> None: ...
def execute(
self, func: Callable[..., object], args: Iterable[Incomplete], msg: str | None = ..., level: int = ...
) -> None: ...
def mkpath(self, name: str, mode: int = ...) -> None: ...
def copy_file(
self,
Expand All @@ -34,7 +39,7 @@ class Command:
preserve_mode: int = ...,
preserve_times: int = ...,
link: str | None = ...,
level: Any = ...,
level: int = ...,
) -> tuple[str, bool]: ... # level is not used
def copy_tree(
self,
Expand All @@ -43,10 +48,10 @@ class Command:
preserve_mode: int = ...,
preserve_times: int = ...,
preserve_symlinks: int = ...,
level: Any = ...,
level: int = ...,
) -> list[str]: ... # level is not used
def move_file(self, src: str, dst: str, level: Any = ...) -> str: ... # level is not used
def spawn(self, cmd: Iterable[str], search_path: int = ..., level: Any = ...) -> None: ... # level is not used
def move_file(self, src: str, dst: str, level: int = ...) -> str: ... # level is not used
def spawn(self, cmd: Iterable[str], search_path: int = ..., level: int = ...) -> None: ... # level is not used
def make_archive(
self,
base_name: str,
Expand All @@ -61,8 +66,8 @@ class Command:
infiles: str | list[str] | tuple[str, ...],
outfile: str,
func: Callable[..., object],
args: list[Any],
args: list[Incomplete],
exec_msg: str | None = ...,
skip_msg: str | None = ...,
level: Any = ...,
level: int = ...,
) -> None: ... # level is not used
Empty file.
25 changes: 0 additions & 25 deletions stubs/setuptools/setuptools/_distutils/command/bdist.pyi

This file was deleted.

21 changes: 0 additions & 21 deletions stubs/setuptools/setuptools/_distutils/command/bdist_dumb.pyi

This file was deleted.

52 changes: 0 additions & 52 deletions stubs/setuptools/setuptools/_distutils/command/bdist_rpm.pyi

This file was deleted.

Loading