Skip to content

Commit 78a0a0b

Browse files
0xRAGfselmo
authored andcommitted
chore(deps): bump websocksets to 15+
1 parent 52f5884 commit 78a0a0b

File tree

12 files changed

+51
-35
lines changed

12 files changed

+51
-35
lines changed

.circleci/config.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,7 @@ workflows:
221221
- common:
222222
matrix:
223223
parameters:
224-
python_minor_version: ["8", "9", "10", "11", "12", "13"]
224+
python_minor_version: ["9", "10", "11", "12", "13"]
225225
tox_env: [
226226
"lint",
227227
"core",
@@ -234,7 +234,7 @@ workflows:
234234
- geth:
235235
matrix:
236236
parameters:
237-
python_minor_version: ["8", "9", "10", "11", "12", "13"]
237+
python_minor_version: ["9", "10", "11", "12", "13"]
238238
tox_env: [
239239
"integration-goethereum-ipc",
240240
"integration-goethereum-ipc_async",

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
web3.py allows you to interact with the Ethereum blockchain using Python, enabling you to build decentralized applications, interact with smart contracts, and much more.
1212

13-
- Python 3.8+ support
13+
- Python 3.9+ support
1414

1515
## Installation
1616

docs/migration.rst

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,31 @@
11
Migration Guide
22
===============
33

4+
.. _migrating_v7_to_v8:
5+
6+
Migrating from v7 to v8
7+
-----------------------
8+
9+
web3.py follows `Semantic Versioning <http://semver.org>`_, which means that
10+
version 8 introduced backwards-incompatible changes. If you're upgrading from
11+
web3.py ``v7``, you can expect to need to make some changes. Refer
12+
to this guide for a summary of breaking changes when updating from ``v7`` to
13+
``v8``. If you are more than one major version behind, you should also review
14+
the migration guides for the versions in between.
15+
16+
Dependency Updates
17+
~~~~~~~~~~~~~~~~~~
18+
19+
websockets
20+
``````````
21+
22+
The ``websockets`` library has been updated to version 15+. This version
23+
drops support for Python 3.8 and below. If you are using Python 3.8 or below,
24+
you will need to upgrade to Python 3.9 or above to use web3.py ``v8``. Additionally,
25+
the minimum required version of ``websockets`` has been bumped to ``15.0.0``. If you
26+
are using a version of ``websockets`` below ``15.0.0``, you will need to upgrade to
27+
``15.0.0`` or above to use web3.py ``v8``.
28+
429
.. _migrating_v6_to_v7:
530

631
Migrating from v6 to v7

newsfragments/3641.breaking.rst

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
Bump websockets to >=15.0.0,<16.0.0
2+
3+
This is potentially a breaking change in two ways:
4+
1. Users directly depending on websockets 13.0 or lower will have to bump to websockets 15.0
5+
2. Users on Python 3.8 or lower will have to bump to Python 3.9, since websockets 14.0 dropped
6+
support for Python 3.8

setup.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -78,10 +78,10 @@
7878
"requests>=2.23.0",
7979
"typing-extensions>=4.0.1",
8080
"types-requests>=2.0.0",
81-
"websockets>=10.0.0,<14.0.0",
81+
"websockets>=15.0.0,<16.0.0",
8282
"pyunormalize>=15.0.0",
8383
],
84-
python_requires=">=3.8, <4",
84+
python_requires=">=3.9, <4",
8585
extras_require=extras_require,
8686
py_modules=["web3", "ens"],
8787
license="MIT",
@@ -95,7 +95,6 @@
9595
"License :: OSI Approved :: MIT License",
9696
"Natural Language :: English",
9797
"Programming Language :: Python :: 3",
98-
"Programming Language :: Python :: 3.8",
9998
"Programming Language :: Python :: 3.9",
10099
"Programming Language :: Python :: 3.10",
101100
"Programming Language :: Python :: 3.11",

tests/core/providers/test_legacy_websocket_provider.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,9 @@
77
Thread,
88
)
99

10-
import websockets
10+
from websockets.legacy.server import (
11+
serve,
12+
)
1113

1214
from tests.utils import (
1315
wait_for_ws,
@@ -35,7 +37,7 @@ async def empty_server(websocket, path):
3537
await websocket.send(data)
3638

3739
asyncio.set_event_loop(event_loop)
38-
server = websockets.serve(empty_server, "127.0.0.1", open_port)
40+
server = serve(empty_server, "127.0.0.1", open_port)
3941
event_loop.run_until_complete(server)
4042
event_loop.run_forever()
4143

tests/utils.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@
22
import socket
33
import time
44

5-
import websockets
5+
from websockets.legacy.client import (
6+
connect,
7+
)
68

79
from web3._utils.threads import (
810
Timeout,
@@ -43,7 +45,7 @@ async def wait_for_ws(endpoint_uri, timeout=10):
4345
start = time.time()
4446
while time.time() < start + timeout:
4547
try:
46-
async with websockets.connect(uri=endpoint_uri):
48+
async with connect(uri=endpoint_uri):
4749
pass
4850
except OSError:
4951
await asyncio.sleep(0.01)

tox.ini

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@ passenv =
4545
basepython =
4646
docs: python
4747
windows-wheel: python
48-
py38: python3.8
4948
py39: python3.9
5049
py310: python3.10
5150
py311: python3.11

web3/providers/async_base.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@
5353
)
5454

5555
if TYPE_CHECKING:
56-
from websockets import (
56+
from websockets.legacy.client import (
5757
WebSocketClientProtocol,
5858
)
5959

web3/providers/legacy_websocket.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,9 @@
2121
from eth_typing import (
2222
URI,
2323
)
24-
from websockets.client import (
25-
connect,
26-
)
2724
from websockets.legacy.client import (
2825
WebSocketClientProtocol,
26+
connect,
2927
)
3028

3129
from web3._utils.batching import (

0 commit comments

Comments
 (0)