feat(spack_operation): implement setup_spack_env functionality
Merged
requested to merge VT-70-function-Migrate-Spack-env-setup-into-ESD-repo-with-buildcache into dev
Following changes have been incorporated:
The commands folder implements a command execution and management system, especially for Spack, using these key components and patterns:
Command Definitions (Enum/Constants): command_enum.py likely defines an enumeration (or constants) representing different commands. This promotes type safety and avoids stringly-typed code.
Command Sequence Builder: command_sequence_builder.py implements the Builder Pattern to construct CommandSequence objects (from command_sequence.py). This allows for flexible and readable creation of complex command sequences.
Command Sequence: command_sequence.py represents a sequence of commands to be executed. It encapsulates the order and configuration of commands.
Spack Command Factory: spack_command_sequence_factory.py uses the Factory Pattern to create Spack-specific CommandSequence objects. This centralizes the creation logic for different Spack commands and simplifies their usage. It likely uses command_sequence_builder.py internally.
Generic Command Runner: A command_runner.py (implied, not explicitly mentioned in the diff) likely handles the actual execution of commands, possibly using subprocesses. This abstracts the execution details from the command sequence logic.
Bash Command Executor: Executes a sequence of commands in a Bash shell, handling various potential errors and returning the output and error message (if any).
Focus on Spack: The structure strongly suggests a focus on managing Spack environments and packages. The factory and command definitions likely reflect common Spack operations.
Patterns used:
Parent artefact: https://tvb-projects.atlassian.net/browse/VT-70