Bump importlib-resources from 5.6.0 to 5.7.1 (#1723)

* Bump importlib-resources from 5.6.0 to 5.7.1

Bumps [importlib-resources](https://github.com/python/importlib_resources) from 5.6.0 to 5.7.1.
- [Release notes](https://github.com/python/importlib_resources/releases)
- [Changelog](https://github.com/python/importlib_resources/blob/main/CHANGES.rst)
- [Commits](https://github.com/python/importlib_resources/compare/v5.6.0...v5.7.1)

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

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

* Update importlib-resources==5.7.1

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] 2022-05-16 20:48:17 -07:00 committed by GitHub
parent 467ae352f5
commit 55812ce2f0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 23 additions and 7 deletions

View file

@ -55,6 +55,9 @@ class Traversable(Protocol):
"""
An object with a subset of pathlib.Path methods suitable for
traversing directories and opening files.
Any exceptions that occur when accessing the backing resource
may propagate unaltered.
"""
@abc.abstractmethod
@ -90,9 +93,13 @@ class Traversable(Protocol):
"""
@abc.abstractmethod
def joinpath(self, child: StrPath) -> "Traversable":
def joinpath(self, *descendants: StrPath) -> "Traversable":
"""
Return Traversable child in self
Return Traversable resolved with any descendants applied.
Each descendant should be a path segment relative to self
and each may contain multiple levels separated by
``posixpath.sep`` (``/``).
"""
def __truediv__(self, child: StrPath) -> "Traversable":

View file

@ -99,10 +99,19 @@ class ResourceContainer(Traversable):
def open(self, *args, **kwargs):
raise IsADirectoryError()
def joinpath(self, name):
@staticmethod
def _flatten(compound_names):
for name in compound_names:
yield from name.split('/')
def joinpath(self, *descendants):
if not descendants:
return self
names = self._flatten(descendants)
target = next(names)
return next(
traversable for traversable in self.iterdir() if traversable.name == name
)
traversable for traversable in self.iterdir() if traversable.name == target
).joinpath(*names)
class TraversableReader(TraversableResources, SimpleReader):

View file

@ -1,5 +1,5 @@
apscheduler==3.9.1
importlib-resources==5.6.0
importlib-resources==5.7.1
pyinstaller==4.9
pyopenssl==22.0.0
pycryptodomex==3.14.1

View file

@ -19,7 +19,7 @@ html5lib==1.1
httpagentparser==1.9.2
idna==3.3
importlib-metadata==4.11.3
importlib-resources==5.6.0
importlib-resources==5.7.1
git+https://github.com/Tautulli/ipwhois.git@master#egg=ipwhois
IPy==1.01
Mako==1.2.0