diff --git a/ape_vyper/compiler.py b/ape_vyper/compiler.py index 047e4c07..21ae1b37 100644 --- a/ape_vyper/compiler.py +++ b/ape_vyper/compiler.py @@ -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 @@ -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 = {} @@ -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]] = {} @@ -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