Let us walk on the 3-isogeny graph
Loading...
Searching...
No Matches
pip._internal.metadata.base Namespace Reference

Data Structures

class  BaseDistribution
 
class  BaseEntryPoint
 
class  BaseEnvironment
 
class  FilesystemWheel
 
class  MemoryWheel
 
class  RequiresEntry
 
class  Wheel
 

Functions

str _convert_installed_files_path (Tuple[str,...] entry, Tuple[str,...] info)
 

Variables

 Protocol = object
 
 DistributionVersion = Union[LegacyVersion, Version]
 
 InfoPath = Union[str, pathlib.PurePath]
 
 logger = logging.getLogger(__name__)
 

Function Documentation

◆ _convert_installed_files_path()

str _convert_installed_files_path ( Tuple[str, ...]  entry,
Tuple[str, ...]  info 
)
protected
Convert a legacy installed-files.txt path into modern RECORD path.

The legacy format stores paths relative to the info directory, while the
modern format stores paths relative to the package root, e.g. the
site-packages directory.

:param entry: Path parts of the installed-files.txt entry.
:param info: Path parts of the egg-info directory relative to package root.
:returns: The converted entry.

For best compatibility with symlinks, this does not use ``abspath()`` or
``Path.resolve()``, but tries to work with path parts:

1. While ``entry`` starts with ``..``, remove the equal amounts of parts
   from ``info``; if ``info`` is empty, start appending ``..`` instead.
2. Join the two directly.

Definition at line 71 of file base.py.

74) -> str:
75 """Convert a legacy installed-files.txt path into modern RECORD path.
76
77 The legacy format stores paths relative to the info directory, while the
78 modern format stores paths relative to the package root, e.g. the
79 site-packages directory.
80
81 :param entry: Path parts of the installed-files.txt entry.
82 :param info: Path parts of the egg-info directory relative to package root.
83 :returns: The converted entry.
84
85 For best compatibility with symlinks, this does not use ``abspath()`` or
86 ``Path.resolve()``, but tries to work with path parts:
87
88 1. While ``entry`` starts with ``..``, remove the equal amounts of parts
89 from ``info``; if ``info`` is empty, start appending ``..`` instead.
90 2. Join the two directly.
91 """
92 while entry and entry[0] == "..":
93 if not info or info[-1] == "..":
94 info += ("..",)
95 else:
96 info = info[:-1]
97 entry = entry[1:]
98 return str(pathlib.Path(*info, *entry))
99
100
for i

References i.

Referenced by BaseDistribution._iter_declared_entries_from_legacy().

Here is the caller graph for this function:

Variable Documentation

◆ DistributionVersion

DistributionVersion = Union[LegacyVersion, Version]

Definition at line 50 of file base.py.

◆ InfoPath

InfoPath = Union[str, pathlib.PurePath]

Definition at line 52 of file base.py.

◆ logger

logger = logging.getLogger(__name__)

Definition at line 54 of file base.py.

◆ Protocol

Protocol = object

Definition at line 48 of file base.py.