File tree Expand file tree Collapse file tree 4 files changed +42
-0
lines changed Expand file tree Collapse file tree 4 files changed +42
-0
lines changed Original file line number Diff line number Diff line change @@ -8,3 +8,9 @@ peewee.DQ.__invert__
88peewee.Window.as_groups
99peewee.Window.as_range
1010peewee.Window.as_rows
11+
12+ # Ignore missing playhouse modules and names we don't currently provide
13+ playhouse\.\w+?
14+ playhouse.flask_utils.PaginatedQuery
15+ playhouse.flask_utils.get_\w+
16+ playhouse.flask_utils.object_list
Original file line number Diff line number Diff line change 11version = " 3.17.3"
22upstream_repository = " https://github.com/coleifer/peewee"
3+ # We're not providing stubs for all playhouse modules right now
4+ # https://github.com/python/typeshed/pull/11731#issuecomment-2065729058
5+ partial_stub = true
6+
7+ [tool .stubtest ]
8+ stubtest_requirements = [" Flask>=2.0.0" ]
9+ # Using stubtest_allowlist to ignore playhouse modules we don't provide.
10+ ignore_missing_stub = false
Original file line number Diff line number Diff line change 1+ from _typeshed import Unused
2+ from collections .abc import Container
3+ from typing import Any
4+ from typing_extensions import TypeAlias
5+
6+ from peewee import Database , ModelBase , Proxy
7+
8+ # Is actually flask.Flask
9+ _Flask : TypeAlias = Any
10+
11+ class FlaskDB :
12+ # Omitting undocumented base_model_class on purpose, use FlaskDB.Model instead
13+ database : Database | Proxy
14+ def __init__ (
15+ self ,
16+ app : _Flask | None = None ,
17+ database : Database | Proxy | None = None ,
18+ # Is actually type[ModelClass] but stubtest likely confuses with Model property
19+ # https://github.com/python/typeshed/pull/11731#issuecomment-2067694259
20+ model_class = ...,
21+ excluded_routes : Container [str ] | None = None ,
22+ ) -> None : ...
23+ def init_app (self , app : _Flask ) -> None : ...
24+ def get_model_class (self ) -> type [ModelBase ]: ...
25+ @property
26+ def Model (self ) -> type [ModelBase ]: ...
27+ def connect_db (self ) -> None : ...
28+ def close_db (self , exc : Unused ) -> None : ...
You can’t perform that action at this time.
0 commit comments