Skip to content

Commit 47cd01e

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 69dd3fe commit 47cd01e

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.15"
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 = "4.11.0"

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -239,6 +239,11 @@ private void setRequestProperties(final String manifestName) {
239239
System.clearProperty("TRUSTIFY_DA_PYTHON_PATH");
240240
System.clearProperty("TRUSTIFY_DA_PIP_PATH");
241241
}
242+
if (settings.uvPath != null && !settings.uvPath.isBlank()) {
243+
System.setProperty("TRUSTIFY_DA_UV_PATH", settings.uvPath);
244+
} else {
245+
System.clearProperty("TRUSTIFY_DA_UV_PATH");
246+
}
242247
if (settings.usePythonVirtualEnv) {
243248
System.setProperty("TRUSTIFY_DA_PYTHON_VIRTUAL_ENV", "true");
244249
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"
@@ -100,6 +102,7 @@ public class ApiSettingsComponent {
100102
private final JBCheckBox goMatchManifestVersionsCheck;
101103
private final TextFieldWithBrowseButton pythonPathText;
102104
private final TextFieldWithBrowseButton pipPathText;
105+
private final TextFieldWithBrowseButton uvPathText;
103106
private final JBCheckBox usePython2Check;
104107
private final JBCheckBox usePythonVirtualEnvCheck;
105108
private final JBCheckBox pythonInstallBestEffortsCheck;
@@ -191,6 +194,13 @@ public ApiSettingsComponent() {
191194
TextComponentAccessor.TEXT_FIELD_WHOLE_TEXT
192195
);
193196

197+
uvPathText = new TextFieldWithBrowseButton();
198+
uvPathText.addBrowseFolderListener(
199+
null,
200+
FileChooserDescriptorFactory.singleFile(),
201+
TextComponentAccessor.TEXT_FIELD_WHOLE_TEXT
202+
);
203+
194204
usePython2Check = new JBCheckBox("Use python 2.x");
195205

196206
usePythonVirtualEnvCheck = new JBCheckBox("Use python virtual environment");
@@ -295,6 +305,8 @@ public ApiSettingsComponent() {
295305
.addVerticalGap(10)
296306
.addLabeledComponent(new JBLabel(pipPathLabel), pipPathText, 1, true)
297307
.addVerticalGap(10)
308+
.addLabeledComponent(new JBLabel(uvPathLabel), uvPathText, 1, true)
309+
.addVerticalGap(10)
298310
.addLabeledComponent(new JBLabel(usePython2Label), usePython2Check, 1, true)
299311
.addVerticalGap(10)
300312
.addLabeledComponent(new JBLabel(usePythonVirtualEnvLabel), usePythonVirtualEnvCheck, 1, true)
@@ -439,6 +451,15 @@ public void setPipPathText(@NotNull String text) {
439451
pipPathText.setText(text);
440452
}
441453

454+
@NotNull
455+
public String getUvPathText() {
456+
return uvPathText.getText();
457+
}
458+
459+
public void setUvPathText(@NotNull String text) {
460+
uvPathText.setText(text);
461+
}
462+
442463
public boolean getUsePython2Check() {
443464
return usePython2Check.isSelected();
444465
}

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;
@@ -91,6 +92,7 @@ public void apply() {
9192
settings.goMatchManifestVersions = settingsComponent.getGoMatchManifestVersionsCheck();
9293
settings.pythonPath = settingsComponent.getPythonPathText();
9394
settings.pipPath = settingsComponent.getPipPathText();
95+
settings.uvPath = settingsComponent.getUvPathText();
9496
settings.usePython2 = settingsComponent.getUsePython2Check();
9597
settings.usePythonVirtualEnv = settingsComponent.getUsePythonVirtualEnvCheck();
9698
settings.pythonInstallBestEfforts = settingsComponent.getPythonInstallBestEffortsCheck();
@@ -154,6 +156,7 @@ public void reset() {
154156
settingsComponent.setGoMatchManifestVersionsCheck(settings.goMatchManifestVersions);
155157
settingsComponent.setPythonPathText(settings.pythonPath != null ? settings.pythonPath : "");
156158
settingsComponent.setPipPathText(settings.pipPath != null ? settings.pipPath : "");
159+
settingsComponent.setUvPathText(settings.uvPath != null ? settings.uvPath : "");
157160
settingsComponent.setUsePython2Check(settings.usePython2);
158161
settingsComponent.setUsePythonVirtualEnvCheck(settings.usePythonVirtualEnv);
159162
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)