Package org.openrewrite.python
Class DependencyWorkspace
java.lang.Object
org.openrewrite.python.DependencyWorkspace
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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic @Nullable PathgetOrCreateSetuptoolsWorkspace(String manifestContent, @Nullable Path projectDir) Gets or creates a workspace directory for a setuptools project (setup.cfg / setup.py).
-
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). Usesuv 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 hashingprojectDir- The project directory to install from, or null- Returns:
- Path to the workspace directory, or null if uv is unavailable
-