Skip to content

Commit 35d6f4a

Browse files
committed
update for mypy 2.4.0
Change-Id: I5ed4750fc69ae7ea90153329e0847372a31578d0
1 parent 6e52e0f commit 35d6f4a

5 files changed

Lines changed: 13 additions & 13 deletions

File tree

‎lib/sqlalchemy/ext/automap.py‎

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1661,11 +1661,11 @@ def _m2m_relationship(
16611661
overlaps=overlaps,
16621662
secondary=table,
16631663
primaryjoin=and_(
1664-
fk.column == fk.parent for fk in m2m_const[0].elements
1665-
), # type: ignore [arg-type]
1664+
*(fk.column == fk.parent for fk in m2m_const[0].elements)
1665+
),
16661666
secondaryjoin=and_(
1667-
fk.column == fk.parent for fk in m2m_const[1].elements
1668-
), # type: ignore [arg-type]
1667+
*(fk.column == fk.parent for fk in m2m_const[1].elements)
1668+
),
16691669
backref=backref_obj,
16701670
collection_class=collection_class,
16711671
)
@@ -1687,11 +1687,11 @@ def _m2m_relationship(
16871687
overlaps=overlaps,
16881688
secondary=table,
16891689
primaryjoin=and_(
1690-
fk.column == fk.parent for fk in m2m_const[1].elements
1691-
), # type: ignore [arg-type]
1690+
*(fk.column == fk.parent for fk in m2m_const[1].elements)
1691+
),
16921692
secondaryjoin=and_(
1693-
fk.column == fk.parent for fk in m2m_const[0].elements
1694-
), # type: ignore [arg-type]
1693+
*(fk.column == fk.parent for fk in m2m_const[0].elements)
1694+
),
16951695
back_populates=relationship_name,
16961696
collection_class=collection_class,
16971697
)

‎lib/sqlalchemy/sql/type_api.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1155,7 +1155,7 @@ def _default_dialect(self) -> Dialect:
11551155
# dmypy / mypy seems to sporadically keep thinking this line is
11561156
# returning Any, which seems to be caused by the @deprecated_params
11571157
# decorator on the DefaultDialect constructor
1158-
return default.StrCompileDialect() # type: ignore[no-any-return]
1158+
return default.StrCompileDialect()
11591159

11601160
def __str__(self) -> str:
11611161
return str(self.compile())

‎lib/sqlalchemy/util/langhelpers.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -463,7 +463,7 @@ def exec_code_in_env(
463463
)
464464
# atexit is a property on the C implementation; typeshed
465465
# renders finalize with an empty __slots__
466-
finalizer.atexit = False # type: ignore[misc]
466+
finalizer.atexit = False
467467

468468
return fn # type: ignore[no-any-return]
469469

‎pyproject.toml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ Discussions = "https://github.com/sqlalchemy/sqlalchemy/discussions"
4545
[project.optional-dependencies]
4646
asyncio = ["greenlet>=1"]
4747
mypy = [
48-
"mypy >= 2.3",
48+
"mypy >= 2.4",
4949
"types-greenlet >= 2",
5050
]
5151
mssql = ["pyodbc"]

‎tox.ini‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ commands=
202202
[testenv:pep484]
203203
deps=
204204
greenlet >= 1
205-
mypy >= 2.3
205+
mypy >= 2.4
206206
types-greenlet
207207
commands =
208208
mypy {env:MYPY_COLOR} ./lib/sqlalchemy
@@ -216,7 +216,7 @@ deps=
216216
pytest>=7.0.0rc1,<10
217217
pytest-xdist
218218
greenlet >= 1
219-
mypy >= 1.17
219+
mypy >= 2.4
220220
types-greenlet
221221
extras=
222222
{[greenletextras]extras}

0 commit comments

Comments
 (0)