77
88from abc import ABC , abstractmethod
99from functools import lru_cache
10- from typing import Any , Dict , List , Optional , Tuple
10+ from typing import Any
1111
1212import requests
1313from packaging .version import Version
@@ -44,7 +44,7 @@ def list_url(self) -> str:
4444 pass
4545
4646 @lru_cache (maxsize = 5 ) # noqa: B019
47- def _fetch_list_json (self ) -> Dict [str , Any ]:
47+ def _fetch_list_json (self ) -> dict [str , Any ]:
4848 """Fetch and cache the list.json data from the repository.
4949
5050 Returns:
@@ -56,7 +56,7 @@ def _fetch_list_json(self) -> Dict[str, Any]:
5656
5757 @property
5858 @lru_cache (maxsize = 5 ) # noqa: B019
59- def available_versions (self ) -> Dict [str , str ]:
59+ def available_versions (self ) -> dict [str , str ]:
6060 """Get available versions as a dict of version -> artifact_filename."""
6161 list_data = self ._fetch_list_json ()
6262 all_releases = list_data ["releases" ]
@@ -77,7 +77,7 @@ def latest_version(self) -> SolcVersion:
7777 version_objs = [SolcVersion .parse (v ) for v in versions ]
7878 return max (version_objs )
7979
80- def _filter_versions (self , releases : Dict [str , str ]) -> Dict [str , str ]:
80+ def _filter_versions (self , releases : dict [str , str ]) -> dict [str , str ]:
8181 """Filter versions based on repository-specific criteria.
8282
8383 Override this method to apply custom filtering logic.
@@ -89,7 +89,7 @@ def get_download_url(self, version: SolcVersion, artifact_filename: str) -> str:
8989 """Get the download URL for a specific version."""
9090 return f"{ self .base_url } { artifact_filename } "
9191
92- def get_checksums (self , version : SolcVersion ) -> Tuple [str , Optional [ str ] ]:
92+ def get_checksums (self , version : SolcVersion ) -> tuple [str , str | None ]:
9393 """Get SHA256 and optional Keccak256 checksums for a version."""
9494 list_data = self ._fetch_list_json ()
9595 builds = list_data ["builds" ]
@@ -191,7 +191,7 @@ def base_url(self) -> str:
191191 def list_url (self ) -> str :
192192 return ALLOY_SOLC_JSON
193193
194- def _filter_versions (self , releases : Dict [str , str ]) -> Dict [str , str ]:
194+ def _filter_versions (self , releases : dict [str , str ]) -> dict [str , str ]:
195195 """Filter to only include versions in the supported ARM64 range."""
196196 min_version = Version (ALLOY_ARM64_MIN_VERSION )
197197 max_version = Version (ALLOY_ARM64_MAX_VERSION )
@@ -219,7 +219,7 @@ class CompositeRepository:
219219
220220 def __init__ (self , platform : Platform , session : requests .Session ):
221221 self .platform = platform
222- self .repositories : List [AbstractSolcRepository ] = []
222+ self .repositories : list [AbstractSolcRepository ] = []
223223
224224 # Always include the main soliditylang repository
225225 self .repositories .append (SoliditylangRepository (platform , session ))
@@ -233,7 +233,7 @@ def __init__(self, platform: Platform, session: requests.Session):
233233
234234 @property
235235 @lru_cache (maxsize = 5 ) # noqa: B019
236- def available_versions (self ) -> Dict [str , str ]:
236+ def available_versions (self ) -> dict [str , str ]:
237237 """Get all available versions from all repositories."""
238238 all_versions = {}
239239
0 commit comments