Skip to content

Commit

Permalink
Increase the upper boundary of the multidict dependency allowing v6
Browse files Browse the repository at this point in the history
The `multidict` dependency used to be `multidict >=4.5, < 7.0` in `aiohttp` v3.8.1,
but was pinned down to `multidict >=4.5, < 6.0` in `aiohttp` v3.8.2
(#6550) in an attempt to help avoid
new errors.

However, https://github.com/python/bedevere/ uses `multidict==6.0.2`
so the requirements resolution fails with `aiohttp==3.8.2`:

```console
ERROR: Cannot install -r requirements.txt (line 1) and multidict==6.0.2 because these package versions have conflicting dependencies.

The conflict is caused by:
    The user requested multidict==6.0.2
    aiohttp 3.8.2 depends on multidict<6.0 and >=4.5

To fix this you could try to:
1. loosen the range of package versions you've specified
2. remove package versions to allow pip attempt to solve the dependency conflict
```

https://github.com/hugovk/bedevere/actions/runs/3095794573/jobs/5010600772

This patch makes it possible to have `multidict` v6 installed in the same env as `aiohttp` v3.8.3, as with `aiohttp` v3.8.1.

Partially related to closed #6600 and
merged #6550.

PR #6950

Co-Authored-By: Sviatoslav Sydorenko <webknjaz@redhat.com>
  • Loading branch information
hugovk and webknjaz committed Sep 21, 2022
1 parent ee5e951 commit 50203c4
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
7 changes: 7 additions & 0 deletions CHANGES/6950.bugfix
@@ -0,0 +1,7 @@
Increased the upper boundary of the :doc:`multidict:index` dependency
to allow for the version 6 -- by :user:`hugovk`.

It used to be limited below version 7 in :doc:`aiohttp <index>` v3.8.1 but
was lowered in v3.8.2 via :pr:`6550` and never brought back, causing
problems with dependency pins when upgrading. :doc:`aiohttp <index>` v3.8.3
fixes that by recovering the original boundary of ``< 7``.
4 changes: 2 additions & 2 deletions aiohttp/web_ws.py
Expand Up @@ -196,9 +196,9 @@ def _handshake(
accept_val = base64.b64encode(
hashlib.sha1(key.encode() + WS_KEY).digest()
).decode()
response_headers = CIMultiDict( # type: ignore[var-annotated]
response_headers = CIMultiDict(
{
hdrs.UPGRADE: "websocket", # type: ignore[arg-type]
hdrs.UPGRADE: "websocket",
hdrs.CONNECTION: "upgrade",
hdrs.SEC_WEBSOCKET_ACCEPT: accept_val,
}
Expand Down
2 changes: 1 addition & 1 deletion setup.cfg
Expand Up @@ -50,7 +50,7 @@ include_package_data = True
install_requires =
attrs >= 17.3.0
charset-normalizer >=2.0, < 3.0
multidict >=4.5, < 6.0
multidict >=4.5, < 7.0
async_timeout >= 4.0.0a3, < 5.0
asynctest == 0.13.0; python_version<"3.8"
yarl >= 1.0, < 2.0
Expand Down

0 comments on commit 50203c4

Please sign in to comment.