Debug Session#
Interactive debugging for conda recipe builds. Set up the full build environment without running the build, then iteratively run, inspect, and modify the build script.
DebugSession#
Interactive debugging session for a conda recipe.
Use :meth:create to set up the environment. Then call :meth:run_script
to execute the build, inspect results, modify files, and re-run.
Example::
session = DebugSession.create(variant, channels=["conda-forge"])
result = session.run_script(trace=True)
print(result.stdout)
create
classmethod
#
create(
variant,
*,
tool_config=None,
output_dir=None,
channels=None,
no_build_id=True,
progress_callback=None,
)
Create a debug session from a rendered variant.
This resolves dependencies, fetches sources, installs environments, and creates the build script — all without running the actual build.
Parameters#
variant:
A rendered variant from recipe.render().
tool_config:
Optional tool configuration. Uses defaults if not provided.
output_dir:
Where to write build artifacts. A temporary directory is used if
not specified.
channels:
Conda channels to use. Defaults to ["conda-forge"].
no_build_id:
If True (default), omit the build ID from directory paths,
giving stable paths across iterations.
progress_callback:
Optional callback for progress events during setup.
Returns#
DebugSession A session with the environment fully set up and ready to run.
run_script #
add_packages #
create_patch #
create_patch(
name="changes",
*,
output_dir=None,
overwrite=False,
exclude=None,
add=None,
include=None,
dry_run=False,
)
Create a patch from changes in the work directory.
Parameters#
name:
Patch file name (without extension).
output_dir:
Where to write the patch file. Defaults to the recipe directory.
overwrite:
Overwrite existing patch file.
exclude:
Glob patterns to exclude from the patch.
add:
Glob patterns for untracked files to include.
include:
Glob patterns to restrict the patch to.
dry_run:
If True, print the patch without writing it.
Returns#
str Empty string on success.
DebugPaths#
All paths associated with a debug session.