plexpy/lib/importlib_metadata/compat/py311.py
dependabot[bot] 50ced86ba5
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>
2024-07-06 11:04:54 -07:00

23 lines
608 B
Python

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