diff --git a/src/flask_sqlalchemy/extension.py b/src/flask_sqlalchemy/extension.py index 1cc2af87..4645f159 100644 --- a/src/flask_sqlalchemy/extension.py +++ b/src/flask_sqlalchemy/extension.py @@ -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. @@ -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. diff --git a/tox.ini b/tox.ini index 7085991f..9a21a023 100644 --- a/tox.ini +++ b/tox.ini @@ -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