Skip to content

Add pixi support#348

Open
lguerard wants to merge 4 commits into
trackmate-sc:masterfrom
imcf:pixi-support
Open

Add pixi support#348
lguerard wants to merge 4 commits into
trackmate-sc:masterfrom
imcf:pixi-support

Conversation

@lguerard

Copy link
Copy Markdown

This pull request introduces several improvements and new utilities for handling logging and environment management in the TrackMate plugin, with a particular focus on enhancing support for Pixi environments and improving robustness around Conda environment detection. The most significant changes are grouped below by theme.

Pixi Environment Support:

  • Added multiple utility methods to CLIUtils for Pixi support, including detection of Pixi projects, manifest files, user configuration of Pixi paths, and querying Python module versions within Pixi environments. This allows TrackMate to better integrate with Pixi-managed environments. [1] [2]
  • Extended the command builder and CLI process creation logic to handle Pixi environments alongside Conda, including new argument types and launcher checks. [1] [2] [3] [4]

Logging Improvements:

  • Introduced an extraLogger to DetectionPreview and its builder, allowing final preview summaries or errors to be surfaced in a secondary logger (e.g., the main TrackMate log) even when the primary logger is an in-panel widget. [1] [2] [3] [4] [5] [6] [7]

Conda Environment Handling Robustness:

  • Improved robustness of Conda environment detection by adding checks for invalid or missing Conda paths, handling exceptions, and ensuring that failed launches are cached to avoid repeated errors. The default fallback path for Conda was also removed to avoid misleading results. [1] [2] [3] [4] [5]

These changes collectively make environment management more flexible and robust, and improve user feedback during detection previews.

References:
Pixi support [1] [2] [3] [4] [5] [6]
Logging improvements [1] [2] [3] [4] [5] [6] [7]
Conda robustness [1] [2] [3] [4] [5]

lguerard and others added 4 commits June 18, 2026 13:01
…port

Introduces EnvCLIConfigurator, a new base class for CLI configurators
that run a Python tool in a managed environment. It supports both conda
and pixi launchers via a SelectableArguments group keyed "LAUNCHER",
letting the user choose at runtime in the config panel.

Key additions:
- EnvCLIConfigurator: dual-mode base (conda + pixi). Automatically
  defaults to pixi when a pixi projects root is configured.
  Contains CondaEnvironmentCommand and PixiEnvironmentCommand inner
  classes. PixiEnvironmentCommand scans a pixi project directory for
  available environments (.pixi/envs/).
- CondaCLIConfigurator: refactored to a thin wrapper extending
  EnvCLIConfigurator(Launcher.CONDA) for backward compatibility.
- CLIUtils: added pixi utilities — getPixiPath(), getPixiProjectsRoot(),
  getPixiManifestPath(), findPixiProjectsInRoot(), getPixiModuleVersion(),
  runInPixiEnv().
- pixipath/PixiPathConfigCommand: SciJava command for the
  "Configure TrackMate Pixi path…" menu entry.
- pixipath/PixiDetector: detects pixi installations and lists
  available project environments.
- CommandBuilder: updated to handle pixi translator lambdas.
- Configurator: minor API additions needed by PixiEnvironmentCommand.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…panel

ConfigGuiBuilder.visit(PixiEnvironmentCommand) now builds a full pixi
launcher UI inside the detector configuration panel.

When the pixi projects root contains multiple projects a combobox lets
the user pick the project; a second combobox shows the available
environments discovered by scanning .pixi/envs/ inside that project.
When only one project exists a path text field with Browse/Find/Refresh
buttons is shown instead.

In dual-mode panels (conda + pixi) both launchers appear in a row of
labeled radio buttons separated from the conda section by a titled
separator, keeping the panel compact and scrollable.

State management:
- pathElement.onSet hook re-syncs the project combobox and env list
  whenever panel.refresh() is called (e.g. from setSettings()), so
  the saved project path and environment are correctly restored after
  wizard navigation.
- refreshEnvCombo() preserves the currently-selected environment when
  reloading the env list; falls back to the first env only when the
  saved value is absent or no longer valid for the project.
- PixiEnvironmentCommand.set() no longer validates the value against
  the cached env list, which may be empty or stale at deserialization
  time. refreshEnvCombo() is responsible for correcting invalid values
  after the env list is reloaded from the file system.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
DetectionPreview previously logged all output exclusively to a
JLabelLogger — a single-line status label inside the detector
configuration panel. Users looking at the TrackMate info window (opened
via the info button) saw no output after clicking Preview.

A new optional extraLogger field (set via Builder.extraLogger()) receives
only the final summary: "Found N spots." on success or the error message
on failure. GenericDetectionConfigurationPanel wires model.getLogger()
as the extra logger so preview results appear in the info window.

Verbose detection output (command args, progress lines) stays in the
in-panel label only to avoid polluting the main log.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Move conda/pixi visit methods (~390 lines) into a new package-private
LauncherEnvGuiSection class. ConfigGuiBuilder delegates via two-line
stubs. Result: ConfigGuiBuilder 800 lines, LauncherEnvGuiSection 465 lines.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant