Skip to content

Commit

Permalink
Use vvm from vyperlang/vvm#26
Browse files Browse the repository at this point in the history
  • Loading branch information
DanielSchiavini committed Sep 18, 2024
1 parent 37cf4eb commit b375574
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 6 deletions.
11 changes: 8 additions & 3 deletions boa/interpret.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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 {}

Expand Down
5 changes: 3 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion tests/unitary/fixtures/module_contract.vy
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# pragma version ^0.4.0
# pragma version >=0.4.0

import module_lib

Expand Down

0 comments on commit b375574

Please sign in to comment.