diff --git a/boa/interpret.py b/boa/interpret.py index 9675bb2f..9d1f9a0d 100644 --- a/boa/interpret.py +++ b/boa/interpret.py @@ -8,6 +8,7 @@ import vvm import vyper +from vvm.exceptions import UnexpectedVersionError from vyper.cli.vyper_compile import get_search_paths from vyper.compiler.input_bundle import ( ABIInput, @@ -212,9 +213,13 @@ def loads_partial( if dedent: source_code = textwrap.dedent(source_code) - version = vvm.detect_vyper_version_from_source(source_code) - if version is not None and version != vyper.__version__: - return _loads_partial_vvm(source_code, version, filename) + try: + version = vvm.detect_vyper_version_from_source(source_code) + if str(version) != vyper.__version__: + return _loads_partial_vvm(source_code, version, filename) + except UnexpectedVersionError as e: + if e.args[0] != "No version detected in source code": + raise compiler_args = compiler_args or {} diff --git a/pyproject.toml b/pyproject.toml index fe86c392..3c79b22e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -15,7 +15,7 @@ classifiers = ["Topic :: Software Development"] # Requirements dependencies = [ - "vyper>=0.4.0", + "vyper>=0.4.0,<0.5.0", "eth-stdlib>=0.2.7,<0.3.0", "eth-abi", "py-evm>=0.10.0b4", @@ -25,7 +25,8 @@ dependencies = [ "pytest-cov", # required to compile older versions of vyper - "vvm>=0.2.2", +# "vvm>=0.3.1,<0.4.0", + "vvm @ git+https://github.com/DanielSchiavini/vvm.git@dependencies", # eth-rlp requirement, not installed by default with 3.12 "typing-extensions", diff --git a/tests/unitary/fixtures/module_contract.vy b/tests/unitary/fixtures/module_contract.vy index 886424db..45422642 100644 --- a/tests/unitary/fixtures/module_contract.vy +++ b/tests/unitary/fixtures/module_contract.vy @@ -1,4 +1,4 @@ -# pragma version ^0.4.0 +# pragma version >=0.4.0 import module_lib