Developer environment interface¶
Environment types implementing the DeveloperEnvironmentInterface interface may be managed by the env dev command group.
DeveloperEnvironmentConfig ¶
DeveloperEnvironmentInterface ¶
This interface defines the behavior of a developer environment.
storage_dirs cached property ¶
storage_dirs: StorageDirs
The storage directories for the environment.
config cached property ¶
The user-defined configuration as an instance of the DeveloperEnvironmentConfig class, or subclass thereof.
config_file cached property ¶
config_file: Path
The path to the JSON file that is used to persist the environment's configuration until the environment is removed.
shared_dir cached property ¶
shared_dir: Path
The path to the directory that is used to share data between the host and the environment.
global_shared_dir cached property ¶
global_shared_dir: Path
The path to the directory that is used to share data between all environments.
start abstractmethod ¶
This method starts the developer environment. If this method returns early, the environment's status should contain information about the startup progress.
This method will only be called if the environment's status is stopped or nonexistent.
Users trigger this method by running the env dev start command.
stop abstractmethod ¶
This method stops the developer environment. If this method returns early, the environment's status should contain information about the shutdown progress.
This method will only be called if the environment's status is started.
Users trigger this method by running the env dev stop command.
remove abstractmethod ¶
This method removes the developer environment and all associated state.
This method will only be called if the environment's status is stopped or in an error state.
Users trigger this method by running the env dev remove command or with the -r/--remove flag of the env dev stop command.
status abstractmethod ¶
status() -> EnvironmentStatus
This method returns the current status of the developer environment.
code abstractmethod ¶
code(*, editor: EditorInterface, repo: str | None = None) -> None
This method opens the developer environment's code in the configured editor.
Users trigger this method by running the env dev code command.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
editor | EditorInterface | The editor to use. | required |
repo | str | None | The repository to open the code for, or | None |
run_command abstractmethod ¶
This method runs a command inside the developer environment.
Users trigger this method by running the env dev run command.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
command | list[str] | The command to run inside the developer environment. | required |
repo | str | None | The repository to run the command for, or | None |
launch_shell abstractmethod ¶
This method starts an interactive shell inside the developer environment.
Users trigger this method by running the env dev shell command.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
repo | str | None | The repository to run the shell for, or | None |
launch_gui ¶
launch_gui() -> NoReturn
This method starts an interactive GUI inside the developer environment using e.g. RDP or VNC.
remove_cache ¶
This method removes the developer environment's cache that is persisted between lifecycles.
cache_size ¶
cache_size() -> int
This method returns the size of the developer environment's cache in bytes.
config_class classmethod ¶
config_class() -> type[DeveloperEnvironmentConfig]
The DeveloperEnvironmentConfig class, or subclass thereof, that is used to configure the environment.