Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
8748ce8
Experiment: removing setuptools._distutils
Avasam Mar 11, 2025
5c2c6c1
Merge branch 'main' of https://github.com/python/typeshed into removi…
Avasam Mar 15, 2025
c61d00f
Fix contextmanager
Avasam Mar 15, 2025
4276816
Incorrect return type
Avasam Mar 15, 2025
d4f3cce
Teach our other stubs that our setuptools stubs is partial
Avasam Mar 15, 2025
5bd92fb
Remove leftover files post-merge
Avasam Mar 15, 2025
a1aec41
Fix mypy regression test
Avasam Mar 15, 2025
844d55f
Remove extra allowlists
Avasam Mar 15, 2025
75f5217
stubtest allowlist workaround
Avasam Mar 15, 2025
aaf69e2
Update stubs/setuptools/@tests/stubtest_allowlist.txt
Avasam Mar 15, 2025
293f2fe
Merge branch 'main' of https://github.com/python/typeshed into removi…
Avasam Apr 2, 2025
3181e9b
Merge branch 'main' into removing-setuptools._distutils
Avasam Apr 12, 2025
ea6c488
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Apr 12, 2025
690cf3c
Merge branch 'main' into removing-setuptools._distutils
Avasam Apr 14, 2025
f2dbab1
Merge branch 'main' of https://github.com/python/typeshed into removi…
Avasam Apr 14, 2025
40af1fc
ruff check and remove files added back from main
Avasam Apr 14, 2025
bff9ba4
Merge branch 'main' of https://github.com/python/typeshed into removi…
Avasam Jul 4, 2026
9e0b203
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Jul 4, 2026
4d7a99e
Bump setuptools to 83 + Fix tests locally
Avasam Jul 4, 2026
f2ecff4
Merge branch 'removing-setuptools._distutils' of https://github.com/A…
Avasam Jul 4, 2026
da8f20e
Remove workarounds that should be resolved
Avasam Jul 4, 2026
5aa19ad
Reduced changes
Avasam Jul 4, 2026
8e5fa13
Try `dependencies = ["setuptools"]` on cffi
Avasam Jul 4, 2026
6fd9601
Revert cffi to dependencies = ["types-setuptools"]
Avasam Jul 4, 2026
b8dfdd7
Is mypy follow_untyped_imports in metadata.toml still needed ?
Avasam Jul 4, 2026
fbe0c3d
Merge branch 'removing-setuptools._distutils' of https://github.com/A…
Avasam Jul 4, 2026
dd99f7a
Discard changes to lib/ts_utils/mypy.py
Avasam Jul 4, 2026
5324fed
Discard changes to stubs/fanstatic/METADATA.toml
Avasam Jul 4, 2026
9d94bf5
setuptools>=83
Avasam Jul 4, 2026
de4c0c6
Merge branch 'removing-setuptools._distutils' of https://github.com/A…
Avasam Jul 4, 2026
1852822
Merge branch 'main' of https://github.com/python/typeshed into removi…
Avasam Jul 5, 2026
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
102 changes: 20 additions & 82 deletions stubs/setuptools/@tests/stubtest_allowlist.txt
Original file line number Diff line number Diff line change
@@ -1,88 +1,26 @@
# Is a functools.partial, so stubtest says "is not a function"
setuptools._distutils._modified.newer_pairwise_group

# Runtime initializes to None, but this really should never be None when used
setuptools._distutils.compilers.C.base.Compiler.compiler_type

# Dynamically created in __init__
setuptools._distutils.dist.Distribution.get_name
setuptools._distutils.dist.Distribution.get_version
setuptools._distutils.dist.Distribution.get_fullname
setuptools._distutils.dist.Distribution.get_author
setuptools._distutils.dist.Distribution.get_author_email
setuptools._distutils.dist.Distribution.get_maintainer
setuptools._distutils.dist.Distribution.get_maintainer_email
setuptools._distutils.dist.Distribution.get_contact
setuptools._distutils.dist.Distribution.get_contact_email
setuptools._distutils.dist.Distribution.get_url
setuptools._distutils.dist.Distribution.get_license
setuptools._distutils.dist.Distribution.get_licence
setuptools._distutils.dist.Distribution.get_description
setuptools._distutils.dist.Distribution.get_long_description
setuptools._distutils.dist.Distribution.get_keywords
setuptools._distutils.dist.Distribution.get_platforms
setuptools._distutils.dist.Distribution.get_classifiers
setuptools._distutils.dist.Distribution.get_download_url
setuptools._distutils.dist.Distribution.get_requires
setuptools._distutils.dist.Distribution.get_provides
setuptools._distutils.dist.Distribution.get_obsoletes

# Missing objects from setuptools._distutils
setuptools._distutils.archive_util.ARCHIVE_FORMATS
setuptools._distutils.archive_util.check_archive_formats
setuptools._distutils.cmd.Command.dump_options
setuptools._distutils.command.build_ext.extension_name_re
setuptools._distutils.command.install.HAS_USER_SITE
setuptools._distutils.command.install.INSTALL_SCHEMES
setuptools._distutils.command.install.SCHEME_KEYS
setuptools._distutils.command.install.WINDOWS_SCHEME
setuptools._distutils.command.install_lib.PYTHON_SOURCE_EXTENSION
setuptools._distutils.dir_util.SkipRepeatAbsolutePaths.instance
setuptools._distutils.dist.fix_help_options
setuptools._distutils.extension.read_setup_file
setuptools._distutils.filelist.findall
setuptools._distutils.filelist.glob_to_re
setuptools._distutils.filelist.translate_pattern
setuptools._distutils.sysconfig.BASE_EXEC_PREFIX
setuptools._distutils.sysconfig.BASE_PREFIX
setuptools._distutils.sysconfig.IS_PYPY
setuptools._distutils.sysconfig.build_flags
setuptools._distutils.sysconfig.expand_makefile_vars
setuptools._distutils.sysconfig.get_python_version
setuptools._distutils.sysconfig.parse_config_h
setuptools._distutils.sysconfig.parse_makefile
setuptools._distutils.sysconfig.project_base
setuptools._distutils.sysconfig.python_build
setuptools._distutils.util.MACOSX_VERSION_VAR

# Missing submodules from setuptools._distutils
# (Many of these may be implementation details,
# but they can be added if people ask for them)
setuptools._distutils.command.__all__
setuptools._distutils.command.bdist_dumb
setuptools._distutils.command.build_scripts
setuptools._distutils.command.check
setuptools._distutils.command.clean
setuptools._distutils.command.config
setuptools._distutils.command.install_egg_info
setuptools._distutils.command.install_headers
setuptools._distutils.compat.numpy
setuptools._distutils.compat.py39
setuptools._distutils.core
setuptools._distutils.debug
setuptools._distutils.fancy_getopt
setuptools._distutils.log
setuptools._distutils.text_file
setuptools._distutils.version.Version._cmp # abstract method
setuptools._distutils.version.Version.parse # abstract method
setuptools._distutils.version.suppress_known_deprecation
setuptools._distutils.versionpredicate

# Reexported from setuptools._distutils; problems should be fixed there
# Reexported from https://github.com/pypa/distutils; problems should be fixed there
distutils\..+
setuptools._distutils\..+

# Private APIs, tests and other vendored code
setuptools.config._validate_pyproject.*
setuptools.compat.*
setuptools.command.build_py.build_py.existing_egg_info_dir
.+?\.tests.*

# stubtest fails on implicit submodule imports for __all__ (in setuptools/_distutils/command/__init__.py)
# An attempt at a fix was done in https://github.com/pypa/distutils/pull/345,
# but that caused more issues with setuptools' monkeypatching, see conversation in
# https://github.com/pypa/setuptools/issues/4902#issuecomment-2741298642
setuptools.command.bdist_rpm
setuptools.command.bdist_wheel
setuptools.command.build_clib
setuptools.command.build_py
setuptools.command.dist_info
setuptools.command.editable_wheel
setuptools.command.egg_info
setuptools.command.install
setuptools.command.install_lib
setuptools.command.install_scripts
setuptools.command.sdist
setuptools.installer
setuptools.wheel
4 changes: 4 additions & 0 deletions stubs/setuptools/METADATA.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ extra-description = """\
Given that `pkg_resources` is typed since `setuptools >= 71.1`, \
it is no longer included with `types-setuptools`.
"""
dependencies = ["setuptools>=83"] # For setuptools._distutils
# setuptools/_distutils is a vendor of pypa's distutils. Which is now as typed.
# Type-checkers should not skip it just because `types-setuptools` is installed.
partial-stub = true

[tool.stubtest]
# darwin is equivalent to linux for OS-specific methods
Expand Down
1 change: 1 addition & 0 deletions stubs/setuptools/distutils/command/bdist_dumb.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from setuptools._distutils.command.bdist_dumb import *
1 change: 1 addition & 0 deletions stubs/setuptools/distutils/command/build_scripts.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from setuptools._distutils.command.build_scripts import *
1 change: 1 addition & 0 deletions stubs/setuptools/distutils/command/check.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from setuptools._distutils.command.check import *
1 change: 1 addition & 0 deletions stubs/setuptools/distutils/command/clean.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from setuptools._distutils.command.clean import *
1 change: 1 addition & 0 deletions stubs/setuptools/distutils/command/config.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from setuptools._distutils.command.config import *
1 change: 1 addition & 0 deletions stubs/setuptools/distutils/command/install_egg_info.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from setuptools._distutils.command.install_egg_info import *
1 change: 1 addition & 0 deletions stubs/setuptools/distutils/command/install_headers.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from setuptools._distutils.command.install_headers import *
1 change: 1 addition & 0 deletions stubs/setuptools/distutils/core.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from setuptools._distutils.core import *
1 change: 1 addition & 0 deletions stubs/setuptools/distutils/debug.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from setuptools._distutils.debug import *
1 change: 1 addition & 0 deletions stubs/setuptools/distutils/dir_util.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from setuptools._distutils.dir_util import *
1 change: 1 addition & 0 deletions stubs/setuptools/distutils/fancy_getopt.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from setuptools._distutils.fancy_getopt import *
1 change: 1 addition & 0 deletions stubs/setuptools/distutils/file_util.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from setuptools._distutils.file_util import *
1 change: 1 addition & 0 deletions stubs/setuptools/distutils/log.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from setuptools._distutils.log import *
1 change: 1 addition & 0 deletions stubs/setuptools/distutils/text_file.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from setuptools._distutils.text_file import *
1 change: 1 addition & 0 deletions stubs/setuptools/distutils/versionpredicate.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from setuptools._distutils.versionpredicate import *
7 changes: 4 additions & 3 deletions stubs/setuptools/setuptools/__init__.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,10 @@ from collections.abc import ItemsView, Iterable, Mapping, Sequence
from typing import Any, Literal, Protocol, TypedDict, TypeVar, overload, type_check_only
from typing_extensions import Never, NotRequired

from ._distutils.cmd import Command as _Command
from ._distutils.dist import Distribution as _Distribution
from ._distutils.extension import Extension as _Extension
from setuptools._distutils.cmd import Command as _Command
from setuptools._distutils.dist import Distribution as _Distribution
from setuptools._distutils.extension import Extension as _Extension

from .command.alias import alias
from .command.bdist_egg import bdist_egg
from .command.bdist_rpm import bdist_rpm
Expand Down
3 changes: 0 additions & 3 deletions stubs/setuptools/setuptools/_distutils/__init__.pyi

This file was deleted.

17 changes: 0 additions & 17 deletions stubs/setuptools/setuptools/_distutils/_modified.pyi

This file was deleted.

5 changes: 0 additions & 5 deletions stubs/setuptools/setuptools/_distutils/_msvccompiler.pyi

This file was deleted.

33 changes: 0 additions & 33 deletions stubs/setuptools/setuptools/_distutils/archive_util.pyi

This file was deleted.

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

This file was deleted.

127 changes: 0 additions & 127 deletions stubs/setuptools/setuptools/_distutils/cmd.pyi

This file was deleted.

Loading
Loading