Skip to content

Commit

Permalink
fix: types
Browse files Browse the repository at this point in the history
  • Loading branch information
antazoey committed Dec 18, 2023
1 parent 31510c8 commit 4baa140
Showing 1 changed file with 6 additions and 16 deletions.
22 changes: 6 additions & 16 deletions ape_vyper/compiler.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,9 @@ def get_optimization_pragma(source: Union[str, Path]) -> Optional[str]:
return pragma_match.groups()[0]


def get_optimization_pragma_map(contract_filepaths: List[Path]) -> Dict[Optimization, Set[Path]]:
def get_optimization_pragma_map(
contract_filepaths: Sequence[Path],
) -> Dict[Optimization, Set[Path]]:
optimization_pragma_map: Dict[Optimization, Set[Path]] = {}
for path in contract_filepaths:
pragma = get_optimization_pragma(path) or True
Expand All @@ -166,7 +168,7 @@ def evm_version(self) -> Optional[str]:
return self.settings.evm_version

def get_imports(
self, contract_filepaths: List[Path], base_path: Optional[Path] = None
self, contract_filepaths: Sequence[Path], base_path: Optional[Path] = None
) -> Dict[str, List[str]]:
base_path = (base_path or self.project_manager.contracts_folder).absolute()
import_map = {}
Expand Down Expand Up @@ -494,20 +496,8 @@ def compile_code(self, code: str, base_path: Optional[Path] = None, **kwargs) ->
**kwargs,
)

def get_optimization_pragma_map(
self, contract_filepaths: List[Path]
) -> Dict[Optimization, Set[Path]]:
optimization_pragma_map: Dict[Optimization, Set[Path]] = {}
for path in contract_filepaths:
pragma = get_optimization_pragma(path) or True
if pragma not in optimization_pragma_map:
optimization_pragma_map[pragma] = set()
optimization_pragma_map[pragma].add(path)

return optimization_pragma_map

def get_version_map(
self, contract_filepaths: List[Path], base_path: Optional[Path] = None
self, contract_filepaths: Sequence[Path], base_path: Optional[Path] = None
) -> Dict[Version, Set[Path]]:
version_map: Dict[Version, Set[Path]] = {}
source_path_by_version_spec: Dict[SpecifierSet, Set[Path]] = {}
Expand Down Expand Up @@ -569,7 +559,7 @@ def get_version_map(
return version_map

def get_compiler_settings(
self, contract_filepaths: List[Path], base_path: Optional[Path] = None
self, contract_filepaths: Sequence[Path], base_path: Optional[Path] = None
) -> Dict[Version, Dict]:
valid_paths = [p for p in contract_filepaths if p.suffix == ".vy"]
contracts_path = base_path or self.config_manager.contracts_folder
Expand Down

0 comments on commit 4baa140

Please sign in to comment.