Skip to content
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
23 changes: 4 additions & 19 deletions stubs/peewee/@tests/stubtest_allowlist.txt
Original file line number Diff line number Diff line change
@@ -1,25 +1,10 @@
peewee.DQ.__invert__
peewee.DateField.day
peewee.DateField.month
peewee.DateField.year
peewee.DateTimeField.day
peewee.DateTimeField.hour
peewee.DateTimeField.minute
peewee.DateTimeField.month
peewee.DateTimeField.second
peewee.DateTimeField.year
# Stubtest doesn't recognize __ as indicating positional-only arg at runtime
# https://github.com/python/mypy/issues/15302
peewee.Model.insert
peewee.Model.replace
peewee.Model.update
peewee.TimeField.hour
peewee.TimeField.minute
peewee.TimeField.second
peewee.TimestampField.day
peewee.TimestampField.hour
peewee.TimestampField.minute
peewee.TimestampField.month
peewee.TimestampField.second
peewee.TimestampField.year
# Wrapped with @Node.copy which changes the signature to "def (self, *args, **kwargs)"
peewee.DQ.__invert__
peewee.Window.as_groups
peewee.Window.as_range
peewee.Window.as_rows
2 changes: 1 addition & 1 deletion stubs/peewee/METADATA.toml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
version = "3.17.0"
version = "3.17.3"
upstream_repository = "https://github.com/coleifer/peewee"
75 changes: 53 additions & 22 deletions stubs/peewee/peewee.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ import itertools
import logging
import threading
from _typeshed import Incomplete, SupportsKeysAndGetItem
from collections.abc import Callable, Generator, Iterable
from collections.abc import Callable, Generator, Iterable, Iterator
from types import TracebackType
from typing import Any, ClassVar, NamedTuple, TypeVar
from typing import Any, ClassVar, Literal, NamedTuple, TypeVar
from typing_extensions import Self

class NullHandler(logging.Handler):
Expand Down Expand Up @@ -128,19 +128,23 @@ class _DynamicColumn:
class _ExplicitColumn:
def __get__(self, instance, instance_type: Incomplete | None = ...): ...

class Star(Node):
def __init__(self, source) -> None: ...
def __sql__(self, ctx): ...

class Source(Node):
c: Incomplete
def __init__(self, alias: Incomplete | None = ...) -> None: ...
def alias(self, name) -> None: ...
def select(self, *columns): ...
@property
def __star__(self) -> Star: ...
def join(self, dest, join_type=..., on: Incomplete | None = ...): ...
def left_outer_join(self, dest, on: Incomplete | None = ...): ...
def cte(self, name, recursive: bool = ..., columns: Incomplete | None = ..., materialized: Incomplete | None = ...): ...
def get_sort_key(self, ctx): ...
def apply_alias(self, ctx): ...
def apply_column(self, ctx): ...
@property
def star(self) -> NodeList: ...

class _HashableSource:
def __init__(self, *args, **kwargs) -> None: ...
Expand Down Expand Up @@ -1230,10 +1234,19 @@ class BigBitFieldData:
instance: Incomplete
name: Incomplete
def __init__(self, instance, name) -> None: ...
def clear(self) -> None: ...
def set_bit(self, idx) -> None: ...
def clear_bit(self, idx) -> None: ...
def toggle_bit(self, idx): ...
def is_set(self, idx): ...
__getitem__ = is_set
def __setitem__(self, item: int, value: bool) -> None: ...
__delitem__ = clear_bit
def __len__(self) -> int: ...
def __and__(self, other: BigBitFieldData | bytes | bytearray | memoryview) -> bytearray: ...
def __or__(self, other: BigBitFieldData | bytes | bytearray | memoryview) -> bytearray: ...
def __xor__(self, other: BigBitFieldData | bytes | bytearray | memoryview) -> bytearray: ...
def __iter__(self) -> Iterator[Literal[0, 1]]: ...
def __bytes__(self) -> bytes: ...

class BigBitFieldAccessor(FieldAccessor):
Expand Down Expand Up @@ -1265,30 +1278,42 @@ class DateTimeField(_BaseFormattedField):
def adapt(self, value): ...
def to_timestamp(self): ...
def truncate(self, part): ...
year: Incomplete
month: Incomplete
day: Incomplete
hour: Incomplete
minute: Incomplete
second: Incomplete
@property
def year(self): ...
@property
def month(self): ...
@property
def day(self): ...
@property
def hour(self): ...
@property
def minute(self): ...
@property
def second(self): ...

class DateField(_BaseFormattedField):
field_type: str
formats: Incomplete
def adapt(self, value): ...
def to_timestamp(self): ...
def truncate(self, part): ...
year: Incomplete
month: Incomplete
day: Incomplete
@property
def year(self): ...
@property
def month(self): ...
@property
def day(self): ...

class TimeField(_BaseFormattedField):
field_type: str
formats: Incomplete
def adapt(self, value): ...
hour: Incomplete
minute: Incomplete
second: Incomplete
@property
def hour(self): ...
@property
def minute(self): ...
@property
def second(self): ...

class TimestampField(BigIntegerField):
valid_resolutions: Incomplete
Expand All @@ -1302,12 +1327,18 @@ class TimestampField(BigIntegerField):
def db_value(self, value): ...
def python_value(self, value): ...
def from_timestamp(self): ...
year: Incomplete
month: Incomplete
day: Incomplete
hour: Incomplete
minute: Incomplete
second: Incomplete
@property
def year(self): ...
@property
def month(self): ...
@property
def day(self): ...
@property
def hour(self): ...
@property
def minute(self): ...
@property
def second(self): ...

class IPField(BigIntegerField):
def db_value(self, val): ...
Expand Down