Class DependencyWorkspace

java.lang.Object
org.openrewrite.python.DependencyWorkspace

public class DependencyWorkspace extends Object
Manages workspace directories for Python projects with dependencies. Creates cached workspaces with pyproject.toml and installed virtual environments to enable proper type attribution via ty LSP.
  • Constructor Details

    • DependencyWorkspace

      public DependencyWorkspace()
  • Method Details

    • getOrCreateSetuptoolsWorkspace

      public static @Nullable Path getOrCreateSetuptoolsWorkspace(String manifestContent, @Nullable Path projectDir)
      Gets or creates a workspace directory for a setuptools project (setup.cfg / setup.py). Uses uv pip install <projectDir> to install the project and its dependencies. Returns null (graceful degradation) when uv is unavailable.
      Parameters:
      manifestContent - The setup.cfg (or setup.py) content for hashing
      projectDir - The project directory to install from, or null
      Returns:
      Path to the workspace directory, or null if uv is unavailable