Skip to content

Commit

Permalink
feat: better matching for import remappings
Browse files Browse the repository at this point in the history
  • Loading branch information
bitwise-constructs committed Jan 24, 2025
1 parent 18ff026 commit f368a21
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion ape_solidity/_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,8 @@ def _resolve_import_remapping(self, project: "ProjectManager"):
# Get all matches.
valid_matches: list[tuple[str, str]] = []
for check_remap_key, check_remap_value in import_remapping.items():
if check_remap_key not in self.value:
# Match with a trailing slash to avoid partial matches.
if f"{check_remap_key}/" not in self.value:
continue

valid_matches.append((check_remap_key, check_remap_value))
Expand Down
2 changes: 1 addition & 1 deletion ape_solidity/compiler.py
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ def available_versions(self) -> list[Version]:
@property
def installed_versions(self) -> list[Version]:
"""
Returns a lis of installed version WITHOUT their
Returns a list of installed versions WITHOUT their
commit hashes.
"""
return get_installed_solc_versions()
Expand Down

0 comments on commit f368a21

Please sign in to comment.