2121_osx_arch_pat = re .compile (r"(.+)_(\d+)_(\d+)_(.+)" )
2222
2323
24- def version_info_to_nodot (version_info ):
25- # type: (Tuple[int, ...]) -> str
24+ def version_info_to_nodot (version_info : Tuple [int , ...]) -> str :
2625 # Only use up to the first two numbers.
2726 return "" .join (map (str , version_info [:2 ]))
2827
2928
30- def _mac_platforms (arch ):
31- # type: (str) -> List[str]
29+ def _mac_platforms (arch : str ) -> List [str ]:
3230 match = _osx_arch_pat .match (arch )
3331 if match :
3432 name , major , minor , actual_arch = match .groups ()
@@ -48,8 +46,7 @@ def _mac_platforms(arch):
4846 return arches
4947
5048
51- def _custom_manylinux_platforms (arch ):
52- # type: (str) -> List[str]
49+ def _custom_manylinux_platforms (arch : str ) -> List [str ]:
5350 arches = [arch ]
5451 arch_prefix , arch_sep , arch_suffix = arch .partition ("_" )
5552 if arch_prefix == "manylinux2014" :
@@ -70,8 +67,7 @@ def _custom_manylinux_platforms(arch):
7067 return arches
7168
7269
73- def _get_custom_platforms (arch ):
74- # type: (str) -> List[str]
70+ def _get_custom_platforms (arch : str ) -> List [str ]:
7571 arch_prefix , arch_sep , arch_suffix = arch .partition ("_" )
7672 if arch .startswith ("macosx" ):
7773 arches = _mac_platforms (arch )
@@ -82,8 +78,7 @@ def _get_custom_platforms(arch):
8278 return arches
8379
8480
85- def _expand_allowed_platforms (platforms ):
86- # type: (Optional[List[str]]) -> Optional[List[str]]
81+ def _expand_allowed_platforms (platforms : Optional [List [str ]]) -> Optional [List [str ]]:
8782 if not platforms :
8883 return None
8984
@@ -100,16 +95,16 @@ def _expand_allowed_platforms(platforms):
10095 return result
10196
10297
103- def _get_python_version (version ):
104- # type: (str) -> PythonVersion
98+ def _get_python_version (version : str ) -> "PythonVersion" :
10599 if len (version ) > 1 :
106100 return int (version [0 ]), int (version [1 :])
107101 else :
108102 return (int (version [0 ]),)
109103
110104
111- def _get_custom_interpreter (implementation = None , version = None ):
112- # type: (Optional[str], Optional[str]) -> str
105+ def _get_custom_interpreter (
106+ implementation : Optional [str ] = None , version : Optional [str ] = None
107+ ) -> str :
113108 if implementation is None :
114109 implementation = interpreter_name ()
115110 if version is None :
@@ -118,12 +113,11 @@ def _get_custom_interpreter(implementation=None, version=None):
118113
119114
120115def get_supported (
121- version = None , # type: Optional[str]
122- platforms = None , # type: Optional[List[str]]
123- impl = None , # type: Optional[str]
124- abis = None , # type: Optional[List[str]]
125- ):
126- # type: (...) -> List[Tag]
116+ version : Optional [str ] = None ,
117+ platforms : Optional [List [str ]] = None ,
118+ impl : Optional [str ] = None ,
119+ abis : Optional [List [str ]] = None ,
120+ ) -> List [Tag ]:
127121 """Return a list of supported tags for each version specified in
128122 `versions`.
129123
@@ -136,9 +130,9 @@ def get_supported(
136130 :param abis: specify a list of abis you want valid
137131 tags for, or None. If None, use the local interpreter abi.
138132 """
139- supported = [] # type: List[Tag ]
133+ supported : List [ Tag ] = [ ]
140134
141- python_version = None # type : Optional[PythonVersion]
135+ python_version : Optional [" PythonVersion" ] = None
142136 if version is not None :
143137 python_version = _get_python_version (version )
144138
0 commit comments