diff --git a/.circleci/config.yml b/.circleci/config.yml index 8ca76b3632..2def3efa4c 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -11,6 +11,10 @@ parameters: type: string common: &common + parameters: + python_exec: + type: string + default: "python" working_directory: ~/repo steps: - checkout @@ -28,6 +32,38 @@ common: &common - restore_cache: keys: - cache-v1-{{ arch }}-{{ .Environment.CIRCLE_JOB }}-{{ checksum "setup.py" }}-{{ checksum "tox.ini" }} + - run: + name: install pypy3 if python_exec is pypy3 + command: | + if [ "<< parameters.python_exec >>" == "pypy3" ]; then + sudo apt-get update + + # If .pyenv already exists, remove and reinstall to get latest version + if [ -d "$HOME/.pyenv" ]; then + echo "Removing existing .pyenv directory..." + rm -rf $HOME/.pyenv + fi + curl https://pyenv.run | bash + export PATH="$HOME/.pyenv/bin:$PATH" + eval "$(pyenv init --path)" + eval "$(pyenv init -)" + eval "$(pyenv virtualenv-init -)" + + # Find the latest PyPy version matching the python minor version + latest_pypy_version=$(pyenv install --list | grep -E "pypy3\.<< parameters.python_minor_version >>" | grep -v "\-src" | tail -1 | tr -d ' ') + echo "Latest PyPy version: $latest_pypy_version" + + # Install the latest PyPy 3.10 version using pyenv if not already installed + pyenv install "$latest_pypy_version" + pyenv global "$latest_pypy_version" + + # Verify the correct PyPy version is being used + pypy3 --version + + # Install pip using the newly installed PyPy version + curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py + pypy3 get-pip.py + fi - run: name: install dependencies command: | @@ -36,7 +72,7 @@ common: &common python web3/scripts/install_pre_releases.py - run: name: run tox - command: python -m tox run -r + command: << parameters.python_exec >> -m tox -r - save_cache: paths: - .hypothesis @@ -145,12 +181,30 @@ jobs: type: string tox_env: type: string + python_exec: + type: string + default: "python" <<: *common docker: - image: cimg/python:3.<< parameters.python_minor_version >> environment: TOXENV: py3<< parameters.python_minor_version >>-<< parameters.tox_env >> + common-pypy: + parameters: + python_minor_version: + type: string + tox_env: + type: string + python_exec: + type: string + default: "pypy3" + <<: *common + docker: + - image: cimg/python:3.<< parameters.python_minor_version >> + environment: + TOXENV: pypy3<< parameters.python_minor_version >>-<< parameters.tox_env >> + geth: parameters: python_minor_version: @@ -228,13 +282,44 @@ workflows: python_minor_version: ["8", "9", "10", "11", "12"] tox_env: [ "lint", - "core", - "core_async", - "ens", + "core-pyevm", + "core-pyevm_async", + "ens-pyevm", "ensip15", "wheel" ] + python_exec: "python" name: "py3<< matrix.python_minor_version >>-<< matrix.tox_env >>" + - common: + matrix: + parameters: + # eels only supports 3.10 and above + python_minor_version: ["10", "11", "12"] + tox_env: [ + "core-eels", + "core-eels_async", + "ens-eels", + "integration-ethtester-eels" + ] + python_exec: "python" + name: "py3<< matrix.python_minor_version >>-<< matrix.tox_env >>" + - common-pypy: + matrix: + parameters: + # eels only supports 3.10 and above; pyenv only has pypy3.10 available + python_minor_version: ["10"] + tox_env: [ + "core-eels", + "core-eels_async", + "ens-eels", + "integration-ethtester-eels", + "core-pyevm", + "core-pyevm_async", + "ens-pyevm", + "integration-ethtester-pyevm" + ] + python_exec: "pypy3" + name: "pypy3<< matrix.python_minor_version >>-<< matrix.tox_env >>" - geth: matrix: parameters: @@ -246,7 +331,7 @@ workflows: "integration-goethereum-http_async", "integration-goethereum-legacy_ws", "integration-goethereum-ws", - "integration-ethtester" + "integration-ethtester-pyevm" ] name: "py3<< matrix.python_minor_version >>-<< matrix.tox_env >>" - docs: @@ -260,7 +345,6 @@ workflows: python_minor_version: ["10", "11", "12"] name: "py3<< matrix.python_minor_version >>-windows-wheel" - nightly: triggers: - schedule: diff --git a/setup.py b/setup.py index 23cf7781c9..a9260e28d7 100644 --- a/setup.py +++ b/setup.py @@ -31,6 +31,10 @@ "towncrier>=21,<22", ], "test": [ + # Note: ethereum-maintained libraries in this list should be added to the + # `install_pre_releases.py` script. + "eth-tester[py-evm]>=0.11.0b1,<0.13.0b1", + "py-geth>=5.0.0", "pytest-asyncio>=0.18.1,<0.23", "pytest-mock>=1.10", "pytest-xdist>=2.4.0", diff --git a/tox.ini b/tox.ini index 781be0fb14..e8af27fe42 100644 --- a/tox.ini +++ b/tox.ini @@ -1,9 +1,10 @@ [tox] envlist= - py{38,39,310,311,312}-{ens,core,lint,wheel}-pyevm - py{310,311,312}-{ens,core}-eels - py{38,39,310,311,312}-integration-{goethereum,ethtester} + py{py}{38,39,310,311,312}-{ens,core}-pyevm + py{py}{310,311,312}-{ens,core}-eels + py{38,39,310,311,312}-integration-{goethereum,ethtester-pyevm} py{310,311,312}-integration-ethtester-eels + py{38,39,310,311,312}-{lint,wheel} docs benchmark windows-wheel diff --git a/web3/_utils/module.py b/web3/_utils/module.py index 63fc151232..bf32e0cdfa 100644 --- a/web3/_utils/module.py +++ b/web3/_utils/module.py @@ -27,7 +27,10 @@ def _validate_init_params_and_return_if_found(module_class: Any) -> List[str]: init_params_raw = list(inspect.signature(module_class.__init__).parameters) module_init_params = [ - param for param in init_params_raw if param not in ["self", "args", "kwargs"] + param + for param in init_params_raw + # pypy uses `obj` and `keywords` instead of `self` and `kwargs`, respectively + if param not in ["self", "obj", "args", "kwargs", "keywords"] ] if len(module_init_params) > 1: