Skip to content

Commit bae6ee8

Browse files
authored
address mypy strict findings (#5383)
2 parents 5a48a0f + 81b3c85 commit bae6ee8

28 files changed

+390
-284
lines changed

.pre-commit-config.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ ci:
22
autoupdate_schedule: monthly
33
repos:
44
- repo: https://github.com/astral-sh/ruff-pre-commit
5-
rev: v0.1.5
5+
rev: v0.1.13
66
hooks:
77
- id: ruff
88
- id: ruff-format

CHANGES.rst

+1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ Unreleased
88
- Session data is untagged without relying on the built-in ``json.loads``
99
``object_hook``. This allows other JSON providers that don't implement that.
1010
:issue:`5381`
11+
- Address more type findings when using mypy strict mode. :pr:`5383`
1112

1213

1314
Version 3.0.0

pyproject.toml

+1-15
Original file line numberDiff line numberDiff line change
@@ -82,21 +82,7 @@ python_version = "3.8"
8282
files = ["src/flask", "tests/typing"]
8383
show_error_codes = true
8484
pretty = true
85-
#strict = true
86-
allow_redefinition = true
87-
disallow_subclassing_any = true
88-
#disallow_untyped_calls = true
89-
#disallow_untyped_defs = true
90-
#disallow_incomplete_defs = true
91-
no_implicit_optional = true
92-
local_partial_types = true
93-
#no_implicit_reexport = true
94-
strict_equality = true
95-
warn_redundant_casts = true
96-
warn_unused_configs = true
97-
warn_unused_ignores = true
98-
#warn_return_any = true
99-
#warn_unreachable = true
85+
strict = true
10086

10187
[[tool.mypy.overrides]]
10288
module = [

requirements/dev.txt

+29-30
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,19 @@
44
#
55
# pip-compile dev.in
66
#
7-
alabaster==0.7.13
7+
alabaster==0.7.16
88
# via sphinx
99
asgiref==3.7.2
10-
# via -r tests.in
11-
babel==2.13.1
10+
# via
11+
# -r tests.in
12+
# -r typing.in
13+
babel==2.14.0
1214
# via sphinx
1315
build==1.0.3
1416
# via pip-tools
1517
cachetools==5.3.2
1618
# via tox
17-
certifi==2023.7.22
19+
certifi==2023.11.17
1820
# via requests
1921
cffi==1.16.0
2022
# via cryptography
@@ -28,9 +30,9 @@ click==8.1.7
2830
# via pip-tools
2931
colorama==0.4.6
3032
# via tox
31-
cryptography==41.0.5
33+
cryptography==41.0.7
3234
# via -r typing.in
33-
distlib==0.3.7
35+
distlib==0.3.8
3436
# via virtualenv
3537
docutils==0.18.1
3638
# via
@@ -40,19 +42,19 @@ filelock==3.13.1
4042
# via
4143
# tox
4244
# virtualenv
43-
identify==2.5.31
45+
identify==2.5.33
4446
# via pre-commit
45-
idna==3.4
47+
idna==3.6
4648
# via requests
4749
imagesize==1.4.1
4850
# via sphinx
4951
iniconfig==2.0.0
5052
# via pytest
51-
jinja2==3.1.2
53+
jinja2==3.1.3
5254
# via sphinx
5355
markupsafe==2.1.3
5456
# via jinja2
55-
mypy==1.6.1
57+
mypy==1.8.0
5658
# via -r typing.in
5759
mypy-extensions==1.0.0
5860
# via mypy
@@ -70,30 +72,32 @@ pallets-sphinx-themes==2.1.1
7072
# via -r docs.in
7173
pip-tools==7.3.0
7274
# via -r dev.in
73-
platformdirs==3.11.0
75+
platformdirs==4.1.0
7476
# via
7577
# tox
7678
# virtualenv
7779
pluggy==1.3.0
7880
# via
7981
# pytest
8082
# tox
81-
pre-commit==3.5.0
83+
pre-commit==3.6.0
8284
# via -r dev.in
8385
pycparser==2.21
8486
# via cffi
85-
pygments==2.16.1
87+
pygments==2.17.2
8688
# via
8789
# sphinx
8890
# sphinx-tabs
8991
pyproject-api==1.6.1
9092
# via tox
9193
pyproject-hooks==1.0.0
9294
# via build
93-
pytest==7.4.3
95+
pytest==7.4.4
9496
# via -r tests.in
9597
python-dotenv==1.0.0
96-
# via -r tests.in
98+
# via
99+
# -r tests.in
100+
# -r typing.in
97101
pyyaml==6.0.1
98102
# via pre-commit
99103
requests==2.31.0
@@ -106,45 +110,40 @@ sphinx==7.2.6
106110
# pallets-sphinx-themes
107111
# sphinx-issues
108112
# sphinx-tabs
109-
# sphinxcontrib-applehelp
110-
# sphinxcontrib-devhelp
111-
# sphinxcontrib-htmlhelp
112113
# sphinxcontrib-log-cabinet
113-
# sphinxcontrib-qthelp
114-
# sphinxcontrib-serializinghtml
115114
sphinx-issues==3.0.1
116115
# via -r docs.in
117116
sphinx-tabs==3.4.4
118117
# via -r docs.in
119-
sphinxcontrib-applehelp==1.0.7
118+
sphinxcontrib-applehelp==1.0.8
120119
# via sphinx
121-
sphinxcontrib-devhelp==1.0.5
120+
sphinxcontrib-devhelp==1.0.6
122121
# via sphinx
123-
sphinxcontrib-htmlhelp==2.0.4
122+
sphinxcontrib-htmlhelp==2.0.5
124123
# via sphinx
125124
sphinxcontrib-jsmath==1.0.1
126125
# via sphinx
127126
sphinxcontrib-log-cabinet==1.0.1
128127
# via -r docs.in
129-
sphinxcontrib-qthelp==1.0.6
128+
sphinxcontrib-qthelp==1.0.7
130129
# via sphinx
131-
sphinxcontrib-serializinghtml==1.1.9
130+
sphinxcontrib-serializinghtml==1.1.10
132131
# via sphinx
133-
tox==4.11.3
132+
tox==4.12.0
134133
# via -r dev.in
135134
types-contextvars==2.4.7.3
136135
# via -r typing.in
137136
types-dataclasses==0.6.6
138137
# via -r typing.in
139-
typing-extensions==4.8.0
138+
typing-extensions==4.9.0
140139
# via mypy
141-
urllib3==2.0.7
140+
urllib3==2.1.0
142141
# via requests
143-
virtualenv==20.24.6
142+
virtualenv==20.25.0
144143
# via
145144
# pre-commit
146145
# tox
147-
wheel==0.41.3
146+
wheel==0.42.0
148147
# via pip-tools
149148

150149
# The following packages are considered to be unsafe in a requirements file:

requirements/docs.txt

+12-17
Original file line numberDiff line numberDiff line change
@@ -4,23 +4,23 @@
44
#
55
# pip-compile docs.in
66
#
7-
alabaster==0.7.13
7+
alabaster==0.7.16
88
# via sphinx
9-
babel==2.13.1
9+
babel==2.14.0
1010
# via sphinx
11-
certifi==2023.7.22
11+
certifi==2023.11.17
1212
# via requests
1313
charset-normalizer==3.3.2
1414
# via requests
1515
docutils==0.18.1
1616
# via
1717
# sphinx
1818
# sphinx-tabs
19-
idna==3.4
19+
idna==3.6
2020
# via requests
2121
imagesize==1.4.1
2222
# via sphinx
23-
jinja2==3.1.2
23+
jinja2==3.1.3
2424
# via sphinx
2525
markupsafe==2.1.3
2626
# via jinja2
@@ -30,7 +30,7 @@ packaging==23.2
3030
# sphinx
3131
pallets-sphinx-themes==2.1.1
3232
# via -r docs.in
33-
pygments==2.16.1
33+
pygments==2.17.2
3434
# via
3535
# sphinx
3636
# sphinx-tabs
@@ -44,29 +44,24 @@ sphinx==7.2.6
4444
# pallets-sphinx-themes
4545
# sphinx-issues
4646
# sphinx-tabs
47-
# sphinxcontrib-applehelp
48-
# sphinxcontrib-devhelp
49-
# sphinxcontrib-htmlhelp
5047
# sphinxcontrib-log-cabinet
51-
# sphinxcontrib-qthelp
52-
# sphinxcontrib-serializinghtml
5348
sphinx-issues==3.0.1
5449
# via -r docs.in
5550
sphinx-tabs==3.4.4
5651
# via -r docs.in
57-
sphinxcontrib-applehelp==1.0.7
52+
sphinxcontrib-applehelp==1.0.8
5853
# via sphinx
59-
sphinxcontrib-devhelp==1.0.5
54+
sphinxcontrib-devhelp==1.0.6
6055
# via sphinx
61-
sphinxcontrib-htmlhelp==2.0.4
56+
sphinxcontrib-htmlhelp==2.0.5
6257
# via sphinx
6358
sphinxcontrib-jsmath==1.0.1
6459
# via sphinx
6560
sphinxcontrib-log-cabinet==1.0.1
6661
# via -r docs.in
67-
sphinxcontrib-qthelp==1.0.6
62+
sphinxcontrib-qthelp==1.0.7
6863
# via sphinx
69-
sphinxcontrib-serializinghtml==1.1.9
64+
sphinxcontrib-serializinghtml==1.1.10
7065
# via sphinx
71-
urllib3==2.0.7
66+
urllib3==2.1.0
7267
# via requests

requirements/tests.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ packaging==23.2
1212
# via pytest
1313
pluggy==1.3.0
1414
# via pytest
15-
pytest==7.4.3
15+
pytest==7.4.4
1616
# via -r tests.in
1717
python-dotenv==1.0.0
1818
# via -r tests.in

requirements/typing.in

+2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
mypy
22
types-contextvars
33
types-dataclasses
4+
asgiref
45
cryptography
6+
python-dotenv

requirements/typing.txt

+7-3
Original file line numberDiff line numberDiff line change
@@ -4,19 +4,23 @@
44
#
55
# pip-compile typing.in
66
#
7+
asgiref==3.7.2
8+
# via -r typing.in
79
cffi==1.16.0
810
# via cryptography
9-
cryptography==41.0.5
11+
cryptography==41.0.7
1012
# via -r typing.in
11-
mypy==1.6.1
13+
mypy==1.8.0
1214
# via -r typing.in
1315
mypy-extensions==1.0.0
1416
# via mypy
1517
pycparser==2.21
1618
# via cffi
19+
python-dotenv==1.0.0
20+
# via -r typing.in
1721
types-contextvars==2.4.7.3
1822
# via -r typing.in
1923
types-dataclasses==0.6.6
2024
# via -r typing.in
21-
typing-extensions==4.8.0
25+
typing-extensions==4.9.0
2226
# via mypy

0 commit comments

Comments
 (0)