Skip to content

Commit

Permalink
feat: py39
Browse files Browse the repository at this point in the history
  • Loading branch information
klen committed Jul 31, 2024
1 parent 527bd81 commit 98efc2b
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 10 deletions.
4 changes: 2 additions & 2 deletions muffin/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
from contextvars import ContextVar
from inspect import isawaitable, stack
from logging.config import dictConfig
from typing import TYPE_CHECKING, Any, Dict, Final, Mapping, Union
from typing import TYPE_CHECKING, Any, Final, Mapping, Union

from asgi_tools import App as BaseApp
from asgi_tools._compat import aio_wait
Expand Down Expand Up @@ -57,7 +57,7 @@ def __init__(self, *cfg_mods: Union[str, ModuleType], **options):
:param **options: Configuration options
"""
self.plugins: Dict[str, BasePlugin] = {}
self.plugins: dict[str, BasePlugin] = {}

# Setup the configuration
self.cfg = Config(**self.defaults, config_config={"update_from_env": False})
Expand Down
6 changes: 3 additions & 3 deletions muffin/handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from __future__ import annotations

import inspect
from typing import TYPE_CHECKING, Any, Awaitable, Callable, Dict, Optional, Tuple, Type, cast
from typing import TYPE_CHECKING, Any, Awaitable, Callable, Optional, cast

from asgi_tools.utils import is_awaitable
from asgi_tools.view import HTTP_METHODS, HTTPView
Expand All @@ -20,9 +20,9 @@
class HandlerMeta(type):
"""Prepare handlers."""

def __new__(mcs: Type[HandlerMeta], name: str, bases: Tuple[type], params: Dict[str, Any]):
def __new__(mcs: type[HandlerMeta], name: str, bases: tuple[type], params: dict[str, Any]):
"""Prepare a Handler Class."""
cls = cast(Type["Handler"], super().__new__(mcs, name, bases, params))
cls = cast(type["Handler"], super().__new__(mcs, name, bases, params))

# Ensure that the class methods are exist and iterable
if not cls.methods:
Expand Down
4 changes: 2 additions & 2 deletions muffin/manage.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
from contextlib import AsyncExitStack, suppress
from importlib import metadata
from pathlib import Path
from typing import TYPE_CHECKING, AsyncContextManager, Callable, Dict, Optional, overload
from typing import TYPE_CHECKING, AsyncContextManager, Callable, Optional, overload

from muffin.constants import CONFIG_ENV_VARIABLE
from muffin.errors import AsyncRequiredError
Expand Down Expand Up @@ -70,7 +70,7 @@ def __init__(self, app: "Application"):
)

self.subparsers = self.parser.add_subparsers(dest="subparser")
self.commands: Dict[str, Callable] = {}
self.commands: dict[str, Callable] = {}

self.shell(
getattr(
Expand Down
6 changes: 3 additions & 3 deletions muffin/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
from collections import OrderedDict
from contextlib import suppress
from logging import getLogger
from typing import TYPE_CHECKING, Callable, Coroutine, Dict, Iterable, TypeVar
from typing import TYPE_CHECKING, Callable, Coroutine, Iterable, TypeVar

from asgi_tools.utils import is_awaitable, to_awaitable
from sniffio import current_async_library
Expand All @@ -35,7 +35,7 @@

AIOLIB = threading.local()
AIOLIB.current = None
AIOLIBS: Dict[str, ModuleType] = OrderedDict()
AIOLIBS: dict[str, ModuleType] = OrderedDict()

with suppress(ImportError):
import curio
Expand Down Expand Up @@ -78,7 +78,7 @@ def aio_run(corofn: Callable[..., Coroutine[None, None, TV]], *args, **kwargs) -

def import_submodules(
package_name: str, *module_names: str, silent: bool = False, exclude: Iterable[str] = ()
) -> Dict[str, ModuleType]:
) -> dict[str, ModuleType]:
"""Import all submodules by the given package name."""
package = sys.modules[package_name]
res = {}
Expand Down

0 comments on commit 98efc2b

Please sign in to comment.