spacr._parascape

Install and launch the separate ParaScape desktop application.

ParaScape 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

MINIMUM_VERSION

Oldest release spaCR installs; compared with packaging.version.Version.

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_parascape_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.

gui_command(→ pathlib.Path)

Return the parascape console script of an environment.

install_parascape(→ pathlib.Path)

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

is_installed(→ bool)

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

launch_parascape(*[, root, popen])

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

process_environment(→ dict)

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

pypi_requirement(→ str)

Return the pip requirement that installs or upgrades from PyPI.

upgrade_parascape(→ pathlib.Path)

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

Module Contents

spacr._parascape.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._parascape.check_parascape_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._parascape.default_source() → str[source]

Use PyPI unless a developer explicitly overrides the installation source.

Returns:

SPACR_PARASCAPE_SOURCE or the unpinned PyPI package name.

spacr._parascape.gui_command(env: pathlib.Path) → pathlib.Path[source]

Return the parascape console script of an environment.

Parameters:

env – ParaScape’s virtual environment.

Returns:

the script beside the environment’s interpreter, with the interpreter’s suffix (.exe on Windows).

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

Build an isolated environment, install ParaScape 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 parascape-install.log.

Parameters:
  • source – parascape 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._parascape.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._parascape.launch_parascape(*, root=None, popen=None)[source]

Start ParaScape 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._parascape.process_environment(env: pathlib.Path) → dict[source]

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

Parameters:

env – ParaScape’s virtual environment.

Returns:

subprocess variables retaining desktop display and user settings.

spacr._parascape.pypi_requirement() → str[source]

Return the pip requirement that installs or upgrades from PyPI.

Returns:

the package name with its minimum supported release.

spacr._parascape.upgrade_parascape(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 ParaScape 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._parascape.MINIMUM_VERSION = '0.0.1.0'[source]

Oldest release spaCR installs; compared with packaging.version.Version.

spacr._parascape.PYPI_PACKAGE = 'parascape'[source]

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

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

Optional explicit source for development installations.

Nested helpers

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

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

spacr/_parascape.py:213

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

Persist pip diagnostics and update the progress display.

spacr/_parascape.py:317