Package io.jenkins.plugins.python
Class UvInstaller
java.lang.Object
io.jenkins.plugins.python.UvInstaller
- All Implemented Interfaces:
Serializable
Provisions standalone Astral
uv (and uvx) binaries across Linux, macOS,
and Windows agents, supporting version pinning, local agent tool caching, and corporate mirrors.- See Also:
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionstatic StringbuildDownloadUrl(String uvVersion, String platformKey, String customMirrorUrl) Builds the download URL for the uv archive, honoring custom mirror overrides or system properties.static FilePathfindExistingUvBinDir(FilePath pythonHome) Checks whether an existing Python installation directory already contains a pre-installeduvbinary.static StringgetArchiveFilename(String platformKey) Returns the archive filename for a given platformKey (fromPlatformUtils.detectPlatformKey(hudson.model.Node, hudson.model.TaskListener)).static FilePathgetUvExecutable(FilePath uvBinDir, boolean isUnix) Resolves the executable path foruvinside a directory known to contain it.static voidinstallIntoPythonHome(FilePath pyHome, Node node, TaskListener log, String uvVersion, String customMirrorUrl) Installsuvanduvxbinaries directly into an existing standalone Python home directory (bin/on Unix orScripts/on Windows).static StringnormalizeVersion(String uvVersion) Normalizes a user-supplied uv version string (e.g.static FilePathprovisionUv(Node node, FilePath workspaceFallback, TaskListener log, String uvVersion, String customMirrorUrl) Provisionsuvinto the agent's shared tool cache directory and returns the directory containing theuvbinary.
-
Field Details
-
DEFAULT_UV_BASE_URL
- See Also:
-
-
Method Details
-
normalizeVersion
Normalizes a user-supplied uv version string (e.g. null, "", "latest", "v0.13.1" -> "0.13.1"). -
getArchiveFilename
Returns the archive filename for a given platformKey (fromPlatformUtils.detectPlatformKey(hudson.model.Node, hudson.model.TaskListener)). -
buildDownloadUrl
Builds the download URL for the uv archive, honoring custom mirror overrides or system properties. -
findExistingUvBinDir
public static FilePath findExistingUvBinDir(FilePath pythonHome) throws IOException, InterruptedException Checks whether an existing Python installation directory already contains a pre-installeduvbinary.- Throws:
IOExceptionInterruptedException
-
getUvExecutable
public static FilePath getUvExecutable(FilePath uvBinDir, boolean isUnix) throws IOException, InterruptedException Resolves the executable path foruvinside a directory known to contain it.- Throws:
IOExceptionInterruptedException
-
provisionUv
public static FilePath provisionUv(Node node, FilePath workspaceFallback, TaskListener log, String uvVersion, String customMirrorUrl) throws IOException, InterruptedException Provisionsuvinto the agent's shared tool cache directory and returns the directory containing theuvbinary.- Throws:
IOExceptionInterruptedException
-
installIntoPythonHome
public static void installIntoPythonHome(FilePath pyHome, Node node, TaskListener log, String uvVersion, String customMirrorUrl) throws IOException, InterruptedException Installsuvanduvxbinaries directly into an existing standalone Python home directory (bin/on Unix orScripts/on Windows).- Throws:
IOExceptionInterruptedException
-