diff --git a/ape_vyper/compiler.py b/ape_vyper/compiler.py index 6c72d4f..8632547 100644 --- a/ape_vyper/compiler.py +++ b/ape_vyper/compiler.py @@ -451,29 +451,41 @@ def _get_imports( local_prefix = None # TBD if (pm.path / f"{local_prefix_relative}{FileType.SOURCE}").is_file(): - # Local project import of a source file. + # Relative source. ext = FileType.SOURCE.value local_path = relative_path local_prefix = local_prefix_relative - elif (pm.path / f"{local_prefix_abs}{FileType.SOURCE}").is_file(): - # Dependency project import of a source file. - ext = FileType.SOURCE.value - local_path = abs_path - local_prefix = local_prefix_abs - elif (pm.path / f"{local_prefix_relative}{FileType.INTERFACE}").is_file(): - # Local project import of an interface file. + # Relative interface. ext = FileType.INTERFACE.value local_path = relative_path local_prefix = local_prefix_relative + elif (pm.path / f"{local_prefix_relative}.json").is_file(): + # Relative JSON interface. + ext = ".json" + local_path = relative_path + local_prefix = local_prefix_relative + + elif (pm.path / f"{local_prefix_abs}{FileType.SOURCE}").is_file(): + # Absolute source. + ext = FileType.SOURCE.value + local_path = abs_path + local_prefix = local_prefix_abs + elif (pm.path / f"{local_prefix_abs}{FileType.INTERFACE}").is_file(): - # Dependency project import of an interface file. + # Absolute interface. ext = FileType.INTERFACE.value local_path = abs_path local_prefix = local_prefix_abs + elif (pm.path / f"{local_prefix_abs}.json").is_file(): + # Absolute JSON interface. + ext = ".json" + local_path = abs_path + local_prefix = local_prefix_abs + else: # Must be an interface JSON specified in the input JSON. ext = ".json"