Skip to content

Commit

Permalink
address mypy strict findings (#5383)
Browse files Browse the repository at this point in the history
  • Loading branch information
davidism committed Jan 18, 2024
2 parents 5a48a0f + 81b3c85 commit bae6ee8
Show file tree
Hide file tree
Showing 28 changed files with 390 additions and 284 deletions.
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Expand Up @@ -2,7 +2,7 @@ ci:
autoupdate_schedule: monthly
repos:
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.1.5
rev: v0.1.13
hooks:
- id: ruff
- id: ruff-format
Expand Down
1 change: 1 addition & 0 deletions CHANGES.rst
Expand Up @@ -8,6 +8,7 @@ Unreleased
- Session data is untagged without relying on the built-in ``json.loads``
``object_hook``. This allows other JSON providers that don't implement that.
:issue:`5381`
- Address more type findings when using mypy strict mode. :pr:`5383`


Version 3.0.0
Expand Down
16 changes: 1 addition & 15 deletions pyproject.toml
Expand Up @@ -82,21 +82,7 @@ python_version = "3.8"
files = ["src/flask", "tests/typing"]
show_error_codes = true
pretty = true
#strict = true
allow_redefinition = true
disallow_subclassing_any = true
#disallow_untyped_calls = true
#disallow_untyped_defs = true
#disallow_incomplete_defs = true
no_implicit_optional = true
local_partial_types = true
#no_implicit_reexport = true
strict_equality = true
warn_redundant_casts = true
warn_unused_configs = true
warn_unused_ignores = true
#warn_return_any = true
#warn_unreachable = true
strict = true

[[tool.mypy.overrides]]
module = [
Expand Down
59 changes: 29 additions & 30 deletions requirements/dev.txt
Expand Up @@ -4,17 +4,19 @@
#
# pip-compile dev.in
#
alabaster==0.7.13
alabaster==0.7.16
# via sphinx
asgiref==3.7.2
# via -r tests.in
babel==2.13.1
# via
# -r tests.in
# -r typing.in
babel==2.14.0
# via sphinx
build==1.0.3
# via pip-tools
cachetools==5.3.2
# via tox
certifi==2023.7.22
certifi==2023.11.17
# via requests
cffi==1.16.0
# via cryptography
Expand All @@ -28,9 +30,9 @@ click==8.1.7
# via pip-tools
colorama==0.4.6
# via tox
cryptography==41.0.5
cryptography==41.0.7
# via -r typing.in
distlib==0.3.7
distlib==0.3.8
# via virtualenv
docutils==0.18.1
# via
Expand All @@ -40,19 +42,19 @@ filelock==3.13.1
# via
# tox
# virtualenv
identify==2.5.31
identify==2.5.33
# via pre-commit
idna==3.4
idna==3.6
# via requests
imagesize==1.4.1
# via sphinx
iniconfig==2.0.0
# via pytest
jinja2==3.1.2
jinja2==3.1.3
# via sphinx
markupsafe==2.1.3
# via jinja2
mypy==1.6.1
mypy==1.8.0
# via -r typing.in
mypy-extensions==1.0.0
# via mypy
Expand All @@ -70,30 +72,32 @@ pallets-sphinx-themes==2.1.1
# via -r docs.in
pip-tools==7.3.0
# via -r dev.in
platformdirs==3.11.0
platformdirs==4.1.0
# via
# tox
# virtualenv
pluggy==1.3.0
# via
# pytest
# tox
pre-commit==3.5.0
pre-commit==3.6.0
# via -r dev.in
pycparser==2.21
# via cffi
pygments==2.16.1
pygments==2.17.2
# via
# sphinx
# sphinx-tabs
pyproject-api==1.6.1
# via tox
pyproject-hooks==1.0.0
# via build
pytest==7.4.3
pytest==7.4.4
# via -r tests.in
python-dotenv==1.0.0
# via -r tests.in
# via
# -r tests.in
# -r typing.in
pyyaml==6.0.1
# via pre-commit
requests==2.31.0
Expand All @@ -106,45 +110,40 @@ sphinx==7.2.6
# pallets-sphinx-themes
# sphinx-issues
# sphinx-tabs
# sphinxcontrib-applehelp
# sphinxcontrib-devhelp
# sphinxcontrib-htmlhelp
# sphinxcontrib-log-cabinet
# sphinxcontrib-qthelp
# sphinxcontrib-serializinghtml
sphinx-issues==3.0.1
# via -r docs.in
sphinx-tabs==3.4.4
# via -r docs.in
sphinxcontrib-applehelp==1.0.7
sphinxcontrib-applehelp==1.0.8
# via sphinx
sphinxcontrib-devhelp==1.0.5
sphinxcontrib-devhelp==1.0.6
# via sphinx
sphinxcontrib-htmlhelp==2.0.4
sphinxcontrib-htmlhelp==2.0.5
# via sphinx
sphinxcontrib-jsmath==1.0.1
# via sphinx
sphinxcontrib-log-cabinet==1.0.1
# via -r docs.in
sphinxcontrib-qthelp==1.0.6
sphinxcontrib-qthelp==1.0.7
# via sphinx
sphinxcontrib-serializinghtml==1.1.9
sphinxcontrib-serializinghtml==1.1.10
# via sphinx
tox==4.11.3
tox==4.12.0
# via -r dev.in
types-contextvars==2.4.7.3
# via -r typing.in
types-dataclasses==0.6.6
# via -r typing.in
typing-extensions==4.8.0
typing-extensions==4.9.0
# via mypy
urllib3==2.0.7
urllib3==2.1.0
# via requests
virtualenv==20.24.6
virtualenv==20.25.0
# via
# pre-commit
# tox
wheel==0.41.3
wheel==0.42.0
# via pip-tools

# The following packages are considered to be unsafe in a requirements file:
Expand Down
29 changes: 12 additions & 17 deletions requirements/docs.txt
Expand Up @@ -4,23 +4,23 @@
#
# pip-compile docs.in
#
alabaster==0.7.13
alabaster==0.7.16
# via sphinx
babel==2.13.1
babel==2.14.0
# via sphinx
certifi==2023.7.22
certifi==2023.11.17
# via requests
charset-normalizer==3.3.2
# via requests
docutils==0.18.1
# via
# sphinx
# sphinx-tabs
idna==3.4
idna==3.6
# via requests
imagesize==1.4.1
# via sphinx
jinja2==3.1.2
jinja2==3.1.3
# via sphinx
markupsafe==2.1.3
# via jinja2
Expand All @@ -30,7 +30,7 @@ packaging==23.2
# sphinx
pallets-sphinx-themes==2.1.1
# via -r docs.in
pygments==2.16.1
pygments==2.17.2
# via
# sphinx
# sphinx-tabs
Expand All @@ -44,29 +44,24 @@ sphinx==7.2.6
# pallets-sphinx-themes
# sphinx-issues
# sphinx-tabs
# sphinxcontrib-applehelp
# sphinxcontrib-devhelp
# sphinxcontrib-htmlhelp
# sphinxcontrib-log-cabinet
# sphinxcontrib-qthelp
# sphinxcontrib-serializinghtml
sphinx-issues==3.0.1
# via -r docs.in
sphinx-tabs==3.4.4
# via -r docs.in
sphinxcontrib-applehelp==1.0.7
sphinxcontrib-applehelp==1.0.8
# via sphinx
sphinxcontrib-devhelp==1.0.5
sphinxcontrib-devhelp==1.0.6
# via sphinx
sphinxcontrib-htmlhelp==2.0.4
sphinxcontrib-htmlhelp==2.0.5
# via sphinx
sphinxcontrib-jsmath==1.0.1
# via sphinx
sphinxcontrib-log-cabinet==1.0.1
# via -r docs.in
sphinxcontrib-qthelp==1.0.6
sphinxcontrib-qthelp==1.0.7
# via sphinx
sphinxcontrib-serializinghtml==1.1.9
sphinxcontrib-serializinghtml==1.1.10
# via sphinx
urllib3==2.0.7
urllib3==2.1.0
# via requests
2 changes: 1 addition & 1 deletion requirements/tests.txt
Expand Up @@ -12,7 +12,7 @@ packaging==23.2
# via pytest
pluggy==1.3.0
# via pytest
pytest==7.4.3
pytest==7.4.4
# via -r tests.in
python-dotenv==1.0.0
# via -r tests.in
2 changes: 2 additions & 0 deletions requirements/typing.in
@@ -1,4 +1,6 @@
mypy
types-contextvars
types-dataclasses
asgiref
cryptography
python-dotenv
10 changes: 7 additions & 3 deletions requirements/typing.txt
Expand Up @@ -4,19 +4,23 @@
#
# pip-compile typing.in
#
asgiref==3.7.2
# via -r typing.in
cffi==1.16.0
# via cryptography
cryptography==41.0.5
cryptography==41.0.7
# via -r typing.in
mypy==1.6.1
mypy==1.8.0
# via -r typing.in
mypy-extensions==1.0.0
# via mypy
pycparser==2.21
# via cffi
python-dotenv==1.0.0
# via -r typing.in
types-contextvars==2.4.7.3
# via -r typing.in
types-dataclasses==0.6.6
# via -r typing.in
typing-extensions==4.8.0
typing-extensions==4.9.0
# via mypy

0 comments on commit bae6ee8

Please sign in to comment.