Skip to content

Commit

Permalink
fix: revert search path changes
Browse files Browse the repository at this point in the history
  • Loading branch information
DanielSchiavini committed Oct 7, 2024
1 parent dcfe941 commit 23ed6ec
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 12 deletions.
13 changes: 11 additions & 2 deletions boa/interpret.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,20 @@
from boa.rpc import json
from boa.util import cached_vvm
from boa.util.abi import Address
from boa.util.disk_cache import get_disk_cache, get_search_path
from boa.util.disk_cache import get_disk_cache

if TYPE_CHECKING:
from vyper.semantics.analysis.base import ImportInfo

_Contract = Union[VyperContract, VyperBlueprint]

_search_path = None


def set_search_path(path: list[str]):
global _search_path
_search_path = path


class BoaImporter(MetaPathFinder):
def find_spec(self, fullname, path, target=None):
Expand Down Expand Up @@ -106,14 +113,16 @@ def get_module_fingerprint(
def compiler_data(
source_code: str, contract_name: str, filename: str | Path, deployer=None, **kwargs
) -> CompilerData:
global _search_path

path = Path(contract_name)
resolved_path = Path(filename).resolve(strict=False)

file_input = FileInput(
contents=source_code, source_id=-1, path=path, resolved_path=resolved_path
)

search_paths = get_search_paths(get_search_path())
search_paths = get_search_paths(_search_path)
input_bundle = FilesystemInputBundle(search_paths)

settings = Settings(**kwargs)
Expand Down
10 changes: 0 additions & 10 deletions boa/util/disk_cache.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,16 +83,6 @@ def caching_lookup(self, string, func):


_disk_cache = None
_search_path = None


def get_search_path() -> Optional[list[str]]:
return _search_path


def set_search_path(path: list[str]):
global _search_path
_search_path = path


def get_disk_cache() -> Optional[DiskCache]:
Expand Down

0 comments on commit 23ed6ec

Please sign in to comment.