1313
1414
1515# Copied from distlib/wheel.py
16- WHEEL_FILENAME_RE = re .compile (r'''
16+ WHEEL_FILENAME_RE = re .compile (
17+ r'''
1718(?P<nm>[^-]+)
1819-(?P<vn>\d+[^-]*)
1920(-(?P<bn>\d+[^-]*))?
2021-(?P<py>\w+\d+(\.\w+\d+)*)
2122-(?P<bi>\w+)
2223-(?P<ar>\w+(\.\w+)*)
2324\.whl$
24- ''' , re .IGNORECASE | re .VERBOSE )
25+ ''' , re .IGNORECASE | re .VERBOSE ,
26+ )
2527
2628
2729def pep426_normalize (package_name : str ) -> str :
@@ -92,7 +94,7 @@ class PackageEntry:
9294 size : int
9395
9496
95- def _package_entries_from_zipfile (path : str ) -> typing . Set [PackageEntry ]:
97+ def _package_entries_from_zipfile (path : str ) -> set [PackageEntry ]:
9698 with zipfile .ZipFile (path ) as zf :
9799 return {
98100 PackageEntry (
@@ -105,7 +107,7 @@ def _package_entries_from_zipfile(path: str) -> typing.Set[PackageEntry]:
105107 }
106108
107109
108- def _package_entries_from_tarball (path : str ) -> typing . Set [PackageEntry ]:
110+ def _package_entries_from_tarball (path : str ) -> set [PackageEntry ]:
109111 with tarfile .open (path ) as tf :
110112 return {
111113 PackageEntry (
@@ -130,9 +132,9 @@ async def __aenter__(self) -> 'AsyncArchiveFile':
130132
131133 async def __aexit__ (
132134 self ,
133- exc_t : typing . Optional [ typing . Type [ BaseException ]] ,
134- exc_v : typing . Optional [ BaseException ] ,
135- exc_tb : typing . Optional [ TracebackType ] ,
135+ exc_t : type [ BaseException ] | None ,
136+ exc_v : BaseException | None ,
137+ exc_tb : TracebackType | None ,
136138 ) -> None :
137139 await asyncio .to_thread (self .file_ .close )
138140
@@ -171,7 +173,7 @@ def from_path(cls, path: str) -> 'Package':
171173 path = path ,
172174 )
173175
174- async def entries (self ) -> typing . Set [PackageEntry ]:
176+ async def entries (self ) -> set [PackageEntry ]:
175177 if self .package_format is PackageFormat .ZIPFILE :
176178 return await asyncio .to_thread (_package_entries_from_zipfile , self .path )
177179 elif self .package_format is PackageFormat .TARBALL :
0 commit comments