-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Vendor distutils stubs #4691
base: main
Are you sure you want to change the base?
Vendor distutils stubs #4691
Changes from all commits
dd3bb1e
035ff38
c78135a
6ddd1af
b5f8ed4
20bda1b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -133,6 +133,8 @@ type = [ | |
|
||
# local | ||
|
||
# Referenced in distutils-stubs | ||
"types-docutils", | ||
# pin mypy version so a new version doesn't suddenly cause the CI to fail, | ||
# until types-setuptools is removed from typeshed. | ||
# For help with static-typing issues, or mypy update, ping @Avasam | ||
|
@@ -203,6 +205,8 @@ include-package-data = true | |
include = [ | ||
"setuptools*", | ||
"pkg_resources*", | ||
# TODO: Include distutils stubs with package once we're confident in them | ||
# "typings/distutils-stubs", | ||
Comment on lines
+208
to
+209
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We don't need to ship anything as long as typeshed provides stubs for |
||
"_distutils_hack*", | ||
] | ||
exclude = [ | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
from collections.abc import Callable, Iterable | ||
from typing import Literal, TypeVar | ||
|
||
from _typeshed import StrOrBytesPath | ||
|
||
_SourcesT = TypeVar("_SourcesT", bound=StrOrBytesPath) | ||
_TargetsT = TypeVar("_TargetsT", bound=StrOrBytesPath) | ||
|
||
def newer(source: StrOrBytesPath, target: StrOrBytesPath) -> bool: ... | ||
def newer_pairwise( | ||
sources: Iterable[_SourcesT], | ||
targets: Iterable[_TargetsT], | ||
newer: Callable[[_SourcesT, _TargetsT], bool] = newer, | ||
) -> tuple[list[_SourcesT], list[_TargetsT]]: ... | ||
def newer_group( | ||
sources: Iterable[StrOrBytesPath], | ||
target: StrOrBytesPath, | ||
missing: Literal["error", "ignore", "newer"] = "error", | ||
) -> bool: ... | ||
def newer_pairwise_group( | ||
sources: Iterable[_SourcesT], | ||
targets: Iterable[_TargetsT], | ||
*, | ||
newer: Callable[[_SourcesT, _TargetsT], bool] = newer, | ||
) -> tuple[list[_SourcesT], list[_TargetsT]]: ... |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
from typing import Literal, overload | ||
|
||
from _typeshed import StrOrBytesPath, StrPath | ||
|
||
@overload | ||
def make_archive( | ||
base_name: str, | ||
format: str, | ||
root_dir: StrOrBytesPath | None = None, | ||
base_dir: str | None = None, | ||
verbose: bool = False, | ||
dry_run: bool = False, | ||
owner: str | None = None, | ||
group: str | None = None, | ||
) -> str: ... | ||
@overload | ||
def make_archive( | ||
base_name: StrPath, | ||
format: str, | ||
root_dir: StrOrBytesPath, | ||
base_dir: str | None = None, | ||
verbose: bool = False, | ||
dry_run: bool = False, | ||
owner: str | None = None, | ||
group: str | None = None, | ||
) -> str: ... | ||
def make_tarball( | ||
base_name: str, | ||
base_dir: StrPath, | ||
compress: Literal["gzip", "bzip2", "xz"] | None = "gzip", | ||
verbose: bool = False, | ||
dry_run: bool = False, | ||
owner: str | None = None, | ||
group: str | None = None, | ||
) -> str: ... | ||
def make_zipfile( | ||
base_name: str, base_dir: str, verbose: bool = False, dry_run: bool = False | ||
) -> str: ... |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
from .ccompiler import CCompiler | ||
|
||
class BCPPCompiler(CCompiler): ... |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I used pyright's default of
typings
so that I didn't have to configure it there. But that folder name can be arbitrary.