hatch.env.plugin.interface.FileSystemContext

class hatch.env.plugin.interface.FileSystemContext(env: EnvironmentInterface, *, local_path: Path, env_path: str)

Bases: object

This class represents a synchronized path between the local file system and a potentially remote environment.

__init__(env: EnvironmentInterface, *, local_path: Path, env_path: str)

Methods

__init__(env, *, local_path, env_path)

join(relative_path)

Returns a new instance of this class with the given relative path appended to the local and environment paths.

sync_env()

Synchronizes the [environment path](utilities.md#hatch.env.plugin.interface.FileSystemContext.env_path) with the [local path](utilities.md#hatch.env.plugin.interface.FileSystemContext.local_path) as the source.

sync_local()

Synchronizes the [local path](utilities.md#hatch.env.plugin.interface.FileSystemContext.local_path) as the source with the [environment path](utilities.md#hatch.env.plugin.interface.FileSystemContext.env_path) as the source.

Attributes

env

Returns the environment to which this context belongs.

env_path

Returns the environment path to which this context refers as a string.

local_path

Returns the local path to which this context refers as a path-like object.

property env: EnvironmentInterface

Returns the environment to which this context belongs.

property env_path: str

Returns the environment path to which this context refers as a string. The environment may not be on the local file system.

join(relative_path: str) FileSystemContext

Returns a new instance of this class with the given relative path appended to the local and environment paths.

This method should not need overwriting.

property local_path: Path

Returns the local path to which this context refers as a path-like object.

sync_env()

Synchronizes the [environment path](utilities.md#hatch.env.plugin.interface.FileSystemContext.env_path) with the [local path](utilities.md#hatch.env.plugin.interface.FileSystemContext.local_path) as the source.

sync_local()

Synchronizes the [local path](utilities.md#hatch.env.plugin.interface.FileSystemContext.local_path) as the source with the [environment path](utilities.md#hatch.env.plugin.interface.FileSystemContext.env_path) as the source.