-
-
Notifications
You must be signed in to change notification settings - Fork 2k
Add stubs for flask-migrate #8967
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 4 commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
37e771a
Add stubs for flask-migrate
kasium 030359c
Update stubs
kasium 51c5e86
Apply suggestions from code review
kasium b324376
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] 23c8df1
Add missing imports
AlexWaygood f451ad7
Improve
kasium 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 |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| version = "4.0.*" | ||
| requires = ["types-Flask-SQLAlchemy", "types-SQLAlchemy"] |
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,105 @@ | ||
| from collections.abc import Callable | ||
| from logging import Logger | ||
| from typing import Any, TypeVar | ||
| from typing_extensions import ParamSpec, TypeAlias | ||
|
|
||
| from flask_sqlalchemy import SQLAlchemy | ||
|
|
||
| _T = TypeVar("_T") | ||
| _P = ParamSpec("_P") | ||
| _App: TypeAlias = Any # flask.Flask is not possible as a dependency yet | ||
|
|
||
| alembic_version: tuple[int, int, int] | ||
| log: Logger | ||
|
|
||
| class Config: # should inherit from alembic.config.Config which is not possible yet | ||
| template_directory: str | None | ||
| def __init__(self, *args, **kwargs) -> None: ... | ||
| def get_template_directory(self) -> str: ... | ||
|
|
||
| class Migrate: | ||
| configure_callbacks: list[Callable[[Config], None]] | ||
kasium marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| db: SQLAlchemy | None | ||
| directory: str | ||
| alembic_ctx_kwargs: dict[str, Any] | ||
| def __init__( | ||
| self, | ||
| app: _App | None = ..., | ||
| db: SQLAlchemy | None = ..., | ||
| directory: str = ..., | ||
| command: str = ..., | ||
| compare_type: bool = ..., | ||
| render_as_batch: bool = ..., | ||
| **kwargs, | ||
| ) -> None: ... | ||
| def init_app( | ||
| self, | ||
| app: _App, | ||
| db: SQLAlchemy | None = ..., | ||
| directory: str | None = ..., | ||
| command: str | None = ..., | ||
| compare_type: bool | None = ..., | ||
| render_as_batch: bool | None = ..., | ||
| **kwargs, | ||
| ) -> None: ... | ||
| def configure(self, f: Callable[[Config], None]) -> Callable[[Config], None]: ... | ||
| def call_configure_callbacks(self, config: Config): ... | ||
| def get_config( | ||
| self, directory: str | None = ..., x_arg: str | Sequence[str] | None = ..., opts: Iterable[str] | None = ... | ||
| ): ... | ||
|
|
||
| def catch_errors(f: Callable[_P, _T]) -> Callable[_P, _T]: ... | ||
| def list_templates() -> None: ... | ||
| def init(directory: str | None = ..., multidb: bool = ..., template: str | None = ..., package: bool = ...) -> None: ... | ||
| def revision( | ||
| directory: str | None = ..., | ||
| message: str | None = ..., | ||
| autogenerate: bool = ..., | ||
| sql: bool = ..., | ||
| head: str = ..., | ||
| splice: bool = ..., | ||
| branch_label: str | None = ..., | ||
| version_path: str | None = ..., | ||
| rev_id: str | None = ..., | ||
| ) -> None: ... | ||
| def migrate( | ||
| directory: str | None = ..., | ||
| message: str | None = ..., | ||
| sql: bool = ..., | ||
| head: str = ..., | ||
| splice: bool = ..., | ||
| branch_label: str | None = ..., | ||
| version_path: str | None = ..., | ||
| rev_id: str | None = ..., | ||
| x_arg: str | Sequence[str] | None = ..., | ||
| ) -> None: ... | ||
| def edit(directory: str | None = ..., revision: str = ...) -> None: ... | ||
| def merge( | ||
| directory: str | None = ..., | ||
| revisions: str = ..., | ||
| message: str | None = ..., | ||
| branch_label: str | None = ..., | ||
| rev_id: str | None = ..., | ||
| ) -> None: ... | ||
| def upgrade( | ||
| directory: str | None = ..., | ||
| revision: str = ..., | ||
| sql: bool = ..., | ||
| tag: str | None = ..., | ||
| x_arg: str | Sequence[str] | None = ..., | ||
| ) -> None: ... | ||
| def downgrade( | ||
| directory: str | None = ..., | ||
| revision: str = ..., | ||
| sql: bool = ..., | ||
| tag: str | None = ..., | ||
| x_arg: str | Sequence[str] | None = ..., | ||
| ) -> None: ... | ||
| def show(directory: str | None = ..., revision: str = ...) -> None: ... | ||
| def history( | ||
| directory: str | None = ..., rev_range: str | None = ..., verbose: bool = ..., indicate_current: bool = ... | ||
| ) -> None: ... | ||
| def heads(directory: str | None = ..., verbose: bool = ..., resolve_dependencies: bool = ...) -> None: ... | ||
| def branches(directory: str | None = ..., verbose: bool = ...) -> None: ... | ||
| def current(directory: str | None = ..., verbose: bool = ...) -> None: ... | ||
| def stamp(directory: str | None = ..., revision: str = ..., sql: bool = ..., tag: str | None = ...) -> 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.