Skip to content

PathsEntry#

A single entry in the paths.json file.

Whether or not this file should be linked or not when installing the package.

>>> paths_json = PathsJson.from_path(
...     "../test-data/conda-22.9.0-py38haa244fe_2-paths.json"
... )
>>> entry = paths_json.paths[0]
>>> entry.no_link
False
>>>

path_type: PathType property #

Determines how to include the file when installing the package.

Examples#

>>> paths_json = PathsJson.from_path(
...     "../test-data/conda-22.9.0-py38haa244fe_2-paths.json"
... )
>>> entry = paths_json.paths[0]
>>> entry.path_type
PathType()
>>>

prefix_placeholder: Optional[PrefixPlaceholder] property #

Optionally the placeholder prefix used in the file. If this value is None the prefix is not present in the file.

Examples#

>>> paths_json = PathsJson.from_path(
...     "../test-data/conda-22.9.0-py38haa244fe_2-paths.json"
... )
>>> entry = paths_json.paths[0]
>>> entry.prefix_placeholder
>>>

relative_path: str property #

The relative path from the root of the package.

Examples#

>>> paths_json = PathsJson.from_path(
...     "../test-data/conda-22.9.0-py38haa244fe_2-paths.json"
... )
>>> entry = paths_json.paths[0]
>>> entry.relative_path
'Lib/site-packages/conda-22.9.0-py3.8.egg-info/PKG-INFO'
>>>

sha256: Optional[bytes] property #

A hex representation of the SHA256 hash of the contents of the file. This entry is only present in version 1 of the paths.json file.

Examples#

>>> paths_json = PathsJson.from_path(
...     "../test-data/conda-22.9.0-py38haa244fe_2-paths.json"
... )
>>> entry = paths_json.paths[0]
>>> entry.sha256.hex()
'1323efbd9b3abb527b06435392b39de11710eb3a814e87a8174230c8f5a0826a'
>>>

size_in_bytes: Optional[int] property #

The size of the file in bytes. This entry is only present in version 1 of the paths.json file.

Examples#

>>> paths_json = PathsJson.from_path(
...     "../test-data/conda-22.9.0-py38haa244fe_2-paths.json"
... )
>>> entry = paths_json.paths[0]
>>> entry.size_in_bytes
1229
>>>

__repr__() #

Returns a representation of the PathsEntry.