Skip to content

Commit 27101f0

Browse files
committed
Note in dependency-recipe descriptions that they aren't safe as preconditions
1 parent a4b965a commit 27101f0

5 files changed

Lines changed: 15 additions & 5 deletions

File tree

rewrite-python/src/main/java/org/openrewrite/python/AddDependency.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,9 @@ public String getDescription() {
9494
return "Add a dependency to a Python project. Supports `pyproject.toml` " +
9595
"(with scope/group targeting), `requirements.txt`, and `Pipfile`. " +
9696
"When the matching package manager (`uv` or `pipenv`) is available, " +
97-
"the corresponding lock file (`uv.lock` or `Pipfile.lock`) is regenerated.";
97+
"the corresponding lock file (`uv.lock` or `Pipfile.lock`) is regenerated. " +
98+
"Not safe to use as a precondition: invokes the package manager and " +
99+
"publishes per-project state shared with other dependency recipes.";
98100
}
99101

100102
static class Accumulator {

rewrite-python/src/main/java/org/openrewrite/python/ChangeDependency.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,9 @@ public String getDescription() {
7373
return "Change a dependency to a different package. Supports `pyproject.toml`, " +
7474
"`requirements.txt`, and `Pipfile`. Searches all dependency scopes. " +
7575
"When the matching package manager (`uv` or `pipenv`) is available, " +
76-
"the corresponding lock file (`uv.lock` or `Pipfile.lock`) is regenerated.";
76+
"the corresponding lock file (`uv.lock` or `Pipfile.lock`) is regenerated. " +
77+
"Not safe to use as a precondition: invokes the package manager and " +
78+
"publishes per-project state shared with other dependency recipes.";
7779
}
7880

7981
static class Accumulator {

rewrite-python/src/main/java/org/openrewrite/python/RemoveDependency.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,9 @@ public String getDescription() {
8686
return "Remove a dependency from a Python project. Supports `pyproject.toml` " +
8787
"(with scope/group targeting), `requirements.txt`, and `Pipfile`. " +
8888
"When the matching package manager (`uv` or `pipenv`) is available, " +
89-
"the corresponding lock file (`uv.lock` or `Pipfile.lock`) is regenerated.";
89+
"the corresponding lock file (`uv.lock` or `Pipfile.lock`) is regenerated. " +
90+
"Not safe to use as a precondition: invokes the package manager and " +
91+
"publishes per-project state shared with other dependency recipes.";
9092
}
9193

9294
static class Accumulator {

rewrite-python/src/main/java/org/openrewrite/python/UpgradeDependencyVersion.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,9 @@ public String getDescription() {
9191
return "Upgrade the version constraint for a dependency. Supports `pyproject.toml` " +
9292
"(with scope/group targeting), `requirements.txt`, and `Pipfile`. " +
9393
"When the matching package manager (`uv` or `pipenv`) is available, " +
94-
"the corresponding lock file (`uv.lock` or `Pipfile.lock`) is regenerated.";
94+
"the corresponding lock file (`uv.lock` or `Pipfile.lock`) is regenerated. " +
95+
"Not safe to use as a precondition: invokes the package manager and " +
96+
"publishes per-project state shared with other dependency recipes.";
9597
}
9698

9799
static class Accumulator {

rewrite-python/src/main/java/org/openrewrite/python/UpgradeTransitiveDependencyVersion.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,9 @@ public String getDescription() {
7171
return "Pin a transitive dependency version using the strategy appropriate for the file type " +
7272
"and package manager. For `pyproject.toml`: uv uses `[tool.uv].constraint-dependencies`, " +
7373
"PDM uses `[tool.pdm.overrides]`, and other managers add a direct dependency. " +
74-
"For `requirements.txt` and `Pipfile`: appends the dependency.";
74+
"For `requirements.txt` and `Pipfile`: appends the dependency. " +
75+
"Not safe to use as a precondition: invokes the package manager and " +
76+
"publishes per-project state shared with other dependency recipes.";
7577
}
7678

7779
static class Accumulator {

0 commit comments

Comments
 (0)