Skip to content

Index

Utilities for testing Project Forge patterns and compositions.

Classes

Forger

Forger(output_dir: pathlib.Path)

Class to provide convenient access to the project_forge API.

Functions

forge
forge(
    config_path: Optional[pathlib.Path],
    use_defaults: bool = False,
    initial_context: Optional[dict] = None,
) -> Result

Build a project from the given config.

Result dataclass

Result(
    exception: Optional[BaseException] = None,
    exit_code: str | int = 0,
    project_dir: Optional[pathlib.Path] = None,
    context: Optional[dict] = None,
)

Holds the captured result of the project forge project generation.

Functions

run_inside_dir

run_inside_dir(
    command: str, dir_path: Path
) -> CompletedProcess

Run a command from inside a given directory, returning the exit status.

PARAMETER DESCRIPTION
command

Command string to execute within the directory

TYPE: str

dir_path

String, path of the directory the command is being run.

TYPE: Path

RETURNS DESCRIPTION
CompletedProcess

The result code of the command.