Skip to content

PrefixPaths#

PrefixPathType #

directory property #

directory

This is a directory

hardlink

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

pyc_file property #

pyc_file

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

softlink

Whether the path should be softlinked (once installed)

unix_python_entrypoint property #

unix_python_entrypoint

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

windows_python_entrypoint_exe property #

windows_python_entrypoint_exe

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

windows_python_entrypoint_script property #

windows_python_entrypoint_script

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

__init__ #

__init__(path_type)

Create a new PrefixPathType instance.

Parameters#

path_type : str The type of path. Must be one of: "hardlink", "softlink", "directory"

Examples#
>>> path_type = PrefixPathType("hardlink")
>>> path_type.hardlink
True
>>>

from_py_path_type classmethod #

from_py_path_type(py_path_type)

Construct Rattler PathType from FFI PyPathType object.

PrefixPaths #

paths property writable #

paths

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 property writable #

paths_version

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
>>>

__init__ #

__init__(paths_version=1)

Create a new PrefixPaths instance.

Parameters#

paths_version : int, optional The version of the paths file format, by default 1

Examples#
>>> paths = PrefixPaths()
>>> paths.paths_version
1
>>>

__repr__ #

__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 property writable #

file_mode

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
>>>
no_link

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 property writable #

path_type

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 property writable #

prefix_placeholder

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 property writable #

relative_path

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 property writable #

sha256

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 property writable #

sha256_in_prefix

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 property writable #

size_in_bytes

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
>>>

__init__ #

__init__(
    relative_path,
    path_type,
    prefix_placeholder=None,
    file_mode=None,
    sha256=None,
    sha256_in_prefix=None,
    size_in_bytes=None,
    original_path=None,
)

Create a new PrefixPathsEntry instance.

Parameters#

relative_path : os.PathLike[str] The relative path from the root of the package path_type : PrefixPathType Determines how to include the file when installing the package prefix_placeholder : Optional[str], optional The placeholder prefix used in the file, by default None file_mode : Optional[FileMode], optional The file mode of the path, by default None sha256 : Optional[bytes], optional The sha256 of the path, by default None sha256_in_prefix : Optional[bytes], optional The sha256 of the path in the prefix, by default None size_in_bytes : Optional[int], optional The size of the path in bytes, by default None original_path : Optional[os.PathLike[str]], optional The original path of the file, by default None