Skip to content

WorkspaceBuilder: make the classic builder selectable by dotted path #1059

Description

@tony

Summary

Add the first implementation step from #1058: make the current builder the explicit classic/default builder and let users select a workspace builder by Python dotted path.

Related: #1053, #1056, #1058.

Proposed behavior

  • Preserve current load behavior unless a workspace explicitly opts in.
  • Treat the current builder as the classic builder and keep it as the default.
  • Add a workspace_builder config key with default tmuxp.workspace.builder.WorkspaceBuilder.
  • Add an optional workspace_builder_paths list for trusted user-controlled import roots when tmuxp's runtime environment does not already see the builder package.
  • Resolve workspace_builder_paths by expanding ~ and environment variables, resolving relative paths relative to the workspace file, requiring entries to be directories, and temporarily prepending them to sys.path for the builder import/build duration.
  • Do not use site.addsitedir() for workspace-config paths; site-directory processing can execute startup files and is broader than making a module importable.
  • Validate the imported object is a builder class or compatible builder before use.
  • Keep pane-readiness policy and parallel behavior out of this PR.

Example shape:

workspace_builder: my_tmuxp_builders.CustomBuilder
workspace_builder_paths:
  - ~/.config/tmuxp/builders

Acceptance criteria

  • Existing workspace files load through the classic default unchanged.
  • A workspace can select a builder by dotted path.
  • A workspace can add explicit trusted import roots without .pth or site startup processing.
  • Import errors are actionable and do not leak machine-specific details.
  • Tests cover default selection, dotted path selection, path-assisted selection, missing path failure, and invalid target failure.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions