/usr/lib/imh-ultrastack-common/venv/lib/python3.13/site-packages/setuptools
NameSizeModeActions
command/-0755rm
compat/-0755rm
config/-0755rm
tests/-0755rm
_distutils/-0755rm
_vendor/-0755rm
__pycache__/-0755rm
archive_util.py73560644editdlrm
build_meta.py202340644editdlrm
cli-32.exe117760644editdlrm
cli-64.exe143360644editdlrm
cli-arm64.exe138240644editdlrm
cli.exe117760644editdlrm
depends.py59650644editdlrm
discovery.py212860644editdlrm
dist.py451840644editdlrm
errors.py30240644editdlrm
extension.py68180644editdlrm
glob.py60620644editdlrm
gui-32.exe117760644editdlrm
gui-64.exe143360644editdlrm
gui-arm64.exe138240644editdlrm
gui.exe117760644editdlrm
installer.py51840644editdlrm
launch.py8200644editdlrm
launcher manifest.xml6280644editdlrm
logging.py12610644editdlrm
modified.py5680644editdlrm
monkey.py37330644editdlrm
msvc.py429090644editdlrm
namespaces.py30450644editdlrm
script (dev).tmpl2180644editdlrm
script.tmpl1380644editdlrm
unicode_utils.py31890644editdlrm
version.py1610644editdlrm
warnings.py37960644editdlrm
wheel.py95320644editdlrm
windows_support.py7260644editdlrm
_core_metadata.py119780644editdlrm
_discovery.py8360644editdlrm
_entry_points.py24680644editdlrm
_imp.py24350644editdlrm
_importlib.py2230644editdlrm
_itertools.py6570644editdlrm
_normalization.py57980644editdlrm
_path.py29760644editdlrm
_reqs.py13800644editdlrm
_scripts.py112470644editdlrm
_shutil.py15780644editdlrm
_static.py48550644editdlrm
__init__.py95210644editdlrm
Edit: /usr/lib/imh-ultrastack-common/venv/lib/python3.13/site-packages/setuptools/_path.py (2976B)
from __future__ import annotations import contextlib import os import sys from typing import TYPE_CHECKING, TypeVar, Union from more_itertools import unique_everseen if TYPE_CHECKING: from typing_extensions import TypeAlias StrPath: TypeAlias = Union[str, os.PathLike[str]] # Same as _typeshed.StrPath StrPathT = TypeVar("StrPathT", bound=Union[str, os.PathLike[str]]) def ensure_directory(path): """Ensure that the parent directory of `path` exists""" dirname = os.path.dirname(path) os.makedirs(dirname, exist_ok=True) def same_path(p1: StrPath, p2: StrPath) -> bool: """Differs from os.path.samefile because it does not require paths to exist. Purely string based (no comparison between i-nodes). >>> same_path("a/b", "./a/b") True >>> same_path("a/b", "a/./b") True >>> same_path("a/b", "././a/b") True >>> same_path("a/b", "./a/b/c/..") True >>> same_path("a/b", "../a/b/c") False >>> same_path("a", "a/b") False """ return normpath(p1) == normpath(p2) def _cygwin_patch(filename: StrPath): # pragma: nocover """ Contrary to POSIX 2008, on Cygwin, getcwd (3) contains symlink components. Using os.path.abspath() works around this limitation. A fix in os.getcwd() would probably better, in Cygwin even more so, except that this seems to be by design... """ return os.path.abspath(filename) if sys.platform == 'cygwin' else filename def normpath(filename: StrPath) -> str: """Normalize a file/dir name for comparison purposes.""" return os.path.normcase(os.path.realpath(os.path.normpath(_cygwin_patch(filename)))) @contextlib.contextmanager def paths_on_pythonpath(paths): """ Add the indicated paths to the head of the PYTHONPATH environment variable so that subprocesses will also see the packages at these paths. Do this in a context that restores the value on exit. >>> getfixture('monkeypatch').setenv('PYTHONPATH', 'anything') >>> with paths_on_pythonpath(['foo', 'bar']): ... assert 'foo' in os.environ['PYTHONPATH'] ... assert 'anything' in os.environ['PYTHONPATH'] >>> os.environ['PYTHONPATH'] 'anything' >>> getfixture('monkeypatch').delenv('PYTHONPATH') >>> with paths_on_pythonpath(['foo', 'bar']): ... assert 'foo' in os.environ['PYTHONPATH'] >>> os.environ.get('PYTHONPATH') """ nothing = object() orig_pythonpath = os.environ.get('PYTHONPATH', nothing) current_pythonpath = os.environ.get('PYTHONPATH', '') try: prefix = os.pathsep.join(unique_everseen(paths)) to_join = filter(None, [prefix, current_pythonpath]) new_path = os.pathsep.join(to_join) if new_path: os.environ['PYTHONPATH'] = new_path yield finally: if orig_pythonpath is nothing: os.environ.pop('PYTHONPATH', None) else: os.environ['PYTHONPATH'] = orig_pythonpath