Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,8 @@ according to your preferences.
<br >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.
<br >Python 2 executables `python` and `pip` can be used instead, if the `Use python 2.x` option is selected.
<br >Optionally, set the full path of the `uv` executable, which allows Exhort to use `uv` as the package resolver
for Python projects.
<br >If the paths are not provided, your IDE's `PATH` environment will be used to locate the executables.
<br >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.
Expand Down Expand Up @@ -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.

Expand Down
4 changes: 2 additions & 2 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
5 changes: 5 additions & 0 deletions src/main/java/org/jboss/tools/intellij/exhort/ApiService.java
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@ public class ApiSettingsComponent {
+ "<br>Specifies absolute path of <b>python</b> executable.</html>";
private final static String pipPathLabel = "<html>Pip > Executable: <b>Path</b>"
+ "<br>Specifies absolute path of <b>pip</b> executable.</html>";
private final static String uvPathLabel = "<html>uv > Executable: <b>Path</b>"
+ "<br>Specifies absolute path of <b>uv</b> executable.</html>";
private final static String usePython2Label = "<html>Python > Executable: <b>Version</b>"
+ "<br>Specifies if using python 2.x.</html>";
private final static String usePythonVirtualEnvLabel = "<html>Python > Virtual Environment"
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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");
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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();
Expand Down Expand Up @@ -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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ public final class ApiSettingsState implements PersistentStateComponent<ApiSetti

public String pythonPath;
public String pipPath;
public String uvPath;
public boolean usePython2;
public boolean usePythonVirtualEnv;
public boolean pythonMatchManifestVersions;
Expand Down
Loading