Skip to content

PrefixPaths#

PrefixPathType #

directory: bool property #

This is a directory

Whether the path should be hardlinked (the default) (once installed)

pyc_file: bool property #

This is a file compiled from Python code when a noarch package was installed

Whether the path should be softlinked (once installed)

unix_python_entrypoint: bool property #

A Unix entry point python script (a Python script file)

windows_python_entrypoint_exe: bool property #

A Windows entry point python script (a .exe executable)

windows_python_entrypoint_script: bool property #

A Windows entry point python script (a -script.py Python script file)

from_py_path_type(py_path_type) classmethod #

Construct Rattler PathType from FFI PyPathType object.

PrefixPaths #

paths: List[PrefixPathsEntry] property #

All entries included in the package.

Examples#
>>> from rattler.prefix.prefix_record import PrefixRecord
>>> r = PrefixRecord.from_path(
...     "../test-data/conda-meta/requests-2.28.2-pyhd8ed1ab_0.json"
... )
>>> paths = r.paths_data
>>> paths.paths # doctest:+ELLIPSIS
[...]
>>>

paths_version: int property #

The version of the file.

Examples#
>>> from rattler.prefix.prefix_record import PrefixRecord
>>> r = PrefixRecord.from_path(
...     "../test-data/conda-meta/requests-2.28.2-pyhd8ed1ab_0.json"
... )
>>> paths = r.paths_data
>>> paths.paths_version
1
>>>

__repr__() #

Returns a representation of the PrefixPaths.

Examples#
>>> from rattler.prefix.prefix_record import PrefixRecord
>>> r = PrefixRecord.from_path(
...     "../test-data/conda-meta/requests-2.28.2-pyhd8ed1ab_0.json"
... )
>>> r.paths_data # doctest:+ELLIPSIS
PrefixPaths(paths=[...])
>>>

PrefixPathsEntry #

Bases: BasePathLike

file_mode: FileMode property #

The file mode of the path.

Examples#
>>> from rattler.prefix.prefix_record import PrefixRecord
>>> r = PrefixRecord.from_path(
...     "../test-data/conda-meta/requests-2.28.2-pyhd8ed1ab_0.json"
... )
>>> paths = r.paths_data
>>> file_mode = paths.paths[0].file_mode
>>>

Whether this file should be linked

>>> from rattler.prefix.prefix_record import PrefixRecord
>>> r = PrefixRecord.from_path(
...     "../test-data/conda-meta/requests-2.28.2-pyhd8ed1ab_0.json"
... )
>>> paths = r.paths_data
>>> no_link = paths.paths[0].no_link
>>>

path_type: PrefixPathType property #

The type of the path.

Examples#
>>> from rattler.prefix.prefix_record import PrefixRecord
>>> r = PrefixRecord.from_path(
...     "../test-data/conda-meta/requests-2.28.2-pyhd8ed1ab_0.json"
... )
>>> paths = r.paths_data
>>> path_type = paths.paths[0].path_type
>>>

prefix_placeholder: str | None property #

The prefix placeholder for the path.

Examples#
>>> from rattler.prefix.prefix_record import PrefixRecord
>>> r = PrefixRecord.from_path(
...     "../test-data/conda-meta/requests-2.28.2-pyhd8ed1ab_0.json"
... )
>>> paths = r.paths_data
>>> prefix_placeholder = paths.paths[0].prefix_placeholder
>>>

relative_path: os.PathLike[str] property #

The relative path of the entry.

Examples#
>>> from rattler.prefix.prefix_record import PrefixRecord
>>> r = PrefixRecord.from_path(
...     "../test-data/conda-meta/tk-8.6.12-h8ffe710_0.json"
... )
>>> paths = r.paths_data
>>> relative_path = paths.paths[0].relative_path
>>>
...

sha256: bytes property #

The sha256 of the path.

Examples#
>>> from rattler.prefix.prefix_record import PrefixRecord
>>> r = PrefixRecord.from_path(
...     "../test-data/conda-meta/requests-2.28.2-pyhd8ed1ab_0.json"
... )
>>> paths = r.paths_data
>>> sha256 = paths.paths[0].sha256
>>>

sha256_in_prefix: bytes property #

The sha256 of the path in the prefix.

Examples#
>>> from rattler.prefix.prefix_record import PrefixRecord
>>> r = PrefixRecord.from_path(
...     "../test-data/conda-meta/requests-2.28.2-pyhd8ed1ab_0.json"
... )
>>> paths = r.paths_data
>>> sha256_in_prefix = paths.paths[0].sha256_in_prefix
>>>

size_in_bytes: int property #

The size of the path in bytes.

Examples#
>>> from rattler.prefix.prefix_record import PrefixRecord
>>> r = PrefixRecord.from_path(
...     "../test-data/conda-meta/requests-2.28.2-pyhd8ed1ab_0.json"
... )
>>> paths = r.paths_data
>>> size_in_bytes = paths.paths[0].size_in_bytes
>>>