Skip to content

Commit

Permalink
Remove django-stubs dependency from production code
Browse files Browse the repository at this point in the history
  • Loading branch information
apragacz committed Mar 17, 2023
1 parent b727afa commit 22a3927
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion rest_registration/exceptions.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
from typing import Any, Dict, List, Optional, Union

from django.utils.translation import gettext_lazy as _
from django_stubs_ext import StrOrPromise
from rest_framework.exceptions import APIException as _APIException
from rest_framework.settings import api_settings

from rest_registration.settings import registration_settings
from rest_registration.utils.types import StrOrPromise

_DetailType = Union[StrOrPromise, List[str], Dict[str, List[str]]]

Expand Down
3 changes: 3 additions & 0 deletions rest_registration/utils/types.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
from typing import TYPE_CHECKING

if TYPE_CHECKING:
from django_stubs_ext import StrOrPromise

# mypy uses typing_extensions by default (Py 3.8); when importing from typing
# one will get the following error message in mypy:
#
Expand All @@ -13,3 +15,4 @@
from typing import Literal
except ImportError:
from typing_extensions import Literal # noqa: F401
StrOrPromise = str

0 comments on commit 22a3927

Please sign in to comment.