Skip to content

Commit 9cc3756

Browse files
a-orenclaude
andcommitted
feat(python): add uv path settings and bump java client (TC-3860)
Add uv executable path setting to the settings UI with TRUSTIFY_DA_UV_PATH system property propagation. Bump trustify-da-java-client to 0.0.17-SNAPSHOT and api-spec to 2.0.7 for pip report-based pyproject.toml support and uv provider. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent c19e597 commit 9cc3756

5 files changed

Lines changed: 32 additions & 2 deletions

File tree

gradle/libs.versions.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
caffeine = "3.1.8"
44
commons-compress = "1.21"
55
commons-io = "2.16.1"
6-
trustify-da-api-spec = "2.0.2"
7-
trustify-da-java-client = "0.0.16"
6+
trustify-da-api-spec = "2.0.7"
7+
trustify-da-java-client = "0.0.17-SNAPSHOT"
88
github-api = "1.314"
99
junit = "4.13.2"
1010
mockito = "5.14.2"

src/main/java/org/jboss/tools/intellij/exhort/ApiService.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -274,6 +274,11 @@ public static void setCommonRequestProperties() {
274274
System.clearProperty("TRUSTIFY_DA_PYTHON_PATH");
275275
System.clearProperty("TRUSTIFY_DA_PIP_PATH");
276276
}
277+
if (settings.uvPath != null && !settings.uvPath.isBlank()) {
278+
System.setProperty("TRUSTIFY_DA_UV_PATH", settings.uvPath);
279+
} else {
280+
System.clearProperty("TRUSTIFY_DA_UV_PATH");
281+
}
277282
if (settings.usePythonVirtualEnv) {
278283
System.setProperty("TRUSTIFY_DA_PYTHON_VIRTUAL_ENV", "true");
279284
if (settings.pythonInstallBestEfforts) {

src/main/java/org/jboss/tools/intellij/settings/ApiSettingsComponent.java

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,8 @@ public class ApiSettingsComponent {
5656
+ "<br>Specifies absolute path of <b>python</b> executable.</html>";
5757
private final static String pipPathLabel = "<html>Pip > Executable: <b>Path</b>"
5858
+ "<br>Specifies absolute path of <b>pip</b> executable.</html>";
59+
private final static String uvPathLabel = "<html>uv > Executable: <b>Path</b>"
60+
+ "<br>Specifies absolute path of <b>uv</b> executable.</html>";
5961
private final static String usePython2Label = "<html>Python > Executable: <b>Version</b>"
6062
+ "<br>Specifies if using python 2.x.</html>";
6163
private final static String usePythonVirtualEnvLabel = "<html>Python > Virtual Environment"
@@ -106,6 +108,7 @@ public class ApiSettingsComponent {
106108
private final JBCheckBox goMatchManifestVersionsCheck;
107109
private final TextFieldWithBrowseButton pythonPathText;
108110
private final TextFieldWithBrowseButton pipPathText;
111+
private final TextFieldWithBrowseButton uvPathText;
109112
private final JBCheckBox usePython2Check;
110113
private final JBCheckBox usePythonVirtualEnvCheck;
111114
private final JBCheckBox pythonInstallBestEffortsCheck;
@@ -200,6 +203,13 @@ public ApiSettingsComponent() {
200203
TextComponentAccessor.TEXT_FIELD_WHOLE_TEXT
201204
);
202205

206+
uvPathText = new TextFieldWithBrowseButton();
207+
uvPathText.addBrowseFolderListener(
208+
null,
209+
FileChooserDescriptorFactory.singleFile(),
210+
TextComponentAccessor.TEXT_FIELD_WHOLE_TEXT
211+
);
212+
203213
usePython2Check = new JBCheckBox("Use python 2.x");
204214

205215
usePythonVirtualEnvCheck = new JBCheckBox("Use python virtual environment");
@@ -308,6 +318,8 @@ public ApiSettingsComponent() {
308318
.addVerticalGap(10)
309319
.addLabeledComponent(new JBLabel(pipPathLabel), pipPathText, 1, true)
310320
.addVerticalGap(10)
321+
.addLabeledComponent(new JBLabel(uvPathLabel), uvPathText, 1, true)
322+
.addVerticalGap(10)
311323
.addLabeledComponent(new JBLabel(usePython2Label), usePython2Check, 1, true)
312324
.addVerticalGap(10)
313325
.addLabeledComponent(new JBLabel(usePythonVirtualEnvLabel), usePythonVirtualEnvCheck, 1, true)
@@ -459,6 +471,15 @@ public void setPipPathText(@NotNull String text) {
459471
pipPathText.setText(text);
460472
}
461473

474+
@NotNull
475+
public String getUvPathText() {
476+
return uvPathText.getText();
477+
}
478+
479+
public void setUvPathText(@NotNull String text) {
480+
uvPathText.setText(text);
481+
}
482+
462483
public boolean getUsePython2Check() {
463484
return usePython2Check.isSelected();
464485
}

src/main/java/org/jboss/tools/intellij/settings/ApiSettingsConfigurable.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ public boolean isModified() {
5757
modified |= settingsComponent.getGoMatchManifestVersionsCheck() != settings.goMatchManifestVersions;
5858
modified |= !settingsComponent.getPythonPathText().equals(settings.pythonPath);
5959
modified |= !settingsComponent.getPipPathText().equals(settings.pipPath);
60+
modified |= !Objects.equals(settingsComponent.getUvPathText(), settings.uvPath);
6061
modified |= settingsComponent.getUsePython2Check() != settings.usePython2;
6162
modified |= settingsComponent.getUsePythonVirtualEnvCheck() != settings.usePythonVirtualEnv;
6263
modified |= settingsComponent.getPythonInstallBestEffortsCheck() != settings.pythonInstallBestEfforts;
@@ -94,6 +95,7 @@ public void apply() {
9495
settings.goMatchManifestVersions = settingsComponent.getGoMatchManifestVersionsCheck();
9596
settings.pythonPath = settingsComponent.getPythonPathText();
9697
settings.pipPath = settingsComponent.getPipPathText();
98+
settings.uvPath = settingsComponent.getUvPathText();
9799
settings.usePython2 = settingsComponent.getUsePython2Check();
98100
settings.usePythonVirtualEnv = settingsComponent.getUsePythonVirtualEnvCheck();
99101
settings.pythonInstallBestEfforts = settingsComponent.getPythonInstallBestEffortsCheck();
@@ -160,6 +162,7 @@ public void reset() {
160162
settingsComponent.setGoMatchManifestVersionsCheck(settings.goMatchManifestVersions);
161163
settingsComponent.setPythonPathText(settings.pythonPath != null ? settings.pythonPath : "");
162164
settingsComponent.setPipPathText(settings.pipPath != null ? settings.pipPath : "");
165+
settingsComponent.setUvPathText(settings.uvPath != null ? settings.uvPath : "");
163166
settingsComponent.setUsePython2Check(settings.usePython2);
164167
settingsComponent.setUsePythonVirtualEnvCheck(settings.usePythonVirtualEnv);
165168
settingsComponent.setPythonInstallBestEffortsCheck(settings.pythonInstallBestEfforts);

src/main/java/org/jboss/tools/intellij/settings/ApiSettingsState.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ public final class ApiSettingsState implements PersistentStateComponent<ApiSetti
4949

5050
public String pythonPath;
5151
public String pipPath;
52+
public String uvPath;
5253
public boolean usePython2;
5354
public boolean usePythonVirtualEnv;
5455
public boolean pythonMatchManifestVersions;

0 commit comments

Comments
 (0)