diff --git a/boa/interpret.py b/boa/interpret.py index f35c74cb..cf0fc71b 100644 --- a/boa/interpret.py +++ b/boa/interpret.py @@ -8,7 +8,7 @@ import vvm import vyper -from vvm.exceptions import UnexpectedVersionError +from packaging.version import Version from vyper.cli.vyper_compile import get_search_paths from vyper.compiler.input_bundle import ( ABIInput, @@ -214,14 +214,10 @@ def loads_partial( if dedent: source_code = textwrap.dedent(source_code) - try: - version = vvm.detect_vyper_version_from_source(source_code) - if str(version) != vyper.__version__: - # TODO: pass name to loads_partial_vvm, not filename - return _loads_partial_vvm(source_code, version, filename) - except UnexpectedVersionError as e: - if e.args[0] != "No version detected in source code": - raise + version = vvm.detect_vyper_version_from_source(source_code) + if version is not None and version != Version(vyper.__version__): + # TODO: pass name to loads_partial_vvm, not filename + return _loads_partial_vvm(source_code, str(version), filename) compiler_args = compiler_args or {} diff --git a/pyproject.toml b/pyproject.toml index 3c79b22e..b7a93bf9 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -25,8 +25,7 @@ dependencies = [ "pytest-cov", # required to compile older versions of vyper -# "vvm>=0.3.1,<0.4.0", - "vvm @ git+https://github.com/DanielSchiavini/vvm.git@dependencies", + "vvm>=0.3.1,<0.4.0", # eth-rlp requirement, not installed by default with 3.12 "typing-extensions",