Skip to content

Self describing environment

self_describing_environment

An environment capable of scanning the source tree.

Scans the environment for files that describe the source and dependencies and then acts upon those files.

self_describing_environment

An environment capable of scanning the source tree.

Scans the environment for files that describe the source and dependencies and then acts upon those files.

__init__

__init__(
    workspace_path: str,
    scopes: Optional[tuple] = None,
    skipped_dirs: Optional[tuple] = None,
) -> None

Inits an empty self describing environment.

load_workspace

load_workspace() -> self_describing_environment

Loads the workspace.

update_simple_paths

update_simple_paths(
    env_object: shell_environment.ShellEnvironment,
) -> None

Updates simple paths.

update_extdep_paths

update_extdep_paths(
    env_object: shell_environment.ShellEnvironment,
) -> None

Updates external dependency paths.

report_extdep_version

report_extdep_version(
    env_object: shell_environment.ShellEnvironment,
) -> None

Reports the version of all external dependencies.

update_extdeps

update_extdeps(
    env_object: shell_environment.ShellEnvironment,
) -> tuple

Updates external dependencies.

Returns:

Type Description
tuple

(success_count, failure_count)

clean_extdeps

clean_extdeps(
    env_object: shell_environment.ShellEnvironment,
) -> None

Cleans external dependencies.

verify_extdeps

verify_extdeps(
    env_object: shell_environment.ShellEnvironment,
) -> bool

Verifies external dependencies.

DestroyEnvironment

DestroyEnvironment() -> None

Destroys global environment state.

BootstrapEnvironment

BootstrapEnvironment(
    workspace: str,
    scopes: Optional[tuple] = None,
    skipped_dirs: Optional[tuple] = None,
) -> tuple

Performs a multistage bootstrap of the environment.

  1. Locate and load all environment description files
  2. Parse all PATH-related descriptor files
  3. Load modules that had dependencies
  4. Report versions into the version aggregator

Parameters:

Name Type Description Default
workspace str

workspace root

required
scopes Tuple

scopes being built against

None
skipped_dirs Tuple

directories to ignore

None

Returns:

Name Type Description
tuple tuple

(self_describing_environment,ShellEnvironment)

Warning

if only one scope or skipped_dir, the tuple should end with a comma example: '(myscope,)'

CleanEnvironment

CleanEnvironment(
    workspace: str,
    scopes: Optional[tuple] = None,
    skipped_dirs: Optional[tuple] = None,
) -> None

Cleans all external dependencies based on environment.

Environment is bootstrapped from provided arguments and all dependencies are cleaned from that.

Parameters:

Name Type Description Default
workspace str

workspace root

required
scopes Tuple

scopes being built against

None
skipped_dirs Tuple

directories to ignore

None

Warning

If only one scope or skipped_dir, the tuple should end with a comma example: '(myscope,)'

UpdateDependencies

UpdateDependencies(
    workspace: str,
    scopes: Optional[tuple] = None,
    skipped_dirs: Optional[tuple] = None,
) -> tuple

Updates all external dependencies based on environment.

Environment is bootstrapped from provided arguments and all dependencies are updated from that.

Parameters:

Name Type Description Default
workspace str

workspace root

required
scopes Tuple

scopes being built against

None
skipped_dirs Tuple

directories to ignore

None

Returns:

Type Description
Tuple

(success_count, failure_count)

Warning

If only one scope or skipped_dir, the tuple should end with a comma example: '(myscope,)'

VerifyEnvironment

VerifyEnvironment(
    workspace: str,
    scopes: Optional[tuple] = None,
    skipped_dirs: Optional[tuple] = None,
) -> bool

Verifies all external dependencies based on environment.

Environment is bootstrapped from provided arguments and all dependencies are verified from that.

Parameters:

Name Type Description Default
workspace str

workspace root

required
scopes Tuple

scopes being built against

None
skipped_dirs Tuple

directories to ignore

None

Warning

If only one scope or skipped_dir, the tuple should end with a comma example: '(myscope,)'