Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

use _typeshed.wsgi instead of wsgiref.types #2134

Merged
merged 1 commit into from May 17, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/werkzeug/_internal.py
Expand Up @@ -13,9 +13,9 @@
from weakref import WeakKeyDictionary

if t.TYPE_CHECKING:
from wsgiref.types import StartResponse
from wsgiref.types import WSGIApplication
from wsgiref.types import WSGIEnvironment
from _typeshed.wsgi import StartResponse
from _typeshed.wsgi import WSGIApplication
from _typeshed.wsgi import WSGIEnvironment
from .wrappers.request import Request # noqa: F401

_logger: t.Optional[logging.Logger] = None
Expand Down
2 changes: 1 addition & 1 deletion src/werkzeug/datastructures.pyi
Expand Up @@ -20,7 +20,7 @@ from typing import Tuple
from typing import Type
from typing import TypeVar
from typing import Union
from wsgiref.types import WSGIEnvironment
from _typeshed.wsgi import WSGIEnvironment

from typing_extensions import Literal

Expand Down
6 changes: 3 additions & 3 deletions src/werkzeug/debug/__init__.py
Expand Up @@ -25,9 +25,9 @@
from .tbtools import Traceback

if t.TYPE_CHECKING:
from wsgiref.types import StartResponse
from wsgiref.types import WSGIApplication
from wsgiref.types import WSGIEnvironment
from _typeshed.wsgi import StartResponse
from _typeshed.wsgi import WSGIApplication
from _typeshed.wsgi import WSGIEnvironment

# A week
PIN_TIME = 60 * 60 * 24 * 7
Expand Down
4 changes: 2 additions & 2 deletions src/werkzeug/exceptions.py
Expand Up @@ -53,8 +53,8 @@ def application(request):

if t.TYPE_CHECKING:
import typing_extensions as te
from wsgiref.types import StartResponse
from wsgiref.types import WSGIEnvironment
from _typeshed.wsgi import StartResponse
from _typeshed.wsgi import WSGIEnvironment
from .datastructures import WWWAuthenticate
from .sansio.response import Response
from .wrappers.response import Response as WSGIResponse # noqa: F401
Expand Down
2 changes: 1 addition & 1 deletion src/werkzeug/formparser.py
Expand Up @@ -33,7 +33,7 @@

if t.TYPE_CHECKING:
import typing as te
from wsgiref.types import WSGIEnvironment
from _typeshed.wsgi import WSGIEnvironment

t_parse_result = t.Tuple[t.BinaryIO, MultiDict, MultiDict]

Expand Down
2 changes: 1 addition & 1 deletion src/werkzeug/http.py
Expand Up @@ -26,7 +26,7 @@

if t.TYPE_CHECKING:
import typing_extensions as te
from wsgiref.types import WSGIEnvironment
from _typeshed.wsgi import WSGIEnvironment

# for explanation of "media-range", etc. see Sections 5.3.{1,2} of RFC 7231
_accept_re = re.compile(
Expand Down
6 changes: 3 additions & 3 deletions src/werkzeug/local.py
Expand Up @@ -10,9 +10,9 @@
from .wsgi import ClosingIterator

if t.TYPE_CHECKING:
from wsgiref.types import StartResponse
from wsgiref.types import WSGIApplication
from wsgiref.types import WSGIEnvironment
from _typeshed.wsgi import StartResponse
from _typeshed.wsgi import WSGIApplication
from _typeshed.wsgi import WSGIEnvironment

F = t.TypeVar("F", bound=t.Callable[..., t.Any])

Expand Down
6 changes: 3 additions & 3 deletions src/werkzeug/middleware/dispatcher.py
Expand Up @@ -33,9 +33,9 @@
import typing as t

if t.TYPE_CHECKING:
from wsgiref.types import StartResponse
from wsgiref.types import WSGIApplication
from wsgiref.types import WSGIEnvironment
from _typeshed.wsgi import StartResponse
from _typeshed.wsgi import WSGIApplication
from _typeshed.wsgi import WSGIEnvironment


class DispatcherMiddleware:
Expand Down
6 changes: 3 additions & 3 deletions src/werkzeug/middleware/http_proxy.py
Expand Up @@ -17,9 +17,9 @@
from ..wsgi import get_input_stream

if t.TYPE_CHECKING:
from wsgiref.types import StartResponse
from wsgiref.types import WSGIApplication
from wsgiref.types import WSGIEnvironment
from _typeshed.wsgi import StartResponse
from _typeshed.wsgi import WSGIApplication
from _typeshed.wsgi import WSGIEnvironment


class ProxyMiddleware:
Expand Down
6 changes: 3 additions & 3 deletions src/werkzeug/middleware/lint.py
Expand Up @@ -22,9 +22,9 @@
from ..wsgi import FileWrapper

if t.TYPE_CHECKING:
from wsgiref.types import StartResponse
from wsgiref.types import WSGIApplication
from wsgiref.types import WSGIEnvironment
from _typeshed.wsgi import StartResponse
from _typeshed.wsgi import WSGIApplication
from _typeshed.wsgi import WSGIEnvironment


class WSGIWarning(Warning):
Expand Down
6 changes: 3 additions & 3 deletions src/werkzeug/middleware/profiler.py
Expand Up @@ -23,9 +23,9 @@
from profile import Profile # type: ignore

if t.TYPE_CHECKING:
from wsgiref.types import StartResponse
from wsgiref.types import WSGIApplication
from wsgiref.types import WSGIEnvironment
from _typeshed.wsgi import StartResponse
from _typeshed.wsgi import WSGIApplication
from _typeshed.wsgi import WSGIEnvironment


class ProfilerMiddleware:
Expand Down
6 changes: 3 additions & 3 deletions src/werkzeug/middleware/proxy_fix.py
Expand Up @@ -26,9 +26,9 @@
from ..http import parse_list_header

if t.TYPE_CHECKING:
from wsgiref.types import StartResponse
from wsgiref.types import WSGIApplication
from wsgiref.types import WSGIEnvironment
from _typeshed.wsgi import StartResponse
from _typeshed.wsgi import WSGIApplication
from _typeshed.wsgi import WSGIEnvironment


class ProxyFix:
Expand Down
6 changes: 3 additions & 3 deletions src/werkzeug/middleware/shared_data.py
Expand Up @@ -31,9 +31,9 @@
_TLoader = t.Callable[[t.Optional[str]], t.Tuple[t.Optional[str], t.Optional[_TOpener]]]

if t.TYPE_CHECKING:
from wsgiref.types import StartResponse
from wsgiref.types import WSGIApplication
from wsgiref.types import WSGIEnvironment
from _typeshed.wsgi import StartResponse
from _typeshed.wsgi import WSGIApplication
from _typeshed.wsgi import WSGIEnvironment


class SharedDataMiddleware:
Expand Down
4 changes: 2 additions & 2 deletions src/werkzeug/routing.py
Expand Up @@ -140,8 +140,8 @@

if t.TYPE_CHECKING:
import typing_extensions as te
from wsgiref.types import WSGIApplication
from wsgiref.types import WSGIEnvironment
from _typeshed.wsgi import WSGIApplication
from _typeshed.wsgi import WSGIEnvironment
from .wrappers.response import Response

_rule_re = re.compile(
Expand Down
4 changes: 2 additions & 2 deletions src/werkzeug/serving.py
Expand Up @@ -75,8 +75,8 @@ class ForkingMixIn: # type: ignore

if t.TYPE_CHECKING:
import typing_extensions as te # noqa: F401
from wsgiref.types import WSGIApplication
from wsgiref.types import WSGIEnvironment
from _typeshed.wsgi import WSGIApplication
from _typeshed.wsgi import WSGIEnvironment
from cryptography.hazmat.primitives.asymmetric.rsa import (
RSAPrivateKeyWithSerialization,
)
Expand Down
4 changes: 2 additions & 2 deletions src/werkzeug/test.py
Expand Up @@ -46,8 +46,8 @@
from .wsgi import get_current_url

if t.TYPE_CHECKING:
from wsgiref.types import WSGIApplication
from wsgiref.types import WSGIEnvironment
from _typeshed.wsgi import WSGIApplication
from _typeshed.wsgi import WSGIEnvironment


def stream_encode_multipart(
Expand Down
4 changes: 2 additions & 2 deletions src/werkzeug/testapp.py
Expand Up @@ -13,8 +13,8 @@
from .wrappers.response import Response

if t.TYPE_CHECKING:
from wsgiref.types import StartResponse
from wsgiref.types import WSGIEnvironment
from _typeshed.wsgi import StartResponse
from _typeshed.wsgi import WSGIEnvironment


logo = Response(
Expand Down
2 changes: 1 addition & 1 deletion src/werkzeug/useragents.py
Expand Up @@ -5,7 +5,7 @@
from .user_agent import UserAgent as _BaseUserAgent

if t.TYPE_CHECKING:
from wsgiref.types import WSGIEnvironment
from _typeshed.wsgi import WSGIEnvironment


class _UserAgentParser:
Expand Down
2 changes: 1 addition & 1 deletion src/werkzeug/utils.py
Expand Up @@ -25,7 +25,7 @@
from .wsgi import wrap_file

if t.TYPE_CHECKING:
from wsgiref.types import WSGIEnvironment
from _typeshed.wsgi import WSGIEnvironment
from .wrappers.request import Request
from .wrappers.response import Response

Expand Down
4 changes: 2 additions & 2 deletions src/werkzeug/wrappers/request.py
Expand Up @@ -23,8 +23,8 @@

if t.TYPE_CHECKING:
import typing_extensions as te
from wsgiref.types import WSGIApplication
from wsgiref.types import WSGIEnvironment
from _typeshed.wsgi import WSGIApplication
from _typeshed.wsgi import WSGIEnvironment


class Request(_SansIORequest):
Expand Down
6 changes: 3 additions & 3 deletions src/werkzeug/wrappers/response.py
Expand Up @@ -23,9 +23,9 @@

if t.TYPE_CHECKING:
import typing_extensions as te
from wsgiref.types import StartResponse
from wsgiref.types import WSGIApplication
from wsgiref.types import WSGIEnvironment
from _typeshed.wsgi import StartResponse
from _typeshed.wsgi import WSGIApplication
from _typeshed.wsgi import WSGIEnvironment


def _warn_if_string(iterable: t.Iterable) -> None:
Expand Down
4 changes: 2 additions & 2 deletions src/werkzeug/wsgi.py
Expand Up @@ -17,8 +17,8 @@
from .urls import url_quote

if t.TYPE_CHECKING:
from wsgiref.types import WSGIApplication
from wsgiref.types import WSGIEnvironment
from _typeshed.wsgi import WSGIApplication
from _typeshed.wsgi import WSGIEnvironment


def responder(f: t.Callable[..., "WSGIApplication"]) -> "WSGIApplication":
Expand Down