From 019bd2a16191a6566889ff9c97d830d6d8d74c7c Mon Sep 17 00:00:00 2001 From: Alexey Katsman Date: Mon, 16 Feb 2026 10:55:02 +0100 Subject: [PATCH] PY-85913 Drop pipenv from Python Integrated Tools window This window only contained pipenv, there was no poetry/uv/hatch/etc. This field is only used to setup a path to tool, but since we do in the dialogs during SDK setup, there's no need in this field anymore. GitOrigin-RevId: 07f9a4e8bccc2b41152dd07bee463037f80400ea --- .../messages/PyBundle.properties | 2 - .../PyIntegratedToolsConfigurable.form | 36 ++---------- .../PyIntegratedToolsConfigurable.java | 58 ++----------------- .../python/sdk/ToolCommandExecutor.kt | 7 --- .../sdk/pipenv/PipenvCommandExecutor.kt | 6 -- 5 files changed, 12 insertions(+), 97 deletions(-) diff --git a/python/pluginResources/messages/PyBundle.properties b/python/pluginResources/messages/PyBundle.properties index 31c8b5c07ed0..4a71e729d315 100644 --- a/python/pluginResources/messages/PyBundle.properties +++ b/python/pluginResources/messages/PyBundle.properties @@ -724,7 +724,6 @@ code.insight.install.type.hints.action=Install stub packages code.insight.install.type.hint.action=Install {0} code.insight.ignore.type.hints=Ignore code.insight.ignore.packages.qfix=Ignore package -configurable.pipenv.auto.detected=Auto-detected: {0} configurable.choose.path.to.the.package.requirements.file=Choose path to the package requirements file for SDK: configurable.choose.working.directory=Choose the working directory: configurable.select.working.directory=Select Working Directory @@ -1183,7 +1182,6 @@ integrated.tools.configurable.docstrings=Docstrings integrated.tools.configurable.restructuredtext=reStructuredText integrated.tools.configurable.packaging=Packaging integrated.tools.configurable.testing=Testing -integrated.tools.configurable.pipenv=Pipenv python.execute.selection.action.execute.selection.in.console=Execute Selection in Python Console python.execute.selection.action.execute.line.in.console=Execute Line in Python Console diff --git a/python/src/com/jetbrains/python/configuration/PyIntegratedToolsConfigurable.form b/python/src/com/jetbrains/python/configuration/PyIntegratedToolsConfigurable.form index 4a69838b4089..8bbc51c58015 100644 --- a/python/src/com/jetbrains/python/configuration/PyIntegratedToolsConfigurable.form +++ b/python/src/com/jetbrains/python/configuration/PyIntegratedToolsConfigurable.form @@ -1,6 +1,6 @@
- + @@ -10,12 +10,12 @@ - + - + @@ -24,7 +24,7 @@ - + @@ -67,7 +67,7 @@ - + @@ -123,7 +123,7 @@ - + @@ -140,30 +140,6 @@ - - - - - - - - - - - - - - - - - - - - - - - -
diff --git a/python/src/com/jetbrains/python/configuration/PyIntegratedToolsConfigurable.java b/python/src/com/jetbrains/python/configuration/PyIntegratedToolsConfigurable.java index 2fb077ca4388..c48f096cd81c 100644 --- a/python/src/com/jetbrains/python/configuration/PyIntegratedToolsConfigurable.java +++ b/python/src/com/jetbrains/python/configuration/PyIntegratedToolsConfigurable.java @@ -8,7 +8,6 @@ import com.intellij.facet.impl.ui.FacetErrorPanel; import com.intellij.facet.ui.FacetConfigurationQuickFix; import com.intellij.facet.ui.FacetEditorValidator; import com.intellij.facet.ui.ValidationResult; -import com.intellij.ide.util.PropertiesComponent; import com.intellij.openapi.diagnostic.Logger; import com.intellij.openapi.fileChooser.FileChooserDescriptorFactory; import com.intellij.openapi.fileTypes.PlainTextFileType; @@ -22,21 +21,17 @@ import com.intellij.openapi.projectRoots.SdkAdditionalData; import com.intellij.openapi.roots.ProjectRootManager; import com.intellij.openapi.ui.DialogPanel; import com.intellij.openapi.ui.TextFieldWithBrowseButton; -import com.intellij.openapi.util.text.StringUtil; import com.intellij.openapi.vfs.VirtualFile; -import com.intellij.python.community.impl.pipenv.PathKt; import com.intellij.ui.CollectionComboBoxModel; import com.intellij.ui.IdeBorderFactory; import com.intellij.ui.SimpleListCellRenderer; import com.intellij.ui.components.JBLabel; import com.intellij.ui.components.JBScrollPane; -import com.intellij.ui.components.JBTextField; import com.intellij.uiDesigner.core.GridConstraints; import com.intellij.uiDesigner.core.GridLayoutManager; import com.intellij.uiDesigner.core.Spacer; import com.intellij.util.FileContentUtil; import com.intellij.util.FileContentUtilCore; -import com.intellij.util.ObjectUtils; import com.intellij.util.containers.ContainerUtil; import com.intellij.util.ui.JBUI; import com.jetbrains.python.PyBundle; @@ -50,7 +45,6 @@ import com.jetbrains.python.packaging.PyRequirementsKt; import com.jetbrains.python.packaging.requirementsTxt.PythonRequirementTxtSdkUtils; import com.jetbrains.python.sdk.PythonSdkAdditionalData; import com.jetbrains.python.sdk.legacy.PythonSdkUtil; -import com.jetbrains.python.sdk.pipenv.PipenvCommandExecutorKt; import com.jetbrains.python.testing.PyAbstractTestFactory; import com.jetbrains.python.testing.settings.PyTestRunConfigurationRenderer; import com.jetbrains.python.testing.settings.PyTestRunConfigurationsModel; @@ -96,8 +90,6 @@ public class PyIntegratedToolsConfigurable implements SearchableConfigurable { private final JCheckBox renderExternal; private final JPanel myPackagingPanel; private final JPanel myTestsPanel; - private final TextFieldWithBrowseButton myPipEnvPathField; - private final JPanel myPipEnvPanel; private final @NotNull Collection<@NotNull DialogPanel> myCustomizePanels = PyIntegratedToolsTestPanelCustomizer.Companion.createPanels(); @@ -117,19 +109,19 @@ public class PyIntegratedToolsConfigurable implements SearchableConfigurable { // >>> IMPORTANT!! <<< // DO NOT EDIT OR ADD ANY CODE HERE! myMainPanel = new JPanel(); - myMainPanel.setLayout(new GridLayoutManager(9, 1, new Insets(0, 0, 0, 0), -1, -1)); + myMainPanel.setLayout(new GridLayoutManager(8, 1, new Insets(0, 0, 0, 0), -1, -1)); final Spacer spacer1 = new Spacer(); - myMainPanel.add(spacer1, new GridConstraints(8, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_VERTICAL, 1, + myMainPanel.add(spacer1, new GridConstraints(7, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_VERTICAL, 1, GridConstraints.SIZEPOLICY_WANT_GROW, null, null, null, 0, false)); myErrorPanel = new JPanel(); myErrorPanel.setLayout(new BorderLayout(0, 0)); - myMainPanel.add(myErrorPanel, new GridConstraints(7, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH, + myMainPanel.add(myErrorPanel, new GridConstraints(6, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, null, null, null, 0, false)); myDocStringsPanel = new JPanel(); myDocStringsPanel.setLayout(new GridLayoutManager(3, 2, new Insets(0, 0, 0, 0), -1, -1)); - myMainPanel.add(myDocStringsPanel, new GridConstraints(3, 0, 2, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH, + myMainPanel.add(myDocStringsPanel, new GridConstraints(2, 0, 2, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, null, null, null, 0, false)); @@ -159,7 +151,7 @@ public class PyIntegratedToolsConfigurable implements SearchableConfigurable { GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); myRestPanel = new JPanel(); myRestPanel.setLayout(new GridLayoutManager(2, 2, new Insets(0, 0, 0, 0), -1, -1)); - myMainPanel.add(myRestPanel, new GridConstraints(5, 0, 2, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH, + myMainPanel.add(myRestPanel, new GridConstraints(4, 0, 2, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, null, null, null, 0, false)); @@ -198,7 +190,7 @@ public class PyIntegratedToolsConfigurable implements SearchableConfigurable { false)); myTestsPanel = new JPanel(); myTestsPanel.setLayout(new BorderLayout(0, 0)); - myMainPanel.add(myTestsPanel, new GridConstraints(2, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH, + myMainPanel.add(myTestsPanel, new GridConstraints(1, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, null, null, null, 0, false)); @@ -207,22 +199,6 @@ public class PyIntegratedToolsConfigurable implements SearchableConfigurable { myTestsPanel.add(label1, BorderLayout.WEST); myTestRunnerComboBox = new JComboBox(); myTestsPanel.add(myTestRunnerComboBox, BorderLayout.CENTER); - myPipEnvPanel = new JPanel(); - myPipEnvPanel.setLayout(new GridLayoutManager(1, 2, new Insets(0, 0, 0, 0), -1, -1)); - myMainPanel.add(myPipEnvPanel, new GridConstraints(1, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH, - GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, - GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, null, - null, null, 0, false)); - final JBLabel jBLabel4 = new JBLabel(); - this.$$$loadLabelText$$$(jBLabel4, - this.$$$getMessageFromBundle$$$("messages/PyBundle", "form.integrated.tools.path.to.pipenv.executable")); - myPipEnvPanel.add(jBLabel4, new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, - GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, - 0, false)); - myPipEnvPathField = new TextFieldWithBrowseButton(); - myPipEnvPanel.add(myPipEnvPathField, new GridConstraints(0, 1, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL, - GridConstraints.SIZEPOLICY_WANT_GROW, GridConstraints.SIZEPOLICY_FIXED, null, - null, null, 0, false)); jBLabel1.setLabelFor(myDocstringFormatComboBox); jBLabel2.setLabelFor(myDocstringFormatComboBox); } @@ -243,13 +219,10 @@ public class PyIntegratedToolsConfigurable implements SearchableConfigurable { .withTitle(PyBundle.message("configurable.choose.path.to.the.package.requirements.file"))); myRequirementsPathField.setText(getRequirementsPath()); - myPipEnvPathField.addBrowseFolderListener(null, FileChooserDescriptorFactory.createSingleFileDescriptor()); - myDocStringsPanel.setBorder(IdeBorderFactory.createTitledBorder(PyBundle.message("integrated.tools.configurable.docstrings"))); myRestPanel.setBorder(IdeBorderFactory.createTitledBorder(PyBundle.message("integrated.tools.configurable.restructuredtext"))); myPackagingPanel.setBorder(IdeBorderFactory.createTitledBorder(PyBundle.message("integrated.tools.configurable.packaging"))); myTestsPanel.setBorder(IdeBorderFactory.createTitledBorder(PyBundle.message("integrated.tools.configurable.testing"))); - myPipEnvPanel.setBorder(IdeBorderFactory.createTitledBorder(PyBundle.message("integrated.tools.configurable.pipenv"))); } private static Method $$$cachedGetBundleMethod$$$ = null; @@ -462,10 +435,6 @@ public class PyIntegratedToolsConfigurable implements SearchableConfigurable { if (!getRequirementsPath().equals(myRequirementsPathField.getText())) { return true; } - if (!myPipEnvPathField.getText() - .equals(StringUtil.notNullize(PathKt.getPipenvPath(PropertiesComponent.getInstance())))) { - return true; - } return ContainerUtil.exists(myCustomizePanels, panel -> panel.isModified()); } @@ -497,7 +466,6 @@ public class PyIntegratedToolsConfigurable implements SearchableConfigurable { setRequirementsPath(myRequirementsPathField.getText()); DaemonCodeAnalyzer.getInstance(myProject).restart(this); - PathKt.setPipenvPath(PropertiesComponent.getInstance(), StringUtil.nullize(myPipEnvPathField.getText())); for (@NotNull DialogPanel panel : myCustomizePanels) { panel.apply(); @@ -530,20 +498,6 @@ public class PyIntegratedToolsConfigurable implements SearchableConfigurable { analyzeDoctest.setSelected(myDocumentationSettings.isAnalyzeDoctest()); renderExternal.setSelected(myDocumentationSettings.isRenderExternalDocumentation()); myRequirementsPathField.setText(getRequirementsPath()); - // TODO: Move pipenv settings into a separate configurable - final JBTextField pipEnvText = ObjectUtils.tryCast(myPipEnvPathField.getTextField(), JBTextField.class); - if (pipEnvText != null) { - final String savedPath = PathKt.getPipenvPath(PropertiesComponent.getInstance()); - if (savedPath != null) { - pipEnvText.setText(savedPath); - } - else { - final Path executable = PipenvCommandExecutorKt.detectPipEnvExecutableOrNull(); - if (executable != null) { - pipEnvText.getEmptyText().setText(PyBundle.message("configurable.pipenv.auto.detected", executable.toString())); - } - } - } for (@NotNull DialogPanel panel : myCustomizePanels) { panel.reset(); diff --git a/python/src/com/jetbrains/python/sdk/ToolCommandExecutor.kt b/python/src/com/jetbrains/python/sdk/ToolCommandExecutor.kt index df4fa91ad288..792fee9175fd 100644 --- a/python/src/com/jetbrains/python/sdk/ToolCommandExecutor.kt +++ b/python/src/com/jetbrains/python/sdk/ToolCommandExecutor.kt @@ -2,7 +2,6 @@ package com.jetbrains.python.sdk import com.intellij.ide.util.PropertiesComponent -import com.intellij.openapi.progress.runBlockingCancellable import com.intellij.openapi.util.NlsSafe import com.intellij.platform.eel.EelApi import com.intellij.platform.eel.provider.getEelDescriptor @@ -10,7 +9,6 @@ import com.intellij.platform.eel.provider.localEel import com.intellij.platform.eel.provider.toEelApi import com.intellij.python.community.execService.ProcessOutputTransformer import com.intellij.python.community.execService.ZeroCodeStdoutTransformer -import com.intellij.util.concurrency.annotations.RequiresBackgroundThread import com.jetbrains.python.errorProcessing.PyResult import com.jetbrains.python.sdk.impl.PySdkBundle import org.jetbrains.annotations.SystemIndependent @@ -52,11 +50,6 @@ internal data class ToolCommandExecutor( } } -@RequiresBackgroundThread -internal fun ToolCommandExecutor.detectToolExecutableOrNull(eel: EelApi): Path? { - return runBlockingCancellable { detectToolExecutable(eel) } -} - internal suspend fun ToolCommandExecutor.runTool(dirPath: Path?, vararg args: String): PyResult = runTool(dirPath, args = args, transformer = ZeroCodeStdoutTransformer) diff --git a/python/src/com/jetbrains/python/sdk/pipenv/PipenvCommandExecutor.kt b/python/src/com/jetbrains/python/sdk/pipenv/PipenvCommandExecutor.kt index ed797079c226..5bf8eff658f5 100644 --- a/python/src/com/jetbrains/python/sdk/pipenv/PipenvCommandExecutor.kt +++ b/python/src/com/jetbrains/python/sdk/pipenv/PipenvCommandExecutor.kt @@ -12,7 +12,6 @@ import com.jetbrains.python.errorProcessing.PyResult import com.jetbrains.python.sdk.ToolCommandExecutor import com.jetbrains.python.sdk.add.v2.PathHolder import com.jetbrains.python.sdk.createSdk -import com.jetbrains.python.sdk.detectToolExecutableOrNull import com.jetbrains.python.sdk.runTool import com.jetbrains.python.venvReader.VirtualEnvReader import kotlinx.coroutines.Dispatchers @@ -33,11 +32,6 @@ suspend fun runPipEnv(dirPath: Path?, vararg args: String): PyResult = P suspend fun runPipEnv(dirPath: Path?, vararg args: String, transformer: ProcessOutputTransformer): PyResult = PIPENV_TOOL.runTool(dirPath = dirPath, args = args, transformer = transformer) - -@Internal -@JvmOverloads -internal fun detectPipEnvExecutableOrNull(eel: EelApi = localEel): Path? = PIPENV_TOOL.detectToolExecutableOrNull(eel) - /** * Returns the configured pipenv executable or detects it automatically. */