Package org.openrewrite.python
Class Assertions
java.lang.Object
org.openrewrite.python.Assertions
-
Method Summary
Modifier and TypeMethodDescriptionstatic org.openrewrite.test.SourceSpecsCreates a pyproject.toml source spec for use with uv().static org.openrewrite.test.SourceSpecspyproject(@Nullable String before, Consumer<org.openrewrite.test.SourceSpec<org.openrewrite.text.PlainText>> spec) Creates a pyproject.toml source spec for use with uv().static org.openrewrite.test.SourceSpecsstatic org.openrewrite.test.SourceSpecsstatic org.openrewrite.test.SourceSpecspython(@Nullable String before, String after, Consumer<org.openrewrite.test.SourceSpec<org.openrewrite.python.tree.Py.CompilationUnit>> spec) static org.openrewrite.test.SourceSpecspython(@Nullable String before, Consumer<org.openrewrite.test.SourceSpec<org.openrewrite.python.tree.Py.CompilationUnit>> spec) static org.openrewrite.test.SourceSpecsSets up a Python project with dependencies installed for type attribution.
-
Method Details
-
uv
public static org.openrewrite.test.SourceSpecs uv(Path relativeTo, org.openrewrite.test.SourceSpecs... sources) Sets up a Python project with dependencies installed for type attribution. Similar to the JavaScript npm() helper, this creates a cached workspace with dependencies from pyproject.toml and symlinks the virtual environment.- Parameters:
relativeTo- The test directory where files should be writtensources- Source specs including Python files and optionally pyproject.toml- Returns:
- SourceSpecs wrapped in a directory context
-
pyproject
Creates a pyproject.toml source spec for use with uv(). The content is treated as plain text since we only need to write it to disk for the Python dependency workspace to use. -
pyproject
public static org.openrewrite.test.SourceSpecs pyproject(@Language("toml") @Nullable String before, Consumer<org.openrewrite.test.SourceSpec<org.openrewrite.text.PlainText>> spec) Creates a pyproject.toml source spec for use with uv(). -
python
-
python
-
python
-
python
-