diff --git a/README.md b/README.md index 6740382..4d6d7b0 100644 --- a/README.md +++ b/README.md @@ -112,6 +112,8 @@ according to your preferences.
Set the full paths of the Python and the package installer for Python executables, which allows Exhort to locate and run the `pip3` commands to resolve dependencies for Python projects.
Python 2 executables `python` and `pip` can be used instead, if the `Use python 2.x` option is selected. +
Optionally, set the full path of the `uv` executable, which allows Exhort to use `uv` as the package resolver + for Python projects.
If the paths are not provided, your IDE's `PATH` environment will be used to locate the executables.
When option `Strictly match package version` is selected, the resolved dependency versions will be compared to the versions specified in the manifest file, and users will be alerted if any mismatch is detected. @@ -204,6 +206,7 @@ according to your preferences. * `TRUSTIFY_DA_DOCKER_PATH` : Specify the absolute path of `docker` executable. * `TRUSTIFY_DA_PODMAN_PATH` : Specify the absolute path of `podman` executable. * `TRUSTIFY_DA_IMAGE_PLATFORM` : Specify the platform used for multi-arch images. + * `TRUSTIFY_DA_UV_PATH` : Specify the absolute path of `uv` executable. * `TRUSTIFY_DA_MVN_USER_SETTINGS` : Specify the absolute path to the Maven user settings file. * `TRUSTIFY_DA_MVN_LOCAL_REPO` : Specify the absolute path to the Maven local repository. diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 07a4627..f28bd72 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -3,8 +3,8 @@ caffeine = "3.1.8" commons-compress = "1.21" commons-io = "2.16.1" -trustify-da-api-spec = "2.0.2" -trustify-da-java-client = "0.0.16" +trustify-da-api-spec = "2.0.7" +trustify-da-java-client = "0.0.17" github-api = "1.314" junit = "4.13.2" mockito = "5.14.2" diff --git a/src/main/java/org/jboss/tools/intellij/exhort/ApiService.java b/src/main/java/org/jboss/tools/intellij/exhort/ApiService.java index 6b7dc3b..30f0921 100644 --- a/src/main/java/org/jboss/tools/intellij/exhort/ApiService.java +++ b/src/main/java/org/jboss/tools/intellij/exhort/ApiService.java @@ -274,6 +274,11 @@ public static void setCommonRequestProperties() { System.clearProperty("TRUSTIFY_DA_PYTHON_PATH"); System.clearProperty("TRUSTIFY_DA_PIP_PATH"); } + if (settings.uvPath != null && !settings.uvPath.isBlank()) { + System.setProperty("TRUSTIFY_DA_UV_PATH", settings.uvPath); + } else { + System.clearProperty("TRUSTIFY_DA_UV_PATH"); + } if (settings.usePythonVirtualEnv) { System.setProperty("TRUSTIFY_DA_PYTHON_VIRTUAL_ENV", "true"); if (settings.pythonInstallBestEfforts) { diff --git a/src/main/java/org/jboss/tools/intellij/settings/ApiSettingsComponent.java b/src/main/java/org/jboss/tools/intellij/settings/ApiSettingsComponent.java index 769a509..00801ab 100644 --- a/src/main/java/org/jboss/tools/intellij/settings/ApiSettingsComponent.java +++ b/src/main/java/org/jboss/tools/intellij/settings/ApiSettingsComponent.java @@ -56,6 +56,8 @@ public class ApiSettingsComponent { + "
Specifies absolute path of python executable."; private final static String pipPathLabel = "Pip > Executable: Path" + "
Specifies absolute path of pip executable."; + private final static String uvPathLabel = "uv > Executable: Path" + + "
Specifies absolute path of uv executable."; private final static String usePython2Label = "Python > Executable: Version" + "
Specifies if using python 2.x."; private final static String usePythonVirtualEnvLabel = "Python > Virtual Environment" @@ -106,6 +108,7 @@ public class ApiSettingsComponent { private final JBCheckBox goMatchManifestVersionsCheck; private final TextFieldWithBrowseButton pythonPathText; private final TextFieldWithBrowseButton pipPathText; + private final TextFieldWithBrowseButton uvPathText; private final JBCheckBox usePython2Check; private final JBCheckBox usePythonVirtualEnvCheck; private final JBCheckBox pythonInstallBestEffortsCheck; @@ -200,6 +203,13 @@ public ApiSettingsComponent() { TextComponentAccessor.TEXT_FIELD_WHOLE_TEXT ); + uvPathText = new TextFieldWithBrowseButton(); + uvPathText.addBrowseFolderListener( + null, + FileChooserDescriptorFactory.singleFile(), + TextComponentAccessor.TEXT_FIELD_WHOLE_TEXT + ); + usePython2Check = new JBCheckBox("Use python 2.x"); usePythonVirtualEnvCheck = new JBCheckBox("Use python virtual environment"); @@ -308,6 +318,8 @@ public ApiSettingsComponent() { .addVerticalGap(10) .addLabeledComponent(new JBLabel(pipPathLabel), pipPathText, 1, true) .addVerticalGap(10) + .addLabeledComponent(new JBLabel(uvPathLabel), uvPathText, 1, true) + .addVerticalGap(10) .addLabeledComponent(new JBLabel(usePython2Label), usePython2Check, 1, true) .addVerticalGap(10) .addLabeledComponent(new JBLabel(usePythonVirtualEnvLabel), usePythonVirtualEnvCheck, 1, true) @@ -459,6 +471,15 @@ public void setPipPathText(@NotNull String text) { pipPathText.setText(text); } + @NotNull + public String getUvPathText() { + return uvPathText.getText(); + } + + public void setUvPathText(@NotNull String text) { + uvPathText.setText(text); + } + public boolean getUsePython2Check() { return usePython2Check.isSelected(); } diff --git a/src/main/java/org/jboss/tools/intellij/settings/ApiSettingsConfigurable.java b/src/main/java/org/jboss/tools/intellij/settings/ApiSettingsConfigurable.java index 817d844..e973c3b 100644 --- a/src/main/java/org/jboss/tools/intellij/settings/ApiSettingsConfigurable.java +++ b/src/main/java/org/jboss/tools/intellij/settings/ApiSettingsConfigurable.java @@ -57,6 +57,7 @@ public boolean isModified() { modified |= settingsComponent.getGoMatchManifestVersionsCheck() != settings.goMatchManifestVersions; modified |= !settingsComponent.getPythonPathText().equals(settings.pythonPath); modified |= !settingsComponent.getPipPathText().equals(settings.pipPath); + modified |= !Objects.equals(settingsComponent.getUvPathText(), settings.uvPath); modified |= settingsComponent.getUsePython2Check() != settings.usePython2; modified |= settingsComponent.getUsePythonVirtualEnvCheck() != settings.usePythonVirtualEnv; modified |= settingsComponent.getPythonInstallBestEffortsCheck() != settings.pythonInstallBestEfforts; @@ -94,6 +95,7 @@ public void apply() { settings.goMatchManifestVersions = settingsComponent.getGoMatchManifestVersionsCheck(); settings.pythonPath = settingsComponent.getPythonPathText(); settings.pipPath = settingsComponent.getPipPathText(); + settings.uvPath = settingsComponent.getUvPathText(); settings.usePython2 = settingsComponent.getUsePython2Check(); settings.usePythonVirtualEnv = settingsComponent.getUsePythonVirtualEnvCheck(); settings.pythonInstallBestEfforts = settingsComponent.getPythonInstallBestEffortsCheck(); @@ -160,6 +162,7 @@ public void reset() { settingsComponent.setGoMatchManifestVersionsCheck(settings.goMatchManifestVersions); settingsComponent.setPythonPathText(settings.pythonPath != null ? settings.pythonPath : ""); settingsComponent.setPipPathText(settings.pipPath != null ? settings.pipPath : ""); + settingsComponent.setUvPathText(settings.uvPath != null ? settings.uvPath : ""); settingsComponent.setUsePython2Check(settings.usePython2); settingsComponent.setUsePythonVirtualEnvCheck(settings.usePythonVirtualEnv); settingsComponent.setPythonInstallBestEffortsCheck(settings.pythonInstallBestEfforts); diff --git a/src/main/java/org/jboss/tools/intellij/settings/ApiSettingsState.java b/src/main/java/org/jboss/tools/intellij/settings/ApiSettingsState.java index c9bea11..66f68ab 100644 --- a/src/main/java/org/jboss/tools/intellij/settings/ApiSettingsState.java +++ b/src/main/java/org/jboss/tools/intellij/settings/ApiSettingsState.java @@ -49,6 +49,7 @@ public final class ApiSettingsState implements PersistentStateComponent