Bump zipp from 3.11.0 to 3.15.0 (#2011)

* Bump zipp from 3.11.0 to 3.15.0

Bumps [zipp](https://github.com/jaraco/zipp) from 3.11.0 to 3.15.0.
- [Release notes](https://github.com/jaraco/zipp/releases)
- [Changelog](https://github.com/jaraco/zipp/blob/main/CHANGES.rst)
- [Commits](https://github.com/jaraco/zipp/compare/v3.11.0...v3.15.0)

---
updated-dependencies:
- dependency-name: zipp
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

* Update zipp==3.15.0

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: JonnyWong16 <9099342+JonnyWong16@users.noreply.github.com>

[skip ci]
This commit is contained in:
dependabot[bot] 2023-03-02 20:50:33 -08:00 committed by GitHub
parent c8f43825f9
commit 1f59171dcb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 32 additions and 11 deletions

View file

@ -88,6 +88,11 @@ class CompleteDirs(InitializedState, zipfile.ZipFile):
""" """
A ZipFile subclass that ensures that implied directories A ZipFile subclass that ensures that implied directories
are always included in the namelist. are always included in the namelist.
>>> list(CompleteDirs._implied_dirs(['foo/bar.txt', 'foo/bar/baz.txt']))
['foo/', 'foo/bar/']
>>> list(CompleteDirs._implied_dirs(['foo/bar.txt', 'foo/bar/baz.txt', 'foo/bar/']))
['foo/']
""" """
@staticmethod @staticmethod
@ -97,7 +102,7 @@ class CompleteDirs(InitializedState, zipfile.ZipFile):
return _dedupe(_difference(as_dirs, names)) return _dedupe(_difference(as_dirs, names))
def namelist(self): def namelist(self):
names = super(CompleteDirs, self).namelist() names = super().namelist()
return names + list(self._implied_dirs(names)) return names + list(self._implied_dirs(names))
def _name_set(self): def _name_set(self):
@ -113,6 +118,17 @@ class CompleteDirs(InitializedState, zipfile.ZipFile):
dir_match = name not in names and dirname in names dir_match = name not in names and dirname in names
return dirname if dir_match else name return dirname if dir_match else name
def getinfo(self, name):
"""
Supplement getinfo for implied dirs.
"""
try:
return super().getinfo(name)
except KeyError:
if not name.endswith('/') or name not in self._name_set():
raise
return zipfile.ZipInfo(filename=name)
@classmethod @classmethod
def make(cls, source): def make(cls, source):
""" """
@ -142,16 +158,21 @@ class FastLookup(CompleteDirs):
def namelist(self): def namelist(self):
with contextlib.suppress(AttributeError): with contextlib.suppress(AttributeError):
return self.__names return self.__names
self.__names = super(FastLookup, self).namelist() self.__names = super().namelist()
return self.__names return self.__names
def _name_set(self): def _name_set(self):
with contextlib.suppress(AttributeError): with contextlib.suppress(AttributeError):
return self.__lookup return self.__lookup
self.__lookup = super(FastLookup, self)._name_set() self.__lookup = super()._name_set()
return self.__lookup return self.__lookup
def _extract_text_encoding(encoding=None, *args, **kwargs):
# stacklevel=3 so that the caller of the caller see any warning.
return text_encoding(encoding, 3), args, kwargs
class Path: class Path:
""" """
A pathlib-compatible interface for zip files. A pathlib-compatible interface for zip files.
@ -201,7 +222,7 @@ class Path:
Read text: Read text:
>>> c.read_text() >>> c.read_text(encoding='utf-8')
'content of c' 'content of c'
existence: existence:
@ -273,9 +294,9 @@ class Path:
if args or kwargs: if args or kwargs:
raise ValueError("encoding args invalid for binary operation") raise ValueError("encoding args invalid for binary operation")
return stream return stream
else: # Text mode:
kwargs["encoding"] = text_encoding(kwargs.get("encoding")) encoding, args, kwargs = _extract_text_encoding(*args, **kwargs)
return io.TextIOWrapper(stream, *args, **kwargs) return io.TextIOWrapper(stream, encoding, *args, **kwargs)
@property @property
def name(self): def name(self):
@ -298,8 +319,8 @@ class Path:
return pathlib.Path(self.root.filename).joinpath(self.at) return pathlib.Path(self.root.filename).joinpath(self.at)
def read_text(self, *args, **kwargs): def read_text(self, *args, **kwargs):
kwargs["encoding"] = text_encoding(kwargs.get("encoding")) encoding, args, kwargs = _extract_text_encoding(*args, **kwargs)
with self.open('r', *args, **kwargs) as strm: with self.open('r', encoding, *args, **kwargs) as strm:
return strm.read() return strm.read()
def read_bytes(self): def read_bytes(self):
@ -344,7 +365,7 @@ class Path:
def glob(self, pattern): def glob(self, pattern):
if not pattern: if not pattern:
raise ValueError("Unacceptable pattern: {!r}".format(pattern)) raise ValueError(f"Unacceptable pattern: {pattern!r}")
matches = re.compile(fnmatch.translate(pattern)).fullmatch matches = re.compile(fnmatch.translate(pattern)).fullmatch
return ( return (

View file

@ -50,7 +50,7 @@ urllib3==1.26.13
webencodings==0.5.1 webencodings==0.5.1
websocket-client==1.4.2 websocket-client==1.4.2
xmltodict==0.13.0 xmltodict==0.13.0
zipp==3.11.0 zipp==3.15.0
# configobj==5.1.0 # configobj==5.1.0
# sgmllib3k==1.0.0 # sgmllib3k==1.0.0