-
Notifications
You must be signed in to change notification settings - Fork 514
Propagate SSL/proxy environment to pip and uv subprocesses #7012
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 3 commits
e78d1e6
fb5e0f5
cce0d1a
b52e17c
9525e94
4d8914a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -23,7 +23,9 @@ | |
| import java.nio.charset.StandardCharsets; | ||
| import java.nio.file.Files; | ||
| import java.nio.file.Path; | ||
| import java.util.Collections; | ||
| import java.util.Comparator; | ||
| import java.util.Map; | ||
|
|
||
| /** | ||
| * Utility for regenerating uv.lock files by running {@code uv lock} in a temporary directory. | ||
|
|
@@ -53,7 +55,7 @@ public static Result failure(String errorMessage) { | |
| * @return a result containing the new lock file content, or an error message | ||
| */ | ||
| public static Result regenerate(String pyprojectContent) { | ||
| return regenerate(pyprojectContent, null); | ||
| return regenerate(pyprojectContent, null, Collections.emptyMap()); | ||
| } | ||
|
|
||
| /** | ||
|
|
@@ -67,6 +69,21 @@ public static Result regenerate(String pyprojectContent) { | |
| * @return a result containing the new lock file content, or an error message | ||
| */ | ||
| public static Result regenerate(String pyprojectContent, @Nullable String existingLockContent) { | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. same comment as above. AIs tends to want to leave things for backwards compatibility, but if leaving it opens us up for bugs, better to remove aggressively.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The other one was unused so I removed it, this one is still being used. |
||
| return regenerate(pyprojectContent, existingLockContent, Collections.emptyMap()); | ||
| } | ||
|
|
||
| /** | ||
| * Regenerate a uv.lock file from the given pyproject.toml content. | ||
| * When an existing lock file is provided it is seeded into the working | ||
| * directory so that {@code uv lock} performs a minimal update rather | ||
| * than re-resolving every dependency from scratch. | ||
| * | ||
| * @param pyprojectContent the pyproject.toml content to lock | ||
| * @param existingLockContent the current uv.lock content, or {@code null} | ||
| * @param environment additional environment variables for subprocess (e.g., SSL_CERT_FILE) | ||
| * @return a result containing the new lock file content, or an error message | ||
| */ | ||
| public static Result regenerate(String pyprojectContent, @Nullable String existingLockContent, Map<String, String> environment) { | ||
| String uvPath = UvExecutor.findUvExecutable(); | ||
| if (uvPath == null) { | ||
| return Result.failure("uv is not installed. Install it with: pip install uv"); | ||
|
|
@@ -88,7 +105,7 @@ public static Result regenerate(String pyprojectContent, @Nullable String existi | |
| ); | ||
| } | ||
|
|
||
| UvExecutor.RunResult runResult = UvExecutor.run(tempDir, uvPath, "lock"); | ||
| UvExecutor.RunResult runResult = UvExecutor.run(tempDir, uvPath, environment, "lock"); | ||
| if (!runResult.isSuccess()) { | ||
| return Result.failure("uv lock failed (exit code " + runResult.getExitCode() + "): " + runResult.getStderr()); | ||
| } | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.