Skip to content

Installer

Package InstallerLink

sierra.package_manager.installer Link

Package installer for Sierra Package Manager.

Handles installing, updating, and removing packages.

ClassesLink

PackageInstaller Link
Python
PackageInstaller(
    repo_manager,
    environment_path: Path,
    logger: UniversalLogger | None = None,
)

Handles package installation and management.

Downloads packages from GitHub and installs them into the Sierra environment.

Initialize installer.

PARAMETER DESCRIPTION
repo_manager

Repository manager instance

TYPE: RepositoryManager

environment_path

Path to Sierra environment

TYPE: Path

logger

Logger instance for tracking operations

TYPE: UniversalLogger DEFAULT: None

AttributesLink
logger instance-attribute Link
Python
logger = logger or UniversalLogger('PackageInstaller')
repo_manager instance-attribute Link
Python
repo_manager = repo_manager
env_path instance-attribute Link
Python
env_path = Path(environment_path)
scripts_path instance-attribute Link
Python
scripts_path = self.env_path / 'scripts'
installed_file instance-attribute Link
Python
installed_file = (
    self.repo_manager.config_dir / "installed.json"
)
installed instance-attribute Link
Python
installed: dict[str, dict] = {}
FunctionsLink
load_installed Link
Python
load_installed() -> None

Load installed packages registry.

save_installed Link
Python
save_installed() -> None

Save installed packages registry.

is_installed Link
Python
is_installed(package_name: str) -> bool

Check if package is installed.

get_installed_version Link
Python
get_installed_version(package_name: str) -> str | None

Get installed version of a package.

install Link
Python
install(
    package_name: str,
    registry,
    force: bool = False,
    skip_validation: bool = False,
) -> bool

Install a package.

PARAMETER DESCRIPTION
package_name

Name of package to install

TYPE: str

registry

Package registry

TYPE: PackageRegistry

force

Force reinstall if already installed

TYPE: bool DEFAULT: False

skip_validation

Skip type safety validation

TYPE: bool DEFAULT: False

RETURNS DESCRIPTION
bool

True if successful

RAISES DESCRIPTION
ValueError

If package not found or validation fails

Exception

If installation fails

remove Link
Python
remove(package_name: str) -> bool

Remove an installed package.

PARAMETER DESCRIPTION
package_name

Package to remove

TYPE: str

RETURNS DESCRIPTION
bool

True if successful

RAISES DESCRIPTION
ValueError

If package not installed

list_installed Link
Python
list_installed() -> list[dict]

List all installed packages.

RETURNS DESCRIPTION
list[dict]

List of installed package info