Installer
provide.foundation.tools.installer
¶
TODO: Add module docstring.
Classes¶
InstallError
¶
InstallError(
message: str,
*,
code: str | None = None,
context: dict[str, Any] | None = None,
cause: Exception | None = None,
**extra_context: Any
)
Bases: FoundationError
Raised when installation fails.
Source code in provide/foundation/errors/base.py
ToolInstaller
¶
Handle tool installation from various artifact formats.
Supports: - ZIP archives - TAR archives (with compression) - Single binary files - Platform-specific installation patterns
Functions¶
create_symlinks
¶
Create symlinks for easier access.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
install_dir
|
Path
|
Installation directory. |
required |
metadata
|
ToolMetadata
|
Tool metadata. |
required |
Source code in provide/foundation/tools/installer.py
extract_tar
¶
Extract tar archive (with optional compression).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
archive
|
Path
|
Path to tar file. |
required |
dest
|
Path
|
Destination directory. |
required |
Source code in provide/foundation/tools/installer.py
extract_zip
¶
Extract ZIP archive.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
archive
|
Path
|
Path to ZIP file. |
required |
dest
|
Path
|
Destination directory. |
required |
Source code in provide/foundation/tools/installer.py
get_install_dir
¶
Get installation directory for tool.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
metadata
|
ToolMetadata
|
Tool metadata. |
required |
Returns:
| Type | Description |
|---|---|
Path
|
Installation directory path. |
Source code in provide/foundation/tools/installer.py
install
¶
Install tool from artifact.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
artifact
|
Path
|
Path to downloaded artifact. |
required |
metadata
|
ToolMetadata
|
Tool metadata with installation info. |
required |
Returns:
| Type | Description |
|---|---|
Path
|
Path to installed tool directory. |
Raises:
| Type | Description |
|---|---|
InstallError
|
If installation fails. |
Source code in provide/foundation/tools/installer.py
install_binary
¶
Install single binary file.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
binary
|
Path
|
Path to binary file. |
required |
dest
|
Path
|
Destination directory. |
required |
metadata
|
ToolMetadata
|
Tool metadata. |
required |
Source code in provide/foundation/tools/installer.py
is_binary
¶
Check if file is a binary executable.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
file_path
|
Path
|
Path to check. |
required |
Returns:
| Type | Description |
|---|---|
bool
|
True if file appears to be binary. |
Source code in provide/foundation/tools/installer.py
set_permissions
¶
Set appropriate permissions on installed files.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
install_dir
|
Path
|
Installation directory. |
required |
metadata
|
ToolMetadata
|
Tool metadata. |
required |