mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-04-19 21:11:28 +07:00
Python: drop unused symbols
GitOrigin-RevId: 6d571b57c6e5abe2ac88765b1c73b7f31bb1503b
This commit is contained in:
committed by
intellij-monorepo-bot
parent
901430cfb7
commit
85d34e9c0e
@@ -8,14 +8,12 @@ import com.intellij.openapi.application.EDT
|
||||
import com.intellij.openapi.application.ex.ApplicationManagerEx
|
||||
import com.intellij.openapi.diagnostic.fileLogger
|
||||
import com.intellij.openapi.diagnostic.thisLogger
|
||||
import com.intellij.openapi.fileTypes.FileTypeRegistry
|
||||
import com.intellij.openapi.module.Module
|
||||
import com.intellij.openapi.projectRoots.Sdk
|
||||
import com.intellij.openapi.projectRoots.impl.SdkConfigurationUtil
|
||||
import com.intellij.openapi.ui.DialogWrapper
|
||||
import com.intellij.openapi.ui.ValidationInfo
|
||||
import com.intellij.openapi.util.Disposer
|
||||
import com.intellij.openapi.util.NlsSafe
|
||||
import com.intellij.openapi.util.use
|
||||
import com.intellij.openapi.vfs.VfsUtil
|
||||
import com.intellij.openapi.vfs.VirtualFile
|
||||
@@ -33,7 +31,6 @@ import com.jetbrains.python.packaging.PyPackageUtil
|
||||
import com.jetbrains.python.packaging.management.PythonPackageManager
|
||||
import com.jetbrains.python.packaging.requirementsTxt.PythonRequirementTxtSdkUtils
|
||||
import com.jetbrains.python.packaging.setupPy.SetupPyManager
|
||||
import com.jetbrains.python.requirements.RequirementsFileType
|
||||
import com.jetbrains.python.sdk.PythonSdkUtil
|
||||
import com.jetbrains.python.sdk.basePath
|
||||
import com.jetbrains.python.sdk.configuration.PyProjectSdkConfigurationExtension
|
||||
@@ -133,18 +130,6 @@ class PyRequirementsTxtOrSetupPySdkConfiguration : PyProjectSdkConfigurationExte
|
||||
return if (permitted) envData else null
|
||||
}
|
||||
|
||||
private fun getCommandForPipInstall(requirementsTxtOrSetupPy: VirtualFile): List<String> {
|
||||
return if (FileTypeRegistry.getInstance().isFileOfType(requirementsTxtOrSetupPy, RequirementsFileType.INSTANCE)) {
|
||||
listOf("-r", getAbsPath(requirementsTxtOrSetupPy))
|
||||
}
|
||||
else {
|
||||
listOf("-e", getAbsPath(requirementsTxtOrSetupPy.parent))
|
||||
}
|
||||
}
|
||||
|
||||
@NlsSafe
|
||||
private fun getAbsPath(file: VirtualFile): String = file.toNioPath().toAbsolutePath().toString()
|
||||
|
||||
private class Dialog(
|
||||
module: Module,
|
||||
existingSdks: List<Sdk>,
|
||||
|
||||
@@ -9,6 +9,7 @@ import java.util.function.Supplier
|
||||
|
||||
// Copyright 2000-2025 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
|
||||
|
||||
internal object PyExecPythonBundle {
|
||||
private const val BUNDLE_FQN: @NonNls String = "messages.PyExecPythonBundle"
|
||||
private val BUNDLE = DynamicBundle(PyExecPythonBundle::class.java, BUNDLE_FQN)
|
||||
|
||||
@@ -43,7 +43,7 @@ private class AutoconfigSelectSdkProvider() : EvoSelectSdkProvider {
|
||||
val section = EvoTreeSection(
|
||||
label = null,
|
||||
elements = extensions.mapIndexed { idx, (extension, intention) ->
|
||||
EvoTreeLeafElement(RunConfiguratorAction(extension, intention, idx))
|
||||
EvoTreeLeafElement(RunConfiguratorAction(intention, idx))
|
||||
}
|
||||
)
|
||||
|
||||
@@ -60,7 +60,6 @@ private val ratingIcons = listOf(
|
||||
)
|
||||
|
||||
private class RunConfiguratorAction(
|
||||
val extension: PyProjectSdkConfigurationExtension,
|
||||
intention: String,
|
||||
order: Int,
|
||||
) : AnAction({ intention }, { intention }, ratingIcons.getOrElse(order, { AllIcons.Ide.Rating1 })) {
|
||||
|
||||
@@ -1,25 +0,0 @@
|
||||
package com.jetbrains.python.packaging.toolwindow.ui
|
||||
|
||||
import java.awt.Component
|
||||
import javax.swing.DefaultListCellRenderer
|
||||
import javax.swing.JList
|
||||
|
||||
class CustomListCellRenderer<T>(private val getText: (T) -> String?) : DefaultListCellRenderer() {
|
||||
override fun getListCellRendererComponent(
|
||||
list: JList<*>?,
|
||||
value: Any?,
|
||||
index: Int,
|
||||
isSelected: Boolean,
|
||||
cellHasFocus: Boolean,
|
||||
): Component {
|
||||
val component = super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus)
|
||||
@Suppress("UNCHECKED_CAST")
|
||||
(value as? T)?.let { typedValue ->
|
||||
getText(typedValue)?.let {
|
||||
@Suppress("HardCodedStringLiteral") // Sometimes we are rendering user-defined values add they cannot be localized.
|
||||
text = it
|
||||
}
|
||||
}
|
||||
return component
|
||||
}
|
||||
}
|
||||
@@ -5,7 +5,6 @@ import com.intellij.execution.configurations.PathEnvironmentVariableUtil
|
||||
import com.intellij.ide.util.PropertiesComponent
|
||||
import com.intellij.openapi.module.Module
|
||||
import com.intellij.openapi.projectRoots.Sdk
|
||||
import com.intellij.openapi.ui.ValidationInfo
|
||||
import com.intellij.openapi.util.SystemInfo
|
||||
import com.intellij.openapi.util.io.FileUtil
|
||||
import com.intellij.openapi.util.registry.Registry
|
||||
@@ -23,9 +22,6 @@ import com.jetbrains.python.packaging.PyRequirement
|
||||
import com.jetbrains.python.packaging.PyRequirementParser
|
||||
import com.jetbrains.python.packaging.common.PythonOutdatedPackage
|
||||
import com.jetbrains.python.packaging.common.PythonPackage
|
||||
import com.jetbrains.python.pathValidation.PlatformAndRoot
|
||||
import com.jetbrains.python.pathValidation.ValidationRequest
|
||||
import com.jetbrains.python.pathValidation.validateExecutableFile
|
||||
import com.jetbrains.python.sdk.PyDetectedSdk
|
||||
import com.jetbrains.python.sdk.associatedModulePath
|
||||
import com.jetbrains.python.sdk.basePath
|
||||
@@ -83,12 +79,6 @@ suspend fun getPoetryExecutable(): PyResult<Path> = withContext(Dispatchers.IO)
|
||||
PropertiesComponent.getInstance().poetryPath?.let { Path.of(it) }?.takeIf { it.exists() }
|
||||
}?.let { PyResult.success(it) } ?: detectPoetryExecutable()
|
||||
|
||||
@Internal
|
||||
suspend fun validatePoetryExecutable(poetryExecutable: Path?): ValidationInfo? = withContext(Dispatchers.IO) {
|
||||
validateExecutableFile(ValidationRequest(path = poetryExecutable?.pathString, fieldIsEmpty = PyBundle.message("python.sdk.poetry.executable.not.found"), platformAndRoot = PlatformAndRoot.local // TODO: pass real converter from targets when we support poetry @ targets
|
||||
))
|
||||
}
|
||||
|
||||
/**
|
||||
* Runs poetry command for the specified Poetry SDK.
|
||||
* Runs:
|
||||
|
||||
@@ -13,6 +13,7 @@ import com.jetbrains.python.packaging.PyRequirement
|
||||
import com.jetbrains.python.packaging.pyprojectToml.PyProjectTomlManager
|
||||
import org.jetbrains.annotations.ApiStatus
|
||||
|
||||
|
||||
@ApiStatus.Internal
|
||||
class PoetryProjectTomlManager(project: Project, sdk: Sdk) : PyProjectTomlManager(project, sdk) {
|
||||
override fun parseRequirements(requirementsFile: VirtualFile): List<PyRequirement> {
|
||||
|
||||
Reference in New Issue
Block a user