Skip to content

Commit

Permalink
fix: order
Browse files Browse the repository at this point in the history
  • Loading branch information
antazoey committed Jul 23, 2024
1 parent c7dea80 commit 78a0263
Showing 1 changed file with 21 additions and 9 deletions.
30 changes: 21 additions & 9 deletions ape_vyper/compiler.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit 78a0263

Please sign in to comment.