mirror of
https://github.com/Tautulli/Tautulli.git
synced 2025-07-05 20:51:15 -07:00
Bump importlib-metadata from 7.1.0 to 8.0.0 (#2360)
* Bump importlib-metadata from 7.1.0 to 8.0.0 Bumps [importlib-metadata](https://github.com/python/importlib_metadata) from 7.1.0 to 8.0.0. - [Release notes](https://github.com/python/importlib_metadata/releases) - [Changelog](https://github.com/python/importlib_metadata/blob/main/NEWS.rst) - [Commits](https://github.com/python/importlib_metadata/compare/v7.1.0...v8.0.0) --- updated-dependencies: - dependency-name: importlib-metadata dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com> * Update importlib-metadata==8.0.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>
This commit is contained in:
parent
e934d09eff
commit
50ced86ba5
5 changed files with 40 additions and 44 deletions
|
@ -12,14 +12,13 @@ import inspect
|
|||
import pathlib
|
||||
import operator
|
||||
import textwrap
|
||||
import warnings
|
||||
import functools
|
||||
import itertools
|
||||
import posixpath
|
||||
import collections
|
||||
|
||||
from . import _adapters, _meta
|
||||
from .compat import py39
|
||||
from . import _meta
|
||||
from .compat import py39, py311
|
||||
from ._collections import FreezableDefaultDict, Pair
|
||||
from ._compat import (
|
||||
NullFinder,
|
||||
|
@ -334,27 +333,7 @@ class FileHash:
|
|||
return f'<FileHash mode: {self.mode} value: {self.value}>'
|
||||
|
||||
|
||||
class DeprecatedNonAbstract:
|
||||
# Required until Python 3.14
|
||||
def __new__(cls, *args, **kwargs):
|
||||
all_names = {
|
||||
name for subclass in inspect.getmro(cls) for name in vars(subclass)
|
||||
}
|
||||
abstract = {
|
||||
name
|
||||
for name in all_names
|
||||
if getattr(getattr(cls, name), '__isabstractmethod__', False)
|
||||
}
|
||||
if abstract:
|
||||
warnings.warn(
|
||||
f"Unimplemented abstract methods {abstract}",
|
||||
DeprecationWarning,
|
||||
stacklevel=2,
|
||||
)
|
||||
return super().__new__(cls)
|
||||
|
||||
|
||||
class Distribution(DeprecatedNonAbstract):
|
||||
class Distribution(metaclass=abc.ABCMeta):
|
||||
"""
|
||||
An abstract Python distribution package.
|
||||
|
||||
|
@ -461,6 +440,9 @@ class Distribution(DeprecatedNonAbstract):
|
|||
Custom providers may provide the METADATA file or override this
|
||||
property.
|
||||
"""
|
||||
# deferred for performance (python/cpython#109829)
|
||||
from . import _adapters
|
||||
|
||||
opt_text = (
|
||||
self.read_text('METADATA')
|
||||
or self.read_text('PKG-INFO')
|
||||
|
@ -567,9 +549,8 @@ class Distribution(DeprecatedNonAbstract):
|
|||
return
|
||||
|
||||
paths = (
|
||||
(subdir / name)
|
||||
.resolve()
|
||||
.relative_to(self.locate_file('').resolve())
|
||||
py311.relative_fix((subdir / name).resolve())
|
||||
.relative_to(self.locate_file('').resolve(), walk_up=True)
|
||||
.as_posix()
|
||||
for name in text.splitlines()
|
||||
)
|
||||
|
|
|
@ -1,20 +1,8 @@
|
|||
import functools
|
||||
import warnings
|
||||
import re
|
||||
import textwrap
|
||||
import email.message
|
||||
|
||||
from ._text import FoldedCase
|
||||
from ._compat import pypy_partial
|
||||
|
||||
|
||||
# Do not remove prior to 2024-01-01 or Python 3.14
|
||||
_warn = functools.partial(
|
||||
warnings.warn,
|
||||
"Implicit None on return values is deprecated and will raise KeyErrors.",
|
||||
DeprecationWarning,
|
||||
stacklevel=pypy_partial(2),
|
||||
)
|
||||
|
||||
|
||||
class Message(email.message.Message):
|
||||
|
@ -53,12 +41,17 @@ class Message(email.message.Message):
|
|||
|
||||
def __getitem__(self, item):
|
||||
"""
|
||||
Warn users that a ``KeyError`` can be expected when a
|
||||
missing key is supplied. Ref python/importlib_metadata#371.
|
||||
Override parent behavior to typical dict behavior.
|
||||
|
||||
``email.message.Message`` will emit None values for missing
|
||||
keys. Typical mappings, including this ``Message``, will raise
|
||||
a key error for missing keys.
|
||||
|
||||
Ref python/importlib_metadata#371.
|
||||
"""
|
||||
res = super().__getitem__(item)
|
||||
if res is None:
|
||||
_warn()
|
||||
raise KeyError(item)
|
||||
return res
|
||||
|
||||
def _repair_headers(self):
|
||||
|
|
22
lib/importlib_metadata/compat/py311.py
Normal file
22
lib/importlib_metadata/compat/py311.py
Normal file
|
@ -0,0 +1,22 @@
|
|||
import os
|
||||
import pathlib
|
||||
import sys
|
||||
import types
|
||||
|
||||
|
||||
def wrap(path): # pragma: no cover
|
||||
"""
|
||||
Workaround for https://github.com/python/cpython/issues/84538
|
||||
to add backward compatibility for walk_up=True.
|
||||
An example affected package is dask-labextension, which uses
|
||||
jupyter-packaging to install JupyterLab javascript files outside
|
||||
of site-packages.
|
||||
"""
|
||||
|
||||
def relative_to(root, *, walk_up=False):
|
||||
return pathlib.Path(os.path.relpath(path, root))
|
||||
|
||||
return types.SimpleNamespace(relative_to=relative_to)
|
||||
|
||||
|
||||
relative_fix = wrap if sys.version_info < (3, 12) else lambda x: x
|
|
@ -1,5 +1,5 @@
|
|||
apscheduler==3.10.1
|
||||
importlib-metadata==7.1.0
|
||||
importlib-metadata==8.0.0
|
||||
importlib-resources==6.4.0
|
||||
pyinstaller==6.8.0
|
||||
pyopenssl==24.1.0
|
||||
|
|
|
@ -16,7 +16,7 @@ gntp==1.0.3
|
|||
html5lib==1.1
|
||||
httpagentparser==1.9.5
|
||||
idna==3.7
|
||||
importlib-metadata==7.1.0
|
||||
importlib-metadata==8.0.0
|
||||
importlib-resources==6.4.0
|
||||
git+https://github.com/Tautulli/ipwhois.git@master#egg=ipwhois
|
||||
IPy==1.01
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue