Skip to content

Commit

Permalink
Revert fix MultiDict typing with multidict-6.0.0 (#64733) (#64792)
Browse files Browse the repository at this point in the history
* revert #64733

* pin down multidict to < 6.0.0
  • Loading branch information
mib1185 committed Jan 23, 2022
1 parent 425911e commit 2f0059f
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
4 changes: 4 additions & 0 deletions homeassistant/package_constraints.txt
Original file line number Diff line number Diff line change
Expand Up @@ -95,3 +95,7 @@ pytest_asyncio==1000000000.0.0
# https://github.com/jkeljo/sisyphus-control/issues/6
python-engineio>=3.13.1,<4.0
python-socketio>=4.6.0,<5.0

# Constrain multidict to avoid typing issues
# https://github.com/home-assistant/core/pull/64792
multidict<6.0.0
6 changes: 3 additions & 3 deletions homeassistant/util/aiohttp.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,13 +44,13 @@ def __init__(
self.method = method
self.url = url
self.status = status
self.headers: CIMultiDict[str, str] = CIMultiDict(headers or {})
self.headers: CIMultiDict[str] = CIMultiDict(headers or {})
self.query_string = query_string or ""
self._content = content
self.mock_source = mock_source

@property
def query(self) -> MultiDict[str, str]:
def query(self) -> MultiDict[str]:
"""Return a dictionary with the query variables."""
return MultiDict(parse_qsl(self.query_string, keep_blank_values=True))

Expand All @@ -68,7 +68,7 @@ async def json(self) -> Any:
"""Return the body as JSON."""
return json.loads(self._text)

async def post(self) -> MultiDict[str, str]:
async def post(self) -> MultiDict[str]:
"""Return POST parameters."""
return MultiDict(parse_qsl(self._text, keep_blank_values=True))

Expand Down
4 changes: 4 additions & 0 deletions script/gen_requirements_all.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,10 @@
# https://github.com/jkeljo/sisyphus-control/issues/6
python-engineio>=3.13.1,<4.0
python-socketio>=4.6.0,<5.0
# Constrain multidict to avoid typing issues
# https://github.com/home-assistant/core/pull/64792
multidict<6.0.0
"""

IGNORE_PRE_COMMIT_HOOK_ID = (
Expand Down

0 comments on commit 2f0059f

Please sign in to comment.