spacr._starplast

Install and launch the separate Starplast desktop application.

Starplast uses PyQt6 and never imports into spaCR’s PySide6 process. Its environment lives under ~/.spacr/apps (or SPACR_APPS_DIR). Installation reuses the segmentation installers’ interpreter discovery, isolated command environment and cancellable subprocess runner, without registering a detector.

Attributes

PYPI_PACKAGE

Install the latest compatible stable release from the official PyPI index.

REPOSITORY

Optional explicit source for development installations.

Functions

apps_root(→ pathlib.Path)

Return the external-application folder without creating it.

check_starplast_update(→ dict)

Compare the actual isolated installation with compatible stable PyPI releases.

default_source(→ str)

Use PyPI unless a developer explicitly overrides the installation source.

install_starplast(→ pathlib.Path)

Build an isolated environment, install Starplast and check its bundled data.

is_installed(→ bool)

Whether an owned environment has passed the import and bundled-data checks.

launch_starplast(*[, root, popen])

Start Starplast as a separate process, logging output beside its environment.

process_environment(→ dict)

Isolate Python, pip and Qt plugin lookup from the running spaCR process.

upgrade_starplast(→ pathlib.Path)

Upgrade the owned environment using pip and PyPI, then verify its data.

Module Contents

spacr._starplast.apps_root(root=None) → pathlib.Path[source]

Return the external-application folder without creating it.

Parameters:

root – explicit folder, otherwise SPACR_APPS_DIR or ~/.spacr/apps.

Returns:

absolute application root.

spacr._starplast.check_starplast_update(*, root=None, cancel=None, runner=None) → dict[source]

Compare the actual isolated installation with compatible stable PyPI releases.

Parameters:
  • root – external-application folder.

  • cancel – optional cancellation event for subprocesses.

  • runner – optional cancellable command runner for tests.

Returns:

installed/latest version strings and an available boolean.

Raises:

RuntimeError – the installation or package index cannot be checked.

spacr._starplast.default_source() → str[source]

Use PyPI unless a developer explicitly overrides the installation source.

Returns:

SPACR_STARPLAST_SOURCE or the unpinned PyPI package name.

spacr._starplast.install_starplast(source=None, *, root=None, progress=None, cancel=None, runner=None, preflight=None) → pathlib.Path[source]

Build an isolated environment, install Starplast and check its bundled data.

Local Git sources are archived from committed HEAD into temporary storage; pip never writes build files into the original checkout. A failed install removes only the environment created here, and retains starplast-install.log.

Parameters:
  • source – starplast on PyPI, or an explicit local Git checkout or repository URL; default_source otherwise. PyPI resolves the latest compatible stable release at installation time, without a version pin.

  • root – external-application folder.

  • progress – callback (step, steps, text); called off the GUI thread.

  • cancel – threading.Event; cancels commands and their descendants.

  • runner – optional subprocess-runner substitute for focused tests.

  • preflight – optional interpreter-preflight substitute for focused tests.

Returns:

completed environment path.

Raises:
  • RuntimeError – installation failed, was cancelled, or folder is unowned.

  • ValueError – the selected source is neither a suitable local Git checkout, the PyPI package, nor an allowed official repository URL.

spacr._starplast.is_installed(root=None) → bool[source]

Whether an owned environment has passed the import and bundled-data checks.

Parameters:

root – external-application folder.

Returns:

true only with a completed record and environment interpreter.

spacr._starplast.launch_starplast(*, root=None, popen=None)[source]

Start Starplast as a separate process, logging output beside its environment.

Parameters:
  • root – external-application folder.

  • popen – optional subprocess.Popen substitute for focused tests.

Returns:

child process, which the UI monitors for launch errors.

Raises:

RuntimeError – no completed environment exists.

spacr._starplast.process_environment(env: pathlib.Path) → dict[source]

Isolate Python, pip and Qt plugin lookup from the running spaCR process.

Parameters:

env – Starplast’s virtual environment.

Returns:

subprocess variables retaining desktop display and user settings.

spacr._starplast.upgrade_starplast(source=None, *, root=None, progress=None, cancel=None, runner=None) → pathlib.Path[source]

Upgrade the owned environment using pip and PyPI, then verify its data.

Parameters:
  • source – ignored; upgrades always use the PyPI Starplast package.

  • root – external-application folder.

  • progress – optional (step, total, text) callback.

  • cancel – optional subprocess cancellation event.

  • runner – optional command runner for tests.

Returns:

verified environment path.

Raises:

RuntimeError – upgrade failed or was cancelled. Files and logs remain for diagnosis; an interrupted environment must be repaired before launch.

spacr._starplast.PYPI_PACKAGE = 'starplast'[source]

Install the latest compatible stable release from the official PyPI index.

spacr._starplast.REPOSITORY = 'git+https://github.com/EinarOlafsson/starplast.git@main'[source]

Optional explicit source for development installations.

Nested helpers

install_starplast.line(text, number=number, label=label)

Persist all subprocess output and send the latest line to Qt.

spacr/_starplast.py:192

upgrade_starplast.line(text, number=number, label=label)

Persist pip diagnostics and update the progress display.

spacr/_starplast.py:296