33import posixpath
44import stat
55import zipfile
6+ from collections .abc import Iterator
67from contextlib import contextmanager
78from functools import cached_property
89from pathlib import Path
910from typing import (
1011 TYPE_CHECKING ,
1112 BinaryIO ,
1213 ClassVar ,
13- Iterator ,
14- List ,
1514 Optional ,
16- Tuple ,
17- Type ,
1815 cast ,
1916)
2017
2522if TYPE_CHECKING :
2623 import os
2724
28- WheelContentElement = Tuple [ Tuple [str , str , str ], BinaryIO , bool ]
25+ WheelContentElement = tuple [ tuple [str , str , str ], BinaryIO , bool ]
2926
3027
3128__all__ = ["WheelSource" , "WheelFile" ]
@@ -37,7 +34,7 @@ class WheelSource:
3734 This is an abstract class, whose methods have to be implemented by subclasses.
3835 """
3936
40- validation_error : ClassVar [Type [Exception ]] = ValueError #: :meta hide-value:
37+ validation_error : ClassVar [type [Exception ]] = ValueError #: :meta hide-value:
4138 """
4239 .. versionadded:: 0.7.0
4340
@@ -66,7 +63,7 @@ def data_dir(self) -> str:
6663 return f"{ self .distribution } -{ self .version } .data"
6764
6865 @property
69- def dist_info_filenames (self ) -> List [str ]:
66+ def dist_info_filenames (self ) -> list [str ]:
7067 """Get names of all files in the dist-info directory.
7168
7269 Sample usage/behaviour::
@@ -127,7 +124,7 @@ def get_contents(self) -> Iterator[WheelContentElement]:
127124class _WheelFileValidationError (ValueError , InstallerError ):
128125 """Raised when a wheel file fails validation."""
129126
130- def __init__ (self , issues : List [str ]) -> None :
127+ def __init__ (self , issues : list [str ]) -> None :
131128 super ().__init__ (repr (issues ))
132129 self .issues = issues
133130
@@ -217,7 +214,7 @@ def dist_info_dir(self) -> str:
217214 return dist_info_dir
218215
219216 @property
220- def dist_info_filenames (self ) -> List [str ]:
217+ def dist_info_filenames (self ) -> list [str ]:
221218 """Get names of all files in the dist-info directory."""
222219 base = self .dist_info_dir
223220 return [
@@ -255,7 +252,7 @@ def validate_record(self, *, validate_contents: bool = True) -> None:
255252 [f"Unable to retrieve `RECORD` from { self ._zipfile .filename } : { exc !r} " ]
256253 ) from exc
257254
258- issues : List [str ] = []
255+ issues : list [str ] = []
259256
260257 for item in self ._zipfile .infolist ():
261258 if item .filename [- 1 :] == "/" : # looks like a directory
0 commit comments