-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Add peewee playhouse.flask_utils
stubs
#11731
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
Merged
Merged
Changes from all commits
Commits
Show all changes
27 commits
Select commit
Hold shift + click to select a range
4498e93
Add peewee playhouse stubs
pylipp 7a63745
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] 5eb00c0
Add missing import
pylipp 7be7f77
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] e0a5f6b
fix some simple things
AlexWaygood 7a332c7
fix flake8
AlexWaygood 2e95cac
Declare partial_stub
pylipp 7904c11
Declare ignore_missing_stub
pylipp 46b081d
Use stubtest_allowlist instead of ignore_missing_stub=true
pylipp a4d3438
Add missing flask_utils.* names to stubtest_allowlist
pylipp 05b1057
Update stubs/peewee/METADATA.toml
pylipp 954ed97
Remove types of private FlaskDB methods
pylipp c51ad9a
Add comment
pylipp 39142ca
Update some FlaskDB method types
pylipp 2af5f3a
Add type for get_model_class
pylipp 1044bfe
Add Unused
pylipp 9b7a04b
Merge branch 'main' into master
Avasam 195cf9d
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] 5c841ba
Update stubs/peewee/playhouse/flask_utils.pyi
Avasam 8b3b6f6
Update stubs/peewee/playhouse/flask_utils.pyi
Avasam 500fcc4
Update stubs/peewee/playhouse/flask_utils.pyi
Avasam 0364730
Update stubs/peewee/playhouse/flask_utils.pyi
pylipp 3e3a635
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] 6195847
Use ModelBase instead of Model
pylipp 0f2bc77
Remove type of model_class parameter
pylipp b9c5cfc
Update stubs/peewee/playhouse/flask_utils.pyi
Avasam d5ad960
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,10 @@ | ||
version = "3.17.3" | ||
upstream_repository = "https://github.com/coleifer/peewee" | ||
# We're not providing stubs for all playhouse modules right now | ||
# https://github.com/python/typeshed/pull/11731#issuecomment-2065729058 | ||
partial_stub = true | ||
|
||
[tool.stubtest] | ||
stubtest_requirements = ["Flask>=2.0.0"] | ||
# Using stubtest_allowlist to ignore playhouse modules we don't provide. | ||
ignore_missing_stub = false |
Empty file.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
from _typeshed import Unused | ||
from collections.abc import Container | ||
Avasam marked this conversation as resolved.
Show resolved
Hide resolved
|
||
from typing import Any | ||
from typing_extensions import TypeAlias | ||
|
||
from peewee import Database, ModelBase, Proxy | ||
|
||
# Is actually flask.Flask | ||
_Flask: TypeAlias = Any | ||
|
||
class FlaskDB: | ||
# Omitting undocumented base_model_class on purpose, use FlaskDB.Model instead | ||
database: Database | Proxy | ||
def __init__( | ||
self, | ||
app: _Flask | None = None, | ||
database: Database | Proxy | None = None, | ||
# Is actually type[ModelClass] but stubtest likely confuses with Model property | ||
# https://github.com/python/typeshed/pull/11731#issuecomment-2067694259 | ||
model_class=..., | ||
excluded_routes: Container[str] | None = None, | ||
) -> None: ... | ||
def init_app(self, app: _Flask) -> None: ... | ||
def get_model_class(self) -> type[ModelBase]: ... | ||
@property | ||
def Model(self) -> type[ModelBase]: ... | ||
def connect_db(self) -> None: ... | ||
def close_db(self, exc: Unused) -> None: ... |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.