8000 Update setuptools to v69 by Avasam · Pull Request #11066 · python/typeshed · GitHub
[go: up one dir, main page]

Skip to content

Update setuptools to v69 #11066

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

Closed
wants to merge 5 commits into from
Closed
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
4 changes: 4 additions & 0 deletions stubs/setuptools/@tests/stubtest_allowlist.txt
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,10 @@ setuptools._distutils.dist.Distribution.get_requires
setuptools._distutils.dist.Distribution.get_provides
setuptools._distutils.dist.Distribution.get_obsoletes

# Is a functools.partial, so stubtest says "is not a function"
setuptools.dep_util.newer_pairwise_group
setuptools.modified.newer_pairwise_group

# Private modules
setuptools.config._validate_pyproject.*
setuptools.command.build_py.build_py.existing_egg_info_dir
Expand Down
4 changes: 2 additions & 2 deletions stubs/setuptools/METADATA.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
version = "68.2.*"
version = "69.0.*"
upstream_repository = "https://github.com/pypa/setuptools"
partial_stub = true
requires = ["packaging"]

[tool.stubtest]
# darwin is equivalent to linux for OS-specific methods
Expand Down
2 changes: 1 addition & 1 deletion stubs/setuptools/pkg_resources/__init__.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ from re import Pattern
from typing import IO, Any, ClassVar, Protocol, TypeVar, overload, type_check_only
from typing_extensions import Literal, Self, TypeAlias

from ._vendor.packaging import requirements as packaging_requirements, version as packaging_version
from packaging import requirements as packaging_requirements, version as packaging_version

_T = TypeVar("_T")
_D = TypeVar("_D", bound=Distribution)
Expand Down
8 changes: 0 additions & 8 deletions stubs/setuptools/pkg_resources/_vendor/packaging/__init__.pyi

This file was deleted.

13 changes: 0 additions & 13 deletions stubs/setuptools/pkg_resources/_vendor/packaging/markers.pyi

This file was deleted.

14 changes: 0 additions & 14 deletions stubs/setuptools/pkg_resources/_vendor/packaging/requirements.pyi

This file was deleted.

66 changes: 0 additions & 66 deletions stubs/setuptools/pkg_resources/_vendor/packaging/specifiers.pyi

This file was deleted.

49 changes: 0 additions & 49 deletions stubs/setuptools/pkg_resources/_vendor/packaging/version.pyi

This file was deleted.

6 changes: 6 additions & 0 deletions stubs/setuptools/setuptools/_distutils/_modified.pyi
D7AE
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
from typing_extensions import Literal

def newer(source, target): ...
def newer_pairwise(sources, targets, newer=...): ...
def newer_group(sources, target, missing: Literal["error", "newer", "ignore"] = "error"): ...
def newer_pairwise_group(sources, targets, *, newer=...): ...
2 changes: 1 addition & 1 deletion stubs/setuptools/setuptools/dep_util.pyi
Original file line number Diff line number Diff line change
@@ -1 +1 @@
def newer_pairwise_group(sources_groups, targets): ...
from ._distutils._modified import newer_group as newer_group, newer_pairwise_group as newer_pairwise_group
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This entire module (stubs/setuptools/setuptools/dep_util.pyi) is deprecated in favor of setuptools.modified
I could keep the defs instead of importing from _distutils so I can mark with @deprecated

2 changes: 2 additions & 0 deletions stubs/setuptools/setuptools/errors.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,7 @@ TemplateError = _distutils_errors.DistutilsTemplateError
UnknownFileError = _distutils_errors.UnknownFileError
BaseError = _distutils_errors.DistutilsError

class InvalidConfigError(OptionError): ...
class RemovedConfigError(OptionError): ...
class RemovedCommandError(BaseError, RuntimeError): ...
class PackageDiscoveryError(BaseError, RuntimeError): ...
8 changes: 8 additions & 0 deletions stubs/setuptools/setuptools/modified.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
from ._distutils._modified import (
newer as newer,
newer_group as newer_group,
newer_pairwise as newer_pairwise,
newer_pairwise_group as newer_pairwise_group,
)
Comment on lines +1 to +6
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I could define the methods here instead of in setuptools/_distutils/_modified to avoid a adding a private module

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Better to define them where they're defined at runtime imo, as you currently have it


__all__ = ["newer", "newer_pairwise", "newer_group", "newer_pairwise_group"]
0