Skip to content

Commit 1fecd9b

Browse files
committed
Upgrade mypy and django-stubs to the latest version
1 parent 7aa6923 commit 1fecd9b

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

psqlextra/introspect/models.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
Optional,
88
Type,
99
TypeVar,
10+
Union,
1011
cast,
1112
)
1213

@@ -115,9 +116,10 @@ def models_from_cursor(
115116
)
116117

117118
for index, related_field_name in enumerate(related_fields):
118-
related_model = model._meta.get_field(
119-
related_field_name
120-
).related_model
119+
related_model = cast(
120+
Union[Type[Model], None],
121+
model._meta.get_field(related_field_name).related_model,
122+
)
121123
if not related_model:
122124
continue
123125

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ def run(self):
9797
"docformatter==1.4",
9898
"mypy==1.2.0; python_version > '3.6'",
9999
"mypy==0.971; python_version <= '3.6'",
100-
"django-stubs==1.16.0; python_version > '3.6'",
100+
"django-stubs==4.2.7; python_version > '3.6'",
101101
"django-stubs==1.9.0; python_version <= '3.6'",
102102
"typing-extensions==4.5.0; python_version > '3.6'",
103103
"typing-extensions==4.1.0; python_version <= '3.6'",

0 commit comments

Comments
 (0)