From a0c93465fe3dad8cf98c7377075daa566474a3dd Mon Sep 17 00:00:00 2001 From: Daniel Schiavini Date: Thu, 5 Sep 2024 20:46:08 +0200 Subject: [PATCH 01/16] Upgrade dependencies --- .github/workflows/main.yaml | 90 ++++++------------------------------- requirements-dev.txt | 23 +++++----- setup.py | 4 +- tests/conftest.py | 2 +- tox.ini | 4 +- 5 files changed, 31 insertions(+), 92 deletions(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index d4624c0..7f2c600 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -28,95 +28,33 @@ jobs: - name: Run Tox run: tox -e lint - py36: - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v2 - - - name: Setup Python 3.6 - uses: actions/setup-python@v2 - with: - python-version: 3.6 - - - name: Install Tox - run: pip install tox wheel - - - name: Run Tox - run: tox -e py36 - - - name: Upload coverage to Codecov - uses: codecov/codecov-action@v1 - with: - file: ./coverage.xml - fail_ci_if_error: true - - py37: - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v2 - - - name: Setup Python 3.7 - uses: actions/setup-python@v2 - with: - python-version: 3.7 - - - name: Install Tox - run: pip install tox wheel - - - name: Run Tox - run: tox -e py37 - - - name: Upload coverage to Codecov - uses: codecov/codecov-action@v1 - with: - file: ./coverage.xml - fail_ci_if_error: true - - py38: - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v2 - - - name: Setup Python 3.8 - uses: actions/setup-python@v2 - with: - python-version: 3.8 - - - name: Install Tox - run: pip install tox wheel - - - name: Run Tox - run: tox -e py38 - - - name: Upload coverage to Codecov - uses: codecov/codecov-action@v1 - with: - file: ./coverage.xml - fail_ci_if_error: true - - py39: - runs-on: ${{ matrix.os }} + test: strategy: fail-fast: false matrix: - os: [macos-latest, ubuntu-latest, windows-latest] + python-version: [["3.8", "38"], ["3.9", "39"], ["3.10", "310"], ["3.11", "311"], ["3.12", "312"]] + os: [ubuntu-latest] + include: + - os: macos-latest + python-version: [["3.11", "311"]] + - os: windows-latest + python-version: [["3.11", "311"]] + + runs-on: ${{ matrix.os }} steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - - name: Setup Python 3.9 + - name: Setup Python ${{ matrix.python-version[0] }} uses: actions/setup-python@v2 with: - python-version: 3.9 + python-version: ${{ matrix.python-version[0] }} - name: Install Tox run: pip install tox wheel - name: Run Tox - run: tox -e py39 + run: tox -e py${{ matrix.python-version[1] }} - name: Upload coverage to Codecov uses: codecov/codecov-action@v1 diff --git a/requirements-dev.txt b/requirements-dev.txt index 2ee9944..37dc8eb 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -1,11 +1,12 @@ -black==24.4.2 -bumpversion==0.5.3 -flake8==3.8.3 -isort==4.3.21 -mypy==0.982 -pytest>6.0.0,<7.0.0 -pytest-cov==2.10.1 -tox==3.18.0 -tqdm>=4.41.0,<5.0.0 -twine>=4.0.2,<5.0.0 -wheel>=0.35.1 +black>=24.8.0,<25.0.0 +bumpversion>=0.6.0,<1.0.0 +flake8>=7.1.1,<8.0.0 +isort>=5.13.2,<6.0.0 +mypy>=1.11.2,<2.0.0 +pytest>=8.3.2,<9.0.0 +pytest-cov>=5.0.0,<6.0.0 +tox>=4.18.0,<5.0.0 +tqdm>=4.66.5,<5.0.0 +twine>=5.1.1,<6.0.0 +wheel>=0.44.0,<1.0.0 +types-requests>2.32.0,<3.0.0 \ No newline at end of file diff --git a/setup.py b/setup.py index c8bb10a..fca6a1d 100644 --- a/setup.py +++ b/setup.py @@ -16,8 +16,8 @@ url="https://github.com/vyperlang/vvm", include_package_data=True, py_modules=["vvm"], - python_requires=">=3.6, <4", - install_requires=["requests>=2.19.0,<3", "packaging>=23.1,<24"], + python_requires=">=3.8, <4", + install_requires=["requests>=2.32.3,<3", "packaging>=24.1,<25"], license="MIT", zip_safe=False, keywords="ethereum vyper", diff --git a/tests/conftest.py b/tests/conftest.py index 098eec0..4bbe83d 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -1,8 +1,8 @@ #!/usr/bin/python3 import pytest -from requests import ConnectionError from packaging.version import Version +from requests import ConnectionError import vvm diff --git a/tox.ini b/tox.ini index 914ba79..bdfd043 100644 --- a/tox.ini +++ b/tox.ini @@ -15,5 +15,5 @@ extras=linter commands = black --check {toxinidir}/vvm {toxinidir}/tests flake8 {toxinidir}/vvm {toxinidir}/tests - isort --check-only --diff --recursive {toxinidir}/vvm {toxinidir}/tests - mypy --disallow-untyped-defs {toxinidir}/vvm + isort --check-only --diff {toxinidir}/vvm {toxinidir}/tests + mypy --disallow-untyped-defs {toxinidir}/vvm --implicit-optional From 5cec02d964c0fcca2d73933fb8af84feb0652274 Mon Sep 17 00:00:00 2001 From: Daniel Schiavini Date: Thu, 5 Sep 2024 20:53:06 +0200 Subject: [PATCH 02/16] Update tests for vyper 0.4 --- .github/workflows/main.yaml | 2 +- .gitignore | 3 +++ tests/conftest.py | 4 +++- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index 7f2c600..9bdc2fa 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -32,8 +32,8 @@ jobs: strategy: fail-fast: false matrix: - python-version: [["3.8", "38"], ["3.9", "39"], ["3.10", "310"], ["3.11", "311"], ["3.12", "312"]] os: [ubuntu-latest] + python-version: [["3.8", "38"], ["3.9", "39"], ["3.10", "310"], ["3.11", "311"], ["3.12", "312"]] include: - os: macos-latest python-version: [["3.11", "311"]] diff --git a/.gitignore b/.gitignore index b6e4761..bd6ad26 100644 --- a/.gitignore +++ b/.gitignore @@ -127,3 +127,6 @@ dmypy.json # Pyre type checker .pyre/ + +# PyCharm +.idea/ diff --git a/tests/conftest.py b/tests/conftest.py index 4bbe83d..0e39069 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -67,8 +67,10 @@ def all_versions(request): @pytest.fixture def foo_source(all_versions): visibility = "external" if all_versions >= Version("0.2.0") else "public" + interface = "IERC20" if all_versions >= Version("0.4.0a") else "ERC20" + import_path = "ethereum.ercs" if all_versions >= Version("0.4.0a") else "vyper.interfaces" yield f""" -from vyper.interfaces import ERC20 +from {import_path} import {interface} @{visibility} def foo() -> int128: From 964dde5308a33cd6a6eeace8490995cf6f4dd3bc Mon Sep 17 00:00:00 2001 From: Daniel Schiavini Date: Thu, 5 Sep 2024 20:56:00 +0200 Subject: [PATCH 03/16] Update python versions --- .github/workflows/main.yaml | 4 ++-- pyproject.toml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index 9bdc2fa..c3e0b30 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -36,9 +36,9 @@ jobs: python-version: [["3.8", "38"], ["3.9", "39"], ["3.10", "310"], ["3.11", "311"], ["3.12", "312"]] include: - os: macos-latest - python-version: [["3.11", "311"]] + python-version: ["3.11", "311"] - os: windows-latest - python-version: [["3.11", "311"]] + python-version: ["3.11", "311"] runs-on: ${{ matrix.os }} diff --git a/pyproject.toml b/pyproject.toml index e4603ae..6bd8c60 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.black] line-length = 100 -target-version = ['py36', 'py37', 'py38'] +target-version = ['py38', 'py39', 'py310', 'py311', 'py312'] include = '\.pyi?$' exclude = ''' /( From 01f9435d58a25d5d5c27d61992cd3fbd0a752b04 Mon Sep 17 00:00:00 2001 From: Daniel Schiavini Date: Thu, 5 Sep 2024 21:14:47 +0200 Subject: [PATCH 04/16] Exclude some beta versions from the test --- tests/test_compile_source.py | 9 +++++++-- tox.ini | 4 ++-- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/tests/test_compile_source.py b/tests/test_compile_source.py index c8f0cb5..a5da862 100644 --- a/tests/test_compile_source.py +++ b/tests/test_compile_source.py @@ -1,14 +1,19 @@ import pytest +from packaging.version import Version import vvm -def test_compile_source(foo_source): +def test_compile_source(foo_source, all_versions): + if Version("0.4.0b1") <= all_versions <= Version("0.4.0b5"): + raise pytest.skip("vyper 0.4.0b1 to 0.4.0b5 have a bug with combined_json") output = vvm.compile_source(foo_source) assert "" in output -def test_compile_files(foo_path): +def test_compile_files(foo_path, all_versions): + if Version("0.4.0b1") <= all_versions <= Version("0.4.0b5"): + raise pytest.skip("vyper 0.4.0b1 to 0.4.0b5 have a bug with combined_json") output = vvm.compile_files([foo_path]) assert foo_path.as_posix() in output diff --git a/tox.ini b/tox.ini index bdfd043..5960bc5 100644 --- a/tox.ini +++ b/tox.ini @@ -1,14 +1,14 @@ [tox] envlist = lint - py{36,37,38,39} + py{38,39,310,311,312} [testenv] passenv = GITHUB_TOKEN deps = -r{toxinidir}/requirements-dev.txt commands = - py{36,37,38,39}: python -m pytest tests/ + py{38,39,310,311,312}: python -m pytest tests/ [testenv:lint] extras=linter From b880037dd23cc918c6a0a27a2585a5fda7ffacdb Mon Sep 17 00:00:00 2001 From: Daniel Schiavini Date: Fri, 6 Sep 2024 15:08:58 +0200 Subject: [PATCH 05/16] Pin black because it can change the source --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index 37dc8eb..dab7795 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -1,4 +1,4 @@ -black>=24.8.0,<25.0.0 +black==24.8.0 bumpversion>=0.6.0,<1.0.0 flake8>=7.1.1,<8.0.0 isort>=5.13.2,<6.0.0 From a554a6d7d77849fe785018e1c78db696ce26c046 Mon Sep 17 00:00:00 2001 From: Daniel Schiavini Date: Fri, 6 Sep 2024 15:40:11 +0200 Subject: [PATCH 06/16] Try to work around windows issue --- .github/workflows/main.yaml | 4 +++- vvm/main.py | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index c3e0b30..932f273 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -55,9 +55,11 @@ jobs: - name: Run Tox run: tox -e py${{ matrix.python-version[1] }} + env: + VVM_BINARY_PATH: ${{ matrix.os == 'windows-latest' && 'C:\Users\RUNNER~1\AppData\Local\Temp' || '' }} - name: Upload coverage to Codecov uses: codecov/codecov-action@v1 with: file: ./coverage.xml - fail_ci_if_error: true + fail_ci_if_error: false diff --git a/vvm/main.py b/vvm/main.py index 8e6ea50..22b387c 100644 --- a/vvm/main.py +++ b/vvm/main.py @@ -1,6 +1,6 @@ import json import tempfile -from pathlib import Path +from pathlib import Path, WindowsPath from typing import Any, Dict, List, Optional, Union from packaging.version import Version From 0bf17c2d90bc82ee9937705f24d0ab7035b8f2f0 Mon Sep 17 00:00:00 2001 From: Daniel Schiavini Date: Fri, 6 Sep 2024 15:58:35 +0200 Subject: [PATCH 07/16] Update badge url See https://github.com/badges/shields/issues/8671 --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 936b11a..acf7e82 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # vvm -[![Pypi Status](https://img.shields.io/pypi/v/vvm.svg)](https://pypi.org/project/vvm/) [![Build Status](https://img.shields.io/github/workflow/status/vyperlang/vvm/vvm%20workflow)](https://github.com/vyperlang/vvm/actions) [![Coverage Status](https://img.shields.io/codecov/c/github/vyperlang/vvm)](https://codecov.io/gh/vyperlang/vvm) +[![Pypi Status](https://img.shields.io/pypi/v/vvm.svg)](https://pypi.org/project/vvm/) [![Build Status](https://img.shields.io/github/actions/workflow/status/vyperlang/vvm/main.yaml?branch=master)](https://github.com/vyperlang/vvm/actions) [![Coverage Status](https://img.shields.io/codecov/c/github/vyperlang/vvm)](https://codecov.io/gh/vyperlang/vvm) Vyper version management tool. From 44f116b85aeeb506fedaae7640e42f2bd343c4b6 Mon Sep 17 00:00:00 2001 From: Daniel Schiavini Date: Tue, 10 Sep 2024 15:29:04 +0200 Subject: [PATCH 08/16] Review comments --- .github/workflows/main.yaml | 2 ++ tests/test_compile_source.py | 4 ++-- vvm/main.py | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index 932f273..5a9efeb 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -56,10 +56,12 @@ jobs: - name: Run Tox run: tox -e py${{ matrix.python-version[1] }} env: + # work around https://github.com/vyperlang/vyper/issues/4227 VVM_BINARY_PATH: ${{ matrix.os == 'windows-latest' && 'C:\Users\RUNNER~1\AppData\Local\Temp' || '' }} - name: Upload coverage to Codecov uses: codecov/codecov-action@v1 with: file: ./coverage.xml + # for now not failing, this may be reverted once we set it up properly fail_ci_if_error: false diff --git a/tests/test_compile_source.py b/tests/test_compile_source.py index a5da862..ff7f400 100644 --- a/tests/test_compile_source.py +++ b/tests/test_compile_source.py @@ -6,14 +6,14 @@ def test_compile_source(foo_source, all_versions): if Version("0.4.0b1") <= all_versions <= Version("0.4.0b5"): - raise pytest.skip("vyper 0.4.0b1 to 0.4.0b5 have a bug with combined_json") + pytest.skip("vyper 0.4.0b1 to 0.4.0b5 have a bug with combined_json") output = vvm.compile_source(foo_source) assert "" in output def test_compile_files(foo_path, all_versions): if Version("0.4.0b1") <= all_versions <= Version("0.4.0b5"): - raise pytest.skip("vyper 0.4.0b1 to 0.4.0b5 have a bug with combined_json") + pytest.skip("vyper 0.4.0b1 to 0.4.0b5 have a bug with combined_json") output = vvm.compile_files([foo_path]) assert foo_path.as_posix() in output diff --git a/vvm/main.py b/vvm/main.py index 22b387c..8e6ea50 100644 --- a/vvm/main.py +++ b/vvm/main.py @@ -1,6 +1,6 @@ import json import tempfile -from pathlib import Path, WindowsPath +from pathlib import Path from typing import Any, Dict, List, Optional, Union from packaging.version import Version From b8d94d3f45fa47072aff4e56c2ad1fe070f8a6a2 Mon Sep 17 00:00:00 2001 From: Daniel Schiavini Date: Tue, 10 Sep 2024 15:31:08 +0200 Subject: [PATCH 09/16] Update changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8c0650f..5e1fb8c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased](https://github.com/vyperlang/vvm/) ### Changed - Update contact information in `CONTRIBUTING.md` +- Update dependencies. Minimum python version is now 3.8 ([#22](https://github.com/vyperlang/vvm/pull/22)) ## [0.1.0](https://github.com/vyperlang/vvm/tree/v0.1.0) - 2020-10-07 ### Added From 0af8c2bace761d9b22e9aa8c4a71881997b3a0a9 Mon Sep 17 00:00:00 2001 From: Daniel Schiavini Date: Tue, 10 Sep 2024 17:57:26 +0200 Subject: [PATCH 10/16] Pass base_path as cwd to vyper wrapper --- .github/workflows/main.yaml | 3 --- vvm/main.py | 6 ++++-- vvm/wrapper.py | 4 ++++ 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index 5a9efeb..48f172b 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -55,9 +55,6 @@ jobs: - name: Run Tox run: tox -e py${{ matrix.python-version[1] }} - env: - # work around https://github.com/vyperlang/vyper/issues/4227 - VVM_BINARY_PATH: ${{ matrix.os == 'windows-latest' && 'C:\Users\RUNNER~1\AppData\Local\Temp' || '' }} - name: Upload coverage to Codecov uses: codecov/codecov-action@v1 diff --git a/vvm/main.py b/vvm/main.py index 8e6ea50..90de049 100644 --- a/vvm/main.py +++ b/vvm/main.py @@ -126,7 +126,8 @@ def _compile( vyper_binary = get_executable(vyper_version) stdoutdata, stderrdata, command, proc = wrapper.vyper_wrapper( - vyper_binary=vyper_binary, f="combined_json", p=base_path, **kwargs + vyper_binary=vyper_binary, f="combined_json", p=base_path, + cwd=base_path,**kwargs ) return json.loads(stdoutdata) @@ -167,7 +168,8 @@ def compile_standard( vyper_binary = get_executable(vyper_version) stdoutdata, stderrdata, command, proc = wrapper.vyper_wrapper( - vyper_binary=vyper_binary, stdin=json.dumps(input_data), standard_json=True, p=base_path + vyper_binary=vyper_binary, stdin=json.dumps(input_data), standard_json=True, p=base_path, + cwd=base_path ) compiler_output = json.loads(stdoutdata) diff --git a/vvm/wrapper.py b/vvm/wrapper.py index e809374..fd849ea 100644 --- a/vvm/wrapper.py +++ b/vvm/wrapper.py @@ -40,6 +40,7 @@ def vyper_wrapper( stdin: str = None, source_files: Union[List, Path, str] = None, success_return_code: int = 0, + cwd: Union[Path, str] = None, **kwargs: Any, ) -> Tuple[str, str, List, subprocess.Popen]: """ @@ -55,6 +56,8 @@ def vyper_wrapper( Path or list of paths of source files to compile success_return_code : int, optional Expected exit code. Raises `VyperError` if the process returns a different value. + cwd : Path | str, optional + Working directory to use for the `vyper` process. Keyword Arguments ----------------- @@ -117,6 +120,7 @@ def vyper_wrapper( stdout=subprocess.PIPE, stderr=subprocess.PIPE, encoding="utf8", + cwd=cwd, ) stdoutdata, stderrdata = proc.communicate(stdin) From 23672f0b0e92c156762b642257135a2cde464dfd Mon Sep 17 00:00:00 2001 From: Daniel Schiavini Date: Tue, 10 Sep 2024 17:58:07 +0200 Subject: [PATCH 11/16] Linting --- vvm/main.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/vvm/main.py b/vvm/main.py index 90de049..9fd4713 100644 --- a/vvm/main.py +++ b/vvm/main.py @@ -126,8 +126,7 @@ def _compile( vyper_binary = get_executable(vyper_version) stdoutdata, stderrdata, command, proc = wrapper.vyper_wrapper( - vyper_binary=vyper_binary, f="combined_json", p=base_path, - cwd=base_path,**kwargs + vyper_binary=vyper_binary, f="combined_json", p=base_path, cwd=base_path, **kwargs ) return json.loads(stdoutdata) @@ -168,8 +167,11 @@ def compile_standard( vyper_binary = get_executable(vyper_version) stdoutdata, stderrdata, command, proc = wrapper.vyper_wrapper( - vyper_binary=vyper_binary, stdin=json.dumps(input_data), standard_json=True, p=base_path, - cwd=base_path + vyper_binary=vyper_binary, + stdin=json.dumps(input_data), + standard_json=True, + p=base_path, + cwd=base_path, ) compiler_output = json.loads(stdoutdata) From 74069d4b19dc387c997ad7ac8a559e4334fcff62 Mon Sep 17 00:00:00 2001 From: Daniel Schiavini Date: Tue, 10 Sep 2024 18:10:01 +0200 Subject: [PATCH 12/16] Pass base_path when compiling from source --- vvm/main.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vvm/main.py b/vvm/main.py index 9fd4713..f3fb7f3 100644 --- a/vvm/main.py +++ b/vvm/main.py @@ -65,7 +65,7 @@ def compile_source( vyper_binary=vyper_binary, vyper_version=vyper_version, source_files=[source_path], - base_path=base_path, + base_path=base_path or Path(source_path).parent, evm_version=evm_version, ) From 4a147ebba40c7f371da1f1fdec69722ae9f31775 Mon Sep 17 00:00:00 2001 From: Daniel Schiavini Date: Tue, 10 Sep 2024 18:15:15 +0200 Subject: [PATCH 13/16] Revert "Pass base_path when compiling from source" This reverts commit 74069d4b19dc387c997ad7ac8a559e4334fcff62. --- vvm/main.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vvm/main.py b/vvm/main.py index f3fb7f3..9fd4713 100644 --- a/vvm/main.py +++ b/vvm/main.py @@ -65,7 +65,7 @@ def compile_source( vyper_binary=vyper_binary, vyper_version=vyper_version, source_files=[source_path], - base_path=base_path or Path(source_path).parent, + base_path=base_path, evm_version=evm_version, ) From 7aebaf5ac4ae02a8c4a212ee498084cf328ef192 Mon Sep 17 00:00:00 2001 From: Daniel Schiavini Date: Tue, 10 Sep 2024 18:15:35 +0200 Subject: [PATCH 14/16] Revert "Pass base_path as cwd to vyper wrapper" This reverts commit 0af8c2ba --- .github/workflows/main.yaml | 3 +++ vvm/main.py | 8 ++------ vvm/wrapper.py | 4 ---- 3 files changed, 5 insertions(+), 10 deletions(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index 48f172b..5a9efeb 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -55,6 +55,9 @@ jobs: - name: Run Tox run: tox -e py${{ matrix.python-version[1] }} + env: + # work around https://github.com/vyperlang/vyper/issues/4227 + VVM_BINARY_PATH: ${{ matrix.os == 'windows-latest' && 'C:\Users\RUNNER~1\AppData\Local\Temp' || '' }} - name: Upload coverage to Codecov uses: codecov/codecov-action@v1 diff --git a/vvm/main.py b/vvm/main.py index 9fd4713..ecbe53c 100644 --- a/vvm/main.py +++ b/vvm/main.py @@ -126,7 +126,7 @@ def _compile( vyper_binary = get_executable(vyper_version) stdoutdata, stderrdata, command, proc = wrapper.vyper_wrapper( - vyper_binary=vyper_binary, f="combined_json", p=base_path, cwd=base_path, **kwargs + vyper_binary=vyper_binary, f="combined_json", p=base_path, **kwargs ) return json.loads(stdoutdata) @@ -167,11 +167,7 @@ def compile_standard( vyper_binary = get_executable(vyper_version) stdoutdata, stderrdata, command, proc = wrapper.vyper_wrapper( - vyper_binary=vyper_binary, - stdin=json.dumps(input_data), - standard_json=True, - p=base_path, - cwd=base_path, + vyper_binary=vyper_binary, stdin=json.dumps(input_data), standard_json=True, p=base_path ) compiler_output = json.loads(stdoutdata) diff --git a/vvm/wrapper.py b/vvm/wrapper.py index fd849ea..e809374 100644 --- a/vvm/wrapper.py +++ b/vvm/wrapper.py @@ -40,7 +40,6 @@ def vyper_wrapper( stdin: str = None, source_files: Union[List, Path, str] = None, success_return_code: int = 0, - cwd: Union[Path, str] = None, **kwargs: Any, ) -> Tuple[str, str, List, subprocess.Popen]: """ @@ -56,8 +55,6 @@ def vyper_wrapper( Path or list of paths of source files to compile success_return_code : int, optional Expected exit code. Raises `VyperError` if the process returns a different value. - cwd : Path | str, optional - Working directory to use for the `vyper` process. Keyword Arguments ----------------- @@ -120,7 +117,6 @@ def vyper_wrapper( stdout=subprocess.PIPE, stderr=subprocess.PIPE, encoding="utf8", - cwd=cwd, ) stdoutdata, stderrdata = proc.communicate(stdin) From a2b16777eee4653dacaae44b9a0422ad624313b1 Mon Sep 17 00:00:00 2001 From: Daniel Schiavini Date: Tue, 10 Sep 2024 18:17:05 +0200 Subject: [PATCH 15/16] Linting --- vvm/main.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vvm/main.py b/vvm/main.py index ecbe53c..8e6ea50 100644 --- a/vvm/main.py +++ b/vvm/main.py @@ -126,7 +126,7 @@ def _compile( vyper_binary = get_executable(vyper_version) stdoutdata, stderrdata, command, proc = wrapper.vyper_wrapper( - vyper_binary=vyper_binary, f="combined_json", p=base_path, **kwargs + vyper_binary=vyper_binary, f="combined_json", p=base_path, **kwargs ) return json.loads(stdoutdata) From 622617ecd68a71e3269d3d104625966148022418 Mon Sep 17 00:00:00 2001 From: Daniel Schiavini Date: Tue, 10 Sep 2024 18:18:55 +0200 Subject: [PATCH 16/16] Update .github/workflows/main.yaml Co-authored-by: Charles Cooper --- .github/workflows/main.yaml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index 5a9efeb..48f172b 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -55,9 +55,6 @@ jobs: - name: Run Tox run: tox -e py${{ matrix.python-version[1] }} - env: - # work around https://github.com/vyperlang/vyper/issues/4227 - VVM_BINARY_PATH: ${{ matrix.os == 'windows-latest' && 'C:\Users\RUNNER~1\AppData\Local\Temp' || '' }} - name: Upload coverage to Codecov uses: codecov/codecov-action@v1