diff --git a/ape_vyper/compiler/api.py b/ape_vyper/compiler/api.py index a903d4d..f69936e 100644 --- a/ape_vyper/compiler/api.py +++ b/ape_vyper/compiler/api.py @@ -83,11 +83,10 @@ def get_imports( project: Optional[ProjectManager] = None, ) -> dict[str, list[str]]: pm = project or self.local_project - imports = self._import_resolver.get_imports(pm, contract_filepaths, use_cache=False) + imports = self._import_resolver.get_imports(pm, contract_filepaths) return { f"{get_relative_path(p.absolute(), pm.path)}": [imp.source_id for imp in import_ls] for p, import_ls in imports.items() - if p in contract_filepaths } def get_versions(self, all_paths: Iterable[Path]) -> set[str]: @@ -260,7 +259,7 @@ def _compile( ): pm = project or self.local_project contract_types: list[ContractType] = [] - import_map = self._import_resolver.get_imports(pm, contract_filepaths, use_cache=False) + import_map = self._import_resolver.get_imports(pm, contract_filepaths) config = self.get_config(pm) version_map = self._get_version_map_from_import_map( contract_filepaths, @@ -388,7 +387,7 @@ def get_version_map( ) -> dict[Version, set[Path]]: pm = project or self.local_project paths = [p for p in contract_filepaths] - import_map = self._import_resolver.get_imports(pm, paths, use_cache=False) + import_map = self._import_resolver.get_imports(pm, paths) return self._get_version_map_from_import_map(paths, import_map, project=pm) def _get_version_map_from_import_map( diff --git a/ape_vyper/imports.py b/ape_vyper/imports.py index 276c604..167deb8 100644 --- a/ape_vyper/imports.py +++ b/ape_vyper/imports.py @@ -328,14 +328,9 @@ class ImportResolver(ManagerAccessMixin): _projects: dict[str, ImportMap] = {} _dependency_attempted_compile: set[str] = set() - def get_imports( - self, - project: ProjectManager, - contract_filepaths: Iterable[Path], - use_cache: bool = True, - ) -> ImportMap: + def get_imports(self, project: ProjectManager, contract_filepaths: Iterable[Path]) -> ImportMap: paths = list(contract_filepaths) - if project.project_id not in self._projects or not use_cache: + if project.project_id not in self._projects: self._projects[project.project_id] = ImportMap(project, paths) return self._get_imports(paths, project)