diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index d9340fb3..a43bc700 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,6 +1,6 @@ repos: - repo: https://github.com/pre-commit/pre-commit-hooks - rev: 'v4.5.0' + rev: 'v5.0.0' hooks: - id: check-merge-conflict - repo: https://github.com/asottile/yesqa @@ -8,16 +8,16 @@ repos: hooks: - id: yesqa - repo: https://github.com/PyCQA/isort - rev: '5.12.0' + rev: '5.13.2' hooks: - id: isort - repo: https://github.com/psf/black - rev: '23.11.0' + rev: '24.10.0' hooks: - id: black language_version: python3 # Should be a command that runs python - repo: https://github.com/pre-commit/pre-commit-hooks - rev: 'v4.5.0' + rev: 'v5.0.0' hooks: - id: end-of-file-fixer exclude: >- @@ -46,12 +46,12 @@ repos: - id: detect-private-key exclude: ^examples/ - repo: https://github.com/PyCQA/flake8 - rev: '6.1.0' + rev: '7.1.1' hooks: - id: flake8 exclude: "^docs/" - repo: https://github.com/asottile/pyupgrade - rev: 'v3.15.0' + rev: 'v3.19.0' hooks: - id: pyupgrade args: ['--py36-plus'] diff --git a/aiohttp_jinja2/__init__.py b/aiohttp_jinja2/__init__.py index 11214890..e1b68bf9 100644 --- a/aiohttp_jinja2/__init__.py +++ b/aiohttp_jinja2/__init__.py @@ -51,20 +51,17 @@ class _TemplateWrapper(Protocol): @overload def __call__( self, func: _SimpleTemplateHandler - ) -> Callable[[web.Request], Awaitable[web.StreamResponse]]: - ... + ) -> Callable[[web.Request], Awaitable[web.StreamResponse]]: ... @overload def __call__( self, func: Callable[[_AbstractView], _TemplateReturnType] - ) -> Callable[[_AbstractView], Awaitable[web.StreamResponse]]: - ... + ) -> Callable[[_AbstractView], Awaitable[web.StreamResponse]]: ... @overload def __call__( self, func: Callable[[_T, web.Request], _TemplateReturnType] - ) -> Callable[[_T, web.Request], Awaitable[web.StreamResponse]]: - ... + ) -> Callable[[_T, web.Request], Awaitable[web.StreamResponse]]: ... def setup( @@ -203,20 +200,17 @@ def template( @overload def wrapper( func: _SimpleTemplateHandler, - ) -> Callable[[web.Request], Awaitable[web.StreamResponse]]: - ... + ) -> Callable[[web.Request], Awaitable[web.StreamResponse]]: ... @overload def wrapper( func: Callable[[_AbstractView], _TemplateReturnType] - ) -> Callable[[_AbstractView], Awaitable[web.StreamResponse]]: - ... + ) -> Callable[[_AbstractView], Awaitable[web.StreamResponse]]: ... @overload def wrapper( func: Callable[[_T, web.Request], _TemplateReturnType] - ) -> Callable[[_T, web.Request], Awaitable[web.StreamResponse]]: - ... + ) -> Callable[[_T, web.Request], Awaitable[web.StreamResponse]]: ... def wrapper( func: Callable[..., _TemplateReturnType] diff --git a/aiohttp_jinja2/helpers.py b/aiohttp_jinja2/helpers.py index 756079cd..b9fcbaaa 100644 --- a/aiohttp_jinja2/helpers.py +++ b/aiohttp_jinja2/helpers.py @@ -2,6 +2,7 @@ useful context functions, see http://jinja.pocoo.org/docs/dev/api/#jinja2.contextfunction """ + import warnings from typing import Dict, Optional, TypedDict, Union