Sandbox
sandbox
Session sandbox: redirect the six AXM state paths to an ephemeral root.
The sandbox lives entirely in the inherited environment (AXM_SANDBOX_*
keys), never in module state, so a child process spawned while a sandbox is
active reconstructs the same sandbox and the same launch profile. In any
process where AXM_SANDBOX_ROOT is absent, :func:active_sandbox returns
None and every resolver behaves exactly as before.
This module must not import :mod:axm_config.paths nor
:mod:axm_config.profile: profile.current_profile depends on it.
SandboxEscapeError
Bases: ConfigError
A launch variable points a sandboxed path at the real AXM state.
SessionSandbox
dataclass
An active session sandbox and the launch values it was built from.
previous records the AXM_SANDBOX_* and AXM_PROFILE values seen
at activation so :func:deactivate_sandbox can restore them exactly
(nested in-process sessions). It is empty on a sandbox reconstructed from
the environment by :func:active_sandbox.
Source code in packages/axm-config/src/axm_config/sandbox.py
activate_sandbox(root, environ=None)
Publish a sandbox on root in environ and strip AXM_PROFILE.
Raises :class:SandboxEscapeError when one of the six launch variables
resolves at or under <HOME>/axm or <HOME>/.axm. Creates no
directory: the caller owns the root.
Source code in packages/axm-config/src/axm_config/sandbox.py
active_sandbox(environ=None)
Return the sandbox published in environ, or None when inactive.
Source code in packages/axm-config/src/axm_config/sandbox.py
deactivate_sandbox(sandbox, environ=None)
Restore the environment sandbox replaced at activation.