Skip to content

Commit

Permalink
Drop support for python 3.7:
Browse files Browse the repository at this point in the history
We will have more peripheral updates to make due to the dropping of
python 3.7, such as forgoing some typing imports from typing_extensions,
etc. For now, we have PRs that are already expecting python 3.7 to be
dropped and all tests fail there. This commit aims to only drop the tests,
the CI support for py37, and the claim that the library supports 3.7.2 and above.
  • Loading branch information
fselmo committed Jan 22, 2024
1 parent 84609c3 commit 1ee4312
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 200 deletions.
152 changes: 0 additions & 152 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -236,140 +236,6 @@ jobs:
environment:
TOXENV: docs


#
# Python 3.7
#
py37-core:
<<: *common
docker:
- image: cimg/python:3.7
environment:
TOXENV: py37-core

py37-core_async:
<<: *common
docker:
- image: cimg/python:3.7
environment:
TOXENV: py37-core_async

py37-ens:
<<: *common
docker:
- image: cimg/python:3.7
environment:
TOXENV: py37-ens

py37-ensip15:
<<: *common
docker:
- image: cimg/python:3.7
environment:
TOXENV: py37-ensip15

py37-ethpm:
<<: *ethpm_steps
docker:
- image: cimg/python:3.7
environment:
TOXENV: py37-ethpm
# Please don't use this key for any shenanigans
WEB3_INFURA_PROJECT_ID: $WEB3_INFURA_PROJECT_ID

py37-integration-goethereum-ipc:
<<: *geth_steps
docker:
- image: cimg/python:3.7
environment:
TOXENV: py37-integration-goethereum-ipc

py37-integration-goethereum-ipc_flaky:
<<: *geth_steps
docker:
- image: cimg/python:3.7
environment:
TOXENV: py37-integration-goethereum-ipc_flaky

py37-integration-goethereum-http:
<<: *geth_steps
docker:
- image: cimg/python:3.7
environment:
TOXENV: py37-integration-goethereum-http

py37-integration-goethereum-http_async:
<<: *geth_steps
docker:
- image: cimg/python:3.7
environment:
TOXENV: py37-integration-goethereum-http_async

py37-integration-goethereum-http_async_flaky:
<<: *geth_steps
docker:
- image: cimg/python:3.7
environment:
TOXENV: py37-integration-goethereum-http_async_flaky

py37-integration-goethereum-http_flaky:
<<: *geth_steps
docker:
- image: cimg/python:3.7
environment:
TOXENV: py37-integration-goethereum-http_flaky

py37-integration-goethereum-ws:
<<: *geth_steps
docker:
- image: cimg/python:3.7
environment:
TOXENV: py37-integration-goethereum-ws

py37-integration-goethereum-ws_flaky:
<<: *geth_steps
docker:
- image: cimg/python:3.7
environment:
TOXENV: py37-integration-goethereum-ws_flaky

py37-integration-goethereum-ws-v2:
<<: *geth_steps
docker:
- image: cimg/python:3.7
environment:
TOXENV: py37-integration-goethereum-ws_v2

py37-integration-goethereum-ws-v2_flaky:
<<: *geth_steps
docker:
- image: cimg/python:3.7
environment:
TOXENV: py37-integration-goethereum-ws_v2_flaky

py37-integration-ethtester-pyevm:
<<: *common
docker:
- image: cimg/python:3.7
environment:
TOXENV: py37-integration-ethtester
ETHEREUM_TESTER_CHAIN_BACKEND: eth_tester.backends.PyEVMBackend

py37-integration-ethtester-pyevm_flaky:
<<: *common
docker:
- image: cimg/python:3.7
environment:
TOXENV: py37-integration-ethtester_flaky
ETHEREUM_TESTER_CHAIN_BACKEND: eth_tester.backends.PyEVMBackend

py37-wheel-cli:
<<: *common
docker:
- image: cimg/python:3.7
environment:
TOXENV: py37-wheel-cli

#
# Python 3.8
#
Expand Down Expand Up @@ -945,34 +811,16 @@ workflows:
test:
jobs:
# These are the longest running tests, start them first
- py37-core
- py38-core
- py39-core
- py310-core
- py311-core
- py37-core_async
- py38-core_async
- py39-core_async
- py310-core_async
- py311-core_async
- docs
- benchmark
- py37-ens
- py37-ensip15
- py37-ethpm
- py37-integration-goethereum-ipc
- py37-integration-goethereum-ipc_flaky
- py37-integration-goethereum-http
- py37-integration-goethereum-http_async
- py37-integration-goethereum-http_async_flaky
- py37-integration-goethereum-http_flaky
- py37-integration-goethereum-ws
- py37-integration-goethereum-ws_flaky
- py37-integration-goethereum-ws-v2
- py37-integration-goethereum-ws-v2_flaky
- py37-integration-ethtester-pyevm
- py37-integration-ethtester-pyevm_flaky
- py37-wheel-cli
- py38-lint
- py38-ens
- py38-ensip15
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

A Python library for interacting with Ethereum.

- Python 3.7.2+ support
- Python 3.8+ support

---

Expand Down
2 changes: 1 addition & 1 deletion docs/contributing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ You can use ``tox`` to run all the tests for a given version of Python:

.. code:: sh
$ tox -e py37-core
$ tox -e py38-core
Linting is also performed by the CI. You can save yourself some time by checking for
Expand Down
3 changes: 1 addition & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@
"websockets>=10.0.0",
"pyunormalize>=15.0.0",
],
python_requires=">=3.7.2",
python_requires=">=3.8",
extras_require=extras_require,
py_modules=["web3", "ens", "ethpm"],
entry_points={"pytest11": ["pytest_ethereum = web3.tools.pytest_ethereum.plugins"]},
Expand All @@ -99,7 +99,6 @@
"License :: OSI Approved :: MIT License",
"Natural Language :: English",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
Expand Down
27 changes: 3 additions & 24 deletions tests/core/providers/test_wsv2_provider.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
import asyncio
import json
import pytest
import sys
from unittest.mock import (
AsyncMock,
)

from eth_utils import (
to_bytes,
Expand All @@ -19,21 +21,10 @@


def _mock_ws(provider):
# move to top of file when python 3.7 is no longer supported in web3.py
from unittest.mock import (
AsyncMock,
)

provider._ws = AsyncMock()


@pytest.mark.asyncio
@pytest.mark.skipif(
# TODO: remove when python 3.7 is no longer supported in web3.py
# python 3.7 is already sunset so this feels like a reasonable tradeoff
sys.version_info < (3, 8),
reason="Uses AsyncMock, not supported by python 3.7",
)
async def test_async_make_request_caches_all_undesired_responses_and_returns_desired():
provider = WebsocketProviderV2("ws://mocked")

Expand Down Expand Up @@ -73,12 +64,6 @@ async def test_async_make_request_caches_all_undesired_responses_and_returns_des


@pytest.mark.asyncio
@pytest.mark.skipif(
# TODO: remove when python 3.7 is no longer supported in web3.py
# python 3.7 is already sunset so this feels like a reasonable tradeoff
sys.version_info < (3, 8),
reason="Uses AsyncMock, not supported by python 3.7",
)
async def test_async_make_request_returns_cached_response_with_no_recv_if_cached():
provider = WebsocketProviderV2("ws://mocked")

Expand All @@ -98,12 +83,6 @@ async def test_async_make_request_returns_cached_response_with_no_recv_if_cached


@pytest.mark.asyncio
@pytest.mark.skipif(
# TODO: remove when python 3.7 is no longer supported in web3.py
# python 3.7 is already sunset so this feels like a reasonable tradeoff
sys.version_info < (3, 8),
reason="Uses AsyncMock, not supported by python 3.7",
)
async def test_async_make_request_times_out_of_while_loop_looking_for_response():
timeout = 0.001
provider = WebsocketProviderV2("ws://mocked", request_timeout=timeout)
Expand Down
13 changes: 0 additions & 13 deletions tests/ens/test_ens.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import pytest
import sys
from unittest.mock import (
patch,
)
Expand Down Expand Up @@ -108,12 +107,6 @@ def test_ens_strict_bytes_type_checking_is_distinct_from_w3_instance(w3):
("get_text", ("tester.eth", "url")),
),
)
@pytest.mark.skipif(
# TODO: remove when python 3.7 is no longer supported in web3.py
# python 3.7 is already sunset so this feel like a reasonable tradeoff
sys.version_info < (3, 8),
reason="Mock args behave differently in python 3.7 but test should still pass.",
)
def test_ens_methods_normalize_name(
ens,
method_str,
Expand Down Expand Up @@ -238,12 +231,6 @@ def test_async_ens_strict_bytes_type_checking_is_distinct_from_w3_instance(
),
)
@pytest.mark.asyncio
@pytest.mark.skipif(
# TODO: remove when python 3.7 is no longer supported in web3.py
# python 3.7 is already sunset so this feel like a reasonable tradeoff
sys.version_info < (3, 8),
reason="Mock args behave differently in python 3.7 but test should still pass.",
)
async def test_async_ens_methods_normalize_name_with_ensip15(
async_ens,
method_str,
Expand Down
13 changes: 6 additions & 7 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
[tox]
envlist=
py{37,38,39,310,311}-ens
py{37,38,39,310,311}-ethpm
py{37,38,39,310,311}-core
py{37,38,39,310,311}-integration-{goethereum,ethtester}
py{38,39,310,311}-ens
py{38,39,310,311}-ethpm
py{38,39,310,311}-core
py{38,39,310,311}-integration-{goethereum,ethtester}
py{38,39,310,311}-lint
py{37,38,39,310,311}-wheel-cli
py{38,39,310,311}-wheel-cli
docs
benchmark

Expand Down Expand Up @@ -48,7 +48,6 @@ passenv =
WEB3_INFURA_API_SECRET
basepython =
docs: python3.9
py37: python3.7
py38: python3.8
py39: python3.9
py310: python3.10
Expand Down Expand Up @@ -78,7 +77,7 @@ commands=
python {toxinidir}/web3/tools/benchmark/main.py --num-calls 50
python {toxinidir}/web3/tools/benchmark/main.py --num-calls 100

[testenv:py{37,38,39,310,311}-wheel-cli]
[testenv:py{38,39,310,311}-wheel-cli]
deps=
wheel
build
Expand Down

0 comments on commit 1ee4312

Please sign in to comment.