Skip to content

Commit

Permalink
Merge branch 'main' into py-3.12-third-party
Browse files Browse the repository at this point in the history
  • Loading branch information
srittau authored Oct 21, 2024
2 parents 794cef7 + 0d7c6da commit a9c62fb
Show file tree
Hide file tree
Showing 9 changed files with 122 additions and 7 deletions.
1 change: 1 addition & 0 deletions pyrightconfig.stricter.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@
"stubs/netaddr/netaddr/core.pyi",
"stubs/netaddr/netaddr/ip/__init__.pyi",
"stubs/netaddr/netaddr/ip/iana.pyi",
"stubs/netifaces",
"stubs/networkx",
"stubs/oauthlib",
"stubs/openpyxl",
Expand Down
11 changes: 6 additions & 5 deletions stdlib/builtins.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -952,6 +952,7 @@ class slice:
def __hash__(self) -> int: ...
else:
__hash__: ClassVar[None] # type: ignore[assignment]

def indices(self, len: SupportsIndex, /) -> tuple[int, int, int]: ...

class tuple(Sequence[_T_co]):
Expand Down Expand Up @@ -1215,7 +1216,7 @@ class frozenset(AbstractSet[_T_co]):
if sys.version_info >= (3, 9):
def __class_getitem__(cls, item: Any, /) -> GenericAlias: ...

class enumerate(Iterator[tuple[int, _T]]):
class enumerate(Generic[_T]):
def __new__(cls, iterable: Iterable[_T], start: int = 0) -> Self: ...
def __iter__(self) -> Self: ...
def __next__(self) -> tuple[int, _T]: ...
Expand Down Expand Up @@ -1409,7 +1410,7 @@ else:

def exit(code: sys._ExitCode = None) -> NoReturn: ...

class filter(Iterator[_T]):
class filter(Generic[_T]):
@overload
def __new__(cls, function: None, iterable: Iterable[_T | None], /) -> Self: ...
@overload
Expand Down Expand Up @@ -1470,7 +1471,7 @@ def len(obj: Sized, /) -> int: ...
def license() -> None: ...
def locals() -> dict[str, Any]: ...

class map(Iterator[_S]):
class map(Generic[_S]):
@overload
def __new__(cls, func: Callable[[_T1], _S], iter1: Iterable[_T1], /) -> Self: ...
@overload
Expand Down Expand Up @@ -1712,7 +1713,7 @@ def pow(base: _SupportsSomeKindOfPow, exp: float, mod: None = None) -> Any: ...
def pow(base: _SupportsSomeKindOfPow, exp: complex, mod: None = None) -> complex: ...
def quit(code: sys._ExitCode = None) -> NoReturn: ...

class reversed(Iterator[_T]):
class reversed(Generic[_T]):
@overload
def __new__(cls, sequence: Reversible[_T], /) -> Iterator[_T]: ... # type: ignore[misc]
@overload
Expand Down Expand Up @@ -1773,7 +1774,7 @@ def vars(object: type, /) -> types.MappingProxyType[str, Any]: ...
@overload
def vars(object: Any = ..., /) -> dict[str, Any]: ...

class zip(Iterator[_T_co]):
class zip(Generic[_T_co]):
if sys.version_info >= (3, 10):
@overload
def __new__(cls, *, strict: bool = ...) -> zip[Any]: ...
Expand Down
3 changes: 2 additions & 1 deletion stdlib/warnings.pyi
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import sys
import re
from _warnings import warn as warn, warn_explicit as warn_explicit
from collections.abc import Sequence
from types import ModuleType, TracebackType
Expand All @@ -25,7 +26,7 @@ if sys.version_info >= (3, 14):
_ActionKind: TypeAlias = Literal["default", "error", "ignore", "always", "module", "once"]
else:
_ActionKind: TypeAlias = Literal["default", "error", "ignore", "always", "all", "module", "once"]
filters: Sequence[tuple[str, str | None, type[Warning], str | None, int]] # undocumented, do not mutate
filters: Sequence[tuple[str, re.Pattern[str] | None, type[Warning], re.Pattern[str] | None, int]] # undocumented, do not mutate

def showwarning(
message: Warning | str,
Expand Down
2 changes: 1 addition & 1 deletion stubs/WTForms/METADATA.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
version = "3.2.*"
version = "~= 3.2.1"
upstream_repository = "https://github.com/pallets-eco/wtforms"
requires = ["MarkupSafe"]
2 changes: 2 additions & 0 deletions stubs/WTForms/wtforms/__init__.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ from wtforms import validators as validators, widgets as widgets
from wtforms.fields.choices import (
RadioField as RadioField,
SelectField as SelectField,
SelectFieldBase as SelectFieldBase,
SelectMultipleField as SelectMultipleField,
)
from wtforms.fields.core import Field as Field, Flags as Flags, Label as Label
Expand Down Expand Up @@ -49,6 +50,7 @@ __all__ = [
"Form",
"ValidationError",
"SelectField",
"SelectFieldBase",
"SelectMultipleField",
"RadioField",
"Field",
Expand Down
2 changes: 2 additions & 0 deletions stubs/WTForms/wtforms/fields/__init__.pyi
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from wtforms.fields.choices import (
RadioField as RadioField,
SelectField as SelectField,
SelectFieldBase as SelectFieldBase,
SelectMultipleField as SelectMultipleField,
)
from wtforms.fields.core import Field as Field, Flags as Flags, Label as Label
Expand Down Expand Up @@ -43,6 +44,7 @@ __all__ = [
"Flags",
"Label",
"SelectField",
"SelectFieldBase",
"SelectMultipleField",
"RadioField",
"DateTimeField",
Expand Down
34 changes: 34 additions & 0 deletions stubs/netifaces/@tests/stubtest_allowlist.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# Values that may not always exist at runtime, as they are system-specific.
netifaces.AF_12844
netifaces.AF_ATM
netifaces.AF_BAN
netifaces.AF_CCITT
netifaces.AF_CHAOS
netifaces.AF_CLUSTER
netifaces.AF_CNT
netifaces.AF_COIP
netifaces.AF_DATAKIT
netifaces.AF_DLI
netifaces.AF_ECMA
netifaces.AF_FIREFOX
netifaces.AF_HYLINK
netifaces.AF_IMPLINK
netifaces.AF_ISO
netifaces.AF_LAT
netifaces.AF_NATM
netifaces.AF_NDRV
netifaces.AF_NETBIOS
netifaces.AF_NETDES
netifaces.AF_NETGRAPH
netifaces.AF_NS
netifaces.AF_PPP
netifaces.AF_PUP
netifaces.AF_SIP
netifaces.AF_SYSTEM
netifaces.AF_UNKNOWN1
netifaces.AF_VOICEVIEW
netifaces.IN6_IFF_AUTOCONF
netifaces.IN6_IFF_DYNAMIC
netifaces.IN6_IFF_OPTIMISTIC
netifaces.IN6_IFF_SECURED
netifaces.IN6_IFF_TEMPORARY
2 changes: 2 additions & 0 deletions stubs/netifaces/METADATA.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
version = "0.11.*"
upstream_repository = "https://github.com/al45tair/netifaces"
72 changes: 72 additions & 0 deletions stubs/netifaces/netifaces.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
from typing import Literal, Final

AF_12844: Final[int]
AF_APPLETALK: Final[int]
AF_ASH: Final[int]
AF_ATM: Final[int]
AF_ATMPVC: Final[int]
AF_ATMSVC: Final[int]
AF_AX25: Final[int]
AF_BAN: Final[int]
AF_BLUETOOTH: Final[int]
AF_BRIDGE: Final[int]
AF_DATAKIT: Final[int]
AF_DECnet: Final[int]
AF_CCITT: Final[int]
AF_CHAOS: Final[int]
AF_CLUSTER: Final[int]
AF_CNT: Final[int]
AF_COIP: Final[int]
AF_DLI: Final[int]
AF_ECONET: Final[int]
AF_ECMA: Final[int]
AF_FILE: Final[int]
AF_FIREFOX: Final[int]
AF_HYLINK: Final[int]
AF_IMPLINK: Final[int]
AF_INET: Final[int]
AF_INET6: Final[int]
AF_IPX: Final[int]
AF_IRDA: Final[int]
AF_ISDN: Final[int]
AF_ISO: Final[int]
AF_KEY: Final[int]
AF_LAT: Final[int]
AF_LINK: Final[int]
AF_NATM: Final[int]
AF_NETBEUI: Final[int]
AF_NETBIOS: Final[int]
AF_NETDES: Final[int]
AF_NETGRAPH: Final[int]
AF_NETLINK: Final[int]
AF_NETROM: Final[int]
AF_NDRV: Final[int]
AF_NS: Final[int]
AF_PACKET: Final[int]
AF_PPP: Final[int]
AF_PPPOX: Final[int]
AF_PUP: Final[int]
AF_ROSE: Final[int]
AF_ROUTE: Final[int]
AF_SECURITY: Final[int]
AF_SIP: Final[int]
AF_SNA: Final[int]
AF_SYSTEM: Final[int]
AF_UNIX: Final[int]
AF_UNKNOWN1: Final[int]
AF_UNSPEC: Final[int]
AF_VOICEVIEW: Final[int]
AF_WANPIPE: Final[int]
AF_X25: Final[int]
IN6_IFF_AUTOCONF: Final[int]
IN6_IFF_TEMPORARY: Final[int]
IN6_IFF_DYNAMIC: Final[int]
IN6_IFF_OPTIMISTIC: Final[int]
IN6_IFF_SECURED: Final[int]

address_families: Final[dict[int, str]]
version: Final[str]

def gateways() -> dict[int | Literal["default"], list[tuple[str, str, bool] | tuple[str, str]] | dict[int, tuple[str, str]]]: ...
def ifaddresses(ifname: str, /) -> dict[int, list[dict[str, str]]]: ...
def interfaces() -> list[str]: ...

0 comments on commit a9c62fb

Please sign in to comment.