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

Bump mypy from 1.6.1 to 1.7.0 #7833

Merged
merged 9 commits into from Nov 13, 2023
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
4 changes: 2 additions & 2 deletions aiohttp/client_reqrep.py
Expand Up @@ -462,7 +462,7 @@ def update_cookies(self, cookies: Optional[LooseCookies]) -> None:
if not cookies:
return

c: SimpleCookie[str] = SimpleCookie()
c = SimpleCookie()
if hdrs.COOKIE in self.headers:
c.load(self.headers.get(hdrs.COOKIE, ""))
del self.headers[hdrs.COOKIE]
Expand Down Expand Up @@ -789,7 +789,7 @@ def __init__(
assert isinstance(url, URL)

self.method = method
self.cookies: SimpleCookie[str] = SimpleCookie()
self.cookies = SimpleCookie()

self._real_url = url
self._url = url.with_fragment(None)
Expand Down
2 changes: 1 addition & 1 deletion aiohttp/connector.py
Expand Up @@ -248,7 +248,7 @@ def __init__(
self._loop = loop
self._factory = functools.partial(ResponseHandler, loop=loop)

self.cookies: SimpleCookie[str] = SimpleCookie()
self.cookies = SimpleCookie()

# start keep-alive connection cleanup task
self._cleanup_handle: Optional[asyncio.TimerHandle] = None
Expand Down
10 changes: 4 additions & 6 deletions aiohttp/cookiejar.py
Expand Up @@ -65,7 +65,7 @@ def __init__(
loop: Optional[asyncio.AbstractEventLoop] = None,
) -> None:
super().__init__(loop=loop)
self._cookies: DefaultDict[Tuple[str, str], SimpleCookie[str]] = defaultdict(
self._cookies: DefaultDict[Tuple[str, str], SimpleCookie] = defaultdict(
SimpleCookie
)
self._host_only_cookies: Set[Tuple[str, str]] = set()
Expand Down Expand Up @@ -168,7 +168,7 @@ def update_cookies(self, cookies: LooseCookies, response_url: URL = URL()) -> No

for name, cookie in cookies:
if not isinstance(cookie, Morsel):
tmp: SimpleCookie[str] = SimpleCookie()
tmp = SimpleCookie()
tmp[name] = cookie # type: ignore[assignment]
cookie = tmp[name]

Expand Down Expand Up @@ -232,11 +232,9 @@ def update_cookies(self, cookies: LooseCookies, response_url: URL = URL()) -> No

self._do_expiration()

def filter_cookies(
self, request_url: URL = URL()
) -> Union["BaseCookie[str]", "SimpleCookie[str]"]:
def filter_cookies(self, request_url: URL = URL()) -> "BaseCookie[str]":
"""Returns this jar's cookies filtered by their attributes."""
filtered: Union["SimpleCookie[str]", "BaseCookie[str]"] = (
filtered: Union[SimpleCookie, "BaseCookie[str]"] = (
SimpleCookie() if self._quote_cookie else BaseCookie()
)
if not self._cookies:
Expand Down
2 changes: 1 addition & 1 deletion aiohttp/resolver.py
Expand Up @@ -45,7 +45,7 @@ async def resolve(
# IPv6 is not supported by Python build,
# or IPv6 is not enabled in the host
continue
if address[3]: # type: ignore[misc]
if address[3]:
# This is essential for link-local IPv6 addresses.
# LL IPv6 is a VERY rare case. Strictly speaking, we should use
# getnameinfo() unconditionally, but performance makes sense.
Expand Down
2 changes: 1 addition & 1 deletion aiohttp/web_request.py
Expand Up @@ -582,7 +582,7 @@ def cookies(self) -> Mapping[str, str]:
A read-only dictionary-like object.
"""
raw = self.headers.get(hdrs.COOKIE, "")
parsed: SimpleCookie[str] = SimpleCookie(raw)
parsed = SimpleCookie(raw)
return MappingProxyType({key: val.value for key, val in parsed.items()})

@reify
Expand Down
4 changes: 2 additions & 2 deletions aiohttp/web_response.py
Expand Up @@ -83,7 +83,7 @@ def __init__(
self._chunked = False
self._compression = False
self._compression_force: Optional[ContentCoding] = None
self._cookies: SimpleCookie[str] = SimpleCookie()
self._cookies = SimpleCookie()

self._req: Optional[BaseRequest] = None
self._payload_writer: Optional[AbstractStreamWriter] = None
Expand Down Expand Up @@ -193,7 +193,7 @@ def headers(self) -> "CIMultiDict[str]":
return self._headers

@property
def cookies(self) -> "SimpleCookie[str]":
def cookies(self) -> SimpleCookie:
return self._cookies

def set_cookie(
Expand Down
9 changes: 5 additions & 4 deletions requirements/constraints.txt
Expand Up @@ -108,7 +108,7 @@ multidict==6.0.4
# -r requirements/multidict.in
# -r requirements/runtime-deps.in
# yarl
mypy==1.6.1 ; implementation_name == "cpython"
mypy==1.7.0 ; implementation_name == "cpython"
# via
# -r requirements/lint.in
# -r requirements/test.in
Expand Down Expand Up @@ -188,16 +188,16 @@ setuptools-git==1.2
six==1.16.0
# via
# python-dateutil
# sphinx
# virtualenv
slotscheck==0.17.1
# via -r requirements/lint.in
snowballstemmer==2.1.0
# via sphinx
sphinx==7.2.6
sphinx==7.1.2
# via
# -r requirements/doc.in
# sphinxcontrib-blockdiag
# sphinxcontrib-serializinghtml
# sphinxcontrib-spelling
# sphinxcontrib-towncrier
sphinxcontrib-applehelp==1.0.2
Expand All @@ -212,7 +212,7 @@ sphinxcontrib-jsmath==1.0.1
# via sphinx
sphinxcontrib-qthelp==1.0.3
# via sphinx
sphinxcontrib-serializinghtml==1.1.9
sphinxcontrib-serializinghtml==1.1.5
# via sphinx
sphinxcontrib-spelling==8.0.0 ; platform_system != "Windows"
# via -r requirements/doc-spelling.in
Expand Down Expand Up @@ -280,3 +280,4 @@ setuptools==68.0.0
# via
# blockdiag
# pip-tools
# sphinx
12 changes: 7 additions & 5 deletions requirements/dev.txt
Expand Up @@ -103,7 +103,7 @@ multidict==6.0.4
# via
# -r requirements/runtime-deps.in
# yarl
mypy==1.6.1 ; implementation_name == "cpython"
mypy==1.7.0 ; implementation_name == "cpython"
# via
# -r requirements/lint.in
# -r requirements/test.in
Expand Down Expand Up @@ -177,16 +177,17 @@ requests==2.31.0
setuptools-git==1.2
# via -r requirements/test.in
six==1.16.0
# via python-dateutil
# via
# python-dateutil
# sphinx
slotscheck==0.17.1
# via -r requirements/lint.in
snowballstemmer==2.2.0
# via sphinx
sphinx==7.2.6
sphinx==7.1.2
# via
# -r requirements/doc.in
# sphinxcontrib-blockdiag
# sphinxcontrib-serializinghtml
# sphinxcontrib-towncrier
sphinxcontrib-applehelp==1.0.4
# via sphinx
Expand All @@ -200,7 +201,7 @@ sphinxcontrib-jsmath==1.0.1
# via sphinx
sphinxcontrib-qthelp==1.0.3
# via sphinx
sphinxcontrib-serializinghtml==1.1.9
sphinxcontrib-serializinghtml==1.1.5
# via sphinx
sphinxcontrib-towncrier==0.4.0a0
# via -r requirements/doc.in
Expand Down Expand Up @@ -268,3 +269,4 @@ setuptools==68.0.0
# blockdiag
# nodeenv
# pip-tools
# sphinx
2 changes: 1 addition & 1 deletion requirements/lint.txt
Expand Up @@ -22,7 +22,7 @@ identify==2.5.26
# via pre-commit
iniconfig==2.0.0
# via pytest
mypy==1.6.1 ; implementation_name == "cpython"
mypy==1.7.0 ; implementation_name == "cpython"
# via -r requirements/lint.in
mypy-extensions==1.0.0
# via mypy
Expand Down
2 changes: 1 addition & 1 deletion requirements/test.txt
Expand Up @@ -53,7 +53,7 @@ multidict==6.0.4
# via
# -r requirements/runtime-deps.in
# yarl
mypy==1.6.1 ; implementation_name == "cpython"
mypy==1.7.0 ; implementation_name == "cpython"
# via -r requirements/test.in
mypy-extensions==1.0.0
# via mypy
Expand Down