Skip to content

Commit

Permalink
Fix an issue when tox p fails because mypy is forbidden.
Browse files Browse the repository at this point in the history
  • Loading branch information
cainmagi committed Mar 26, 2024
1 parent ac14a38 commit 5012474
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
8 changes: 2 additions & 6 deletions src/flask_sqlalchemy/extension.py
Original file line number Diff line number Diff line change
Expand Up @@ -952,9 +952,7 @@ def _set_rel_query(self, kwargs: dict[str, t.Any]) -> None:

backref[1].setdefault("query_class", self.Query)

def relationship(
self, *args: t.Any, **kwargs: t.Any
) -> sa_orm.Relationship[t.Any]:
def relationship(self, *args: t.Any, **kwargs: t.Any) -> sa_orm.Relationship[t.Any]:
"""A :func:`sqlalchemy.orm.relationship` that applies this extension's
:attr:`Query` class for dynamic relationships and backrefs.
Expand All @@ -976,9 +974,7 @@ def dynamic_loader(
self._set_rel_query(kwargs)
return sa_orm.dynamic_loader(argument, **kwargs)

def _relation(
self, *args: t.Any, **kwargs: t.Any
) -> sa_orm.Relationship[t.Any]:
def _relation(self, *args: t.Any, **kwargs: t.Any) -> sa_orm.Relationship[t.Any]:
"""A :func:`sqlalchemy.orm.relationship` that applies this extension's
:attr:`Query` class for dynamic relationships and backrefs.
Expand Down
2 changes: 2 additions & 0 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,13 @@ deps =
commands = pytest -v --tb=short --basetemp={envtmpdir} {posargs}

[testenv:style]
allowlist_externals = mypy
deps = pre-commit
skip_install = true
commands = pre-commit run --all-files

[testenv:typing]
allowlist_externals = mypy
deps = -r requirements/mypy.txt
commands =
mypy --python-version 3.8
Expand Down

0 comments on commit 5012474

Please sign in to comment.