diff --git a/python/openapi/src/com/jetbrains/python/packaging/PyPackageManager.java b/python/openapi/src/com/jetbrains/python/packaging/PyPackageManager.java index 6ef11bc29723..00844a098edb 100644 --- a/python/openapi/src/com/jetbrains/python/packaging/PyPackageManager.java +++ b/python/openapi/src/com/jetbrains/python/packaging/PyPackageManager.java @@ -17,7 +17,6 @@ import java.util.List; @Deprecated(forRemoval = true) public abstract class PyPackageManager implements Disposable { - public static final String USE_USER_SITE = "--user"; @Topic.AppLevel public static final Topic PACKAGE_MANAGER_TOPIC = new Topic<>(Listener.class, Topic.BroadcastDirection.TO_DIRECT_CHILDREN); @@ -55,16 +54,8 @@ public abstract class PyPackageManager implements Disposable { return manager.getSdk(); } - public abstract void installManagement() throws ExecutionException; - - public abstract boolean hasManagement() throws ExecutionException; - public abstract void install(@Nullable List requirements, @NotNull List extraArgs) throws ExecutionException; - public abstract void refresh(); - - public abstract @NotNull String createVirtualEnv(@NotNull String destinationDir, boolean useGlobalSite) throws ExecutionException; - public abstract @Nullable List getPackages(); public abstract @NotNull List refreshAndGetPackages(boolean alwaysRefresh) throws ExecutionException; diff --git a/python/pluginResources/messages/PyBundle.properties b/python/pluginResources/messages/PyBundle.properties index 33b0d40d4a11..2f8e873ce803 100644 --- a/python/pluginResources/messages/PyBundle.properties +++ b/python/pluginResources/messages/PyBundle.properties @@ -463,13 +463,6 @@ python.sdk.action.add.new.interpreter.text=Add New Interpreter python.sdk.action.add.local.interpreter.text=Add Local Interpreter\u2026 python.sdk.action.add.interpreter.based.on.target.text=On {0}\u2026 -python.cldt.checking=Checking for Command-Line Developer Tools installation -python.cldt.required=Selected python requires Command-Line Developer Tools: {0} -python.cldt.installing.suggestion=Install Python with the Command-Line Developer Tools -python.cldt.installing.title=Waiting for Python Installation and Interpreter Setup -python.cldt.installing.indicator=macOS is installing Command-Line Developer Tools -python.cldt.installing.skip=Skip this step to configure an interpreter later - # SDK / skeletons sdk.some.skeletons.failed=Some skeletons failed to generate sdk.gen.cleaning.up=Cleaning up skeletons\u2026 diff --git a/python/python-exec-service/resources/intellij.python.community.execService.xml b/python/python-exec-service/resources/intellij.python.community.execService.xml index 188e07c95195..8e712e32b68c 100644 --- a/python/python-exec-service/resources/intellij.python.community.execService.xml +++ b/python/python-exec-service/resources/intellij.python.community.execService.xml @@ -1,4 +1,4 @@ - + diff --git a/python/python-venv/resources/intellij.python.venv.xml b/python/python-venv/resources/intellij.python.venv.xml index d89788f76a90..4920ae08b275 100644 --- a/python/python-venv/resources/intellij.python.venv.xml +++ b/python/python-venv/resources/intellij.python.venv.xml @@ -1,4 +1,4 @@ - + diff --git a/python/src/com/jetbrains/python/packaging/PyPackageManagerBridge.kt b/python/src/com/jetbrains/python/packaging/PyPackageManagerBridge.kt index 4ef7b92b00ac..6bf9d6c3612a 100644 --- a/python/src/com/jetbrains/python/packaging/PyPackageManagerBridge.kt +++ b/python/src/com/jetbrains/python/packaging/PyPackageManagerBridge.kt @@ -2,23 +2,16 @@ package com.jetbrains.python.packaging import com.intellij.execution.ExecutionException -import com.intellij.openapi.application.writeAction import com.intellij.openapi.diagnostic.thisLogger import com.intellij.openapi.progress.runBlockingMaybeCancellable import com.intellij.openapi.project.ProjectManager import com.intellij.openapi.project.getOpenedProjects import com.intellij.openapi.projectRoots.Sdk -import com.intellij.openapi.roots.OrderRootType -import com.intellij.openapi.vfs.VfsUtil -import com.intellij.util.cancelOnDispose -import com.jetbrains.python.NON_INTERACTIVE_ROOT_TRACE_CONTEXT import com.jetbrains.python.getOrNull import com.jetbrains.python.onFailure import com.jetbrains.python.packaging.management.PythonPackageManager import com.jetbrains.python.packaging.management.ui.PythonPackageManagerUI import com.jetbrains.python.packaging.management.ui.installPyRequirementsBackground -import com.jetbrains.python.packaging.utils.PyPackageCoroutine -import com.jetbrains.python.sdk.PythonSdkType import org.jetbrains.annotations.ApiStatus @ApiStatus.Internal @@ -26,26 +19,6 @@ internal open class PyPackageManagerBridge(private val sdk: Sdk) : PyPackageMana protected val packageManager: PythonPackageManager = PythonPackageManager.forSdk(guessProject(), sdk = sdk) protected val packageManagerUI: PythonPackageManagerUI = PythonPackageManagerUI.forPackageManager(packageManager) - override fun installManagement() {} - override fun hasManagement(): Boolean = true - - override fun refresh() { - PyPackageCoroutine.launch(null, NON_INTERACTIVE_ROOT_TRACE_CONTEXT) { - thisLogger().debug("Refreshing SDK roots and packages cache") - writeAction { - val files = sdk.getRootProvider().getFiles(OrderRootType.CLASSES) - VfsUtil.markDirtyAndRefresh(true, true, true, *files) - } - PythonSdkType.getInstance().setupSdkPaths(sdk) - }.cancelOnDispose(this) - } - - override fun createVirtualEnv(destinationDir: String, useGlobalSite: Boolean): String { - val manager = PyTargetEnvCreationManager(getSdk()) - return manager.createVirtualEnv(destinationDir, useGlobalSite) - - } - @Throws(ExecutionException::class) override fun install(requirements: MutableList?, extraArgs: MutableList) { runBlockingMaybeCancellable { diff --git a/python/src/com/jetbrains/python/packaging/PyTargetEnvCreationManager.java b/python/src/com/jetbrains/python/packaging/PyTargetEnvCreationManager.java deleted file mode 100644 index 868103e2cbe0..000000000000 --- a/python/src/com/jetbrains/python/packaging/PyTargetEnvCreationManager.java +++ /dev/null @@ -1,378 +0,0 @@ -// Copyright 2000-2025 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. -package com.jetbrains.python.packaging; - -import com.intellij.execution.ExecutionException; -import com.intellij.execution.RunCanceledByUserException; -import com.intellij.execution.configurations.GeneralCommandLine; -import com.intellij.execution.process.CapturingProcessHandler; -import com.intellij.execution.process.ProcessOutput; -import com.intellij.execution.target.TargetEnvironment; -import com.intellij.execution.target.TargetEnvironmentRequest; -import com.intellij.execution.target.TargetProgressIndicator; -import com.intellij.execution.target.TargetedCommandLine; -import com.intellij.execution.target.local.LocalTargetEnvironment; -import com.intellij.execution.target.value.TargetEnvironmentFunctions; -import com.intellij.execution.util.ExecUtil; -import com.intellij.openapi.diagnostic.Logger; -import com.intellij.openapi.progress.EmptyProgressIndicator; -import com.intellij.openapi.progress.ProgressIndicator; -import com.intellij.openapi.progress.ProgressManager; -import com.intellij.openapi.project.ProjectManager; -import com.intellij.openapi.projectRoots.Sdk; -import com.intellij.openapi.util.text.StringUtil; -import com.intellij.python.community.helpersLocator.PythonHelpersLocator; -import com.intellij.util.concurrency.annotations.RequiresReadLock; -import com.intellij.util.containers.ContainerUtil; -import com.intellij.util.net.HttpConfigurable; -import com.jetbrains.python.HelperPackage; -import com.jetbrains.python.PythonHelper; -import com.jetbrains.python.packaging.common.PythonPackage; -import com.jetbrains.python.packaging.pip.PipParseUtils; -import com.jetbrains.python.packaging.repository.PyPackageRepositoryUtil; -import com.jetbrains.python.psi.LanguageLevel; -import com.jetbrains.python.run.PythonExecution; -import com.jetbrains.python.run.PythonInterpreterTargetEnvironmentFactory; -import com.jetbrains.python.run.PythonScriptExecution; -import com.jetbrains.python.run.PythonScripts; -import com.jetbrains.python.run.target.HelpersAwareTargetEnvironmentRequest; -import com.jetbrains.python.sdk.PyDetectedSdk; -import com.jetbrains.python.sdk.PySdkExtKt; -import com.jetbrains.python.sdk.PythonSdkType; -import com.jetbrains.python.sdk.flavors.PythonSdkFlavor; -import com.jetbrains.python.sdk.impl.PySdkBundle; -import com.jetbrains.python.venvReader.VirtualEnvReaderKt; -import org.jetbrains.annotations.ApiStatus; -import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.Nullable; - -import java.io.File; -import java.io.IOException; -import java.net.URI; -import java.net.URISyntaxException; -import java.nio.file.Path; -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.concurrent.atomic.AtomicBoolean; -import java.util.regex.Pattern; - -/** - * @deprecated TODO: explain - */ -@SuppressWarnings("ALL") -@Deprecated(forRemoval = true) -@ApiStatus.Internal -public class PyTargetEnvCreationManager { - private static final Logger LOG = Logger.getInstance(PyTargetEnvCreationManager.class); - private final @NotNull Sdk mySdk; - - protected static final String SETUPTOOLS_VERSION = "44.1.1"; - protected static final String PIP_VERSION = "24.3.1"; - - protected static final String SETUPTOOLS_WHEEL_NAME = "setuptools-" + SETUPTOOLS_VERSION + "-py2.py3-none-any.whl"; - protected static final String PIP_WHEEL_NAME = "pip-" + PIP_VERSION + "-py2.py3-none-any.whl"; - - protected static final int ERROR_NO_SETUPTOOLS = 3; - - - protected static final String PACKAGING_TOOL = "packaging_tool.py"; - protected static final int TIMEOUT = 10 * 60 * 1000; - - protected static final String INSTALL = "install"; - protected static final String UNINSTALL = "uninstall"; - private final AtomicBoolean myUpdatingCache = new AtomicBoolean(false); - protected String mySeparator = File.separator; - protected volatile @Nullable List myPackagesCache = null; - - public PyTargetEnvCreationManager(final @NotNull Sdk sdk) { - mySdk = sdk; - } - - public @NotNull String createVirtualEnv(@NotNull String destinationDir, boolean useGlobalSite) throws ExecutionException { - final Sdk sdk = getSdk(); - final LanguageLevel languageLevel = getOrRequestLanguageLevelForSdk(sdk); - - if (languageLevel.isOlderThan(LanguageLevel.PYTHON27)) { - throw new ExecutionException(PySdkBundle.message("python.sdk.packaging.creating.virtual.environment.for.python.not.supported", - languageLevel, LanguageLevel.PYTHON27)); - } - - HelpersAwareTargetEnvironmentRequest helpersAwareTargetRequest = getPythonTargetInterpreter(); - TargetEnvironmentRequest targetEnvironmentRequest = helpersAwareTargetRequest.getTargetEnvironmentRequest(); - - PythonScriptExecution pythonExecution = PythonScripts.prepareHelperScriptExecution( - isLegacyPython(languageLevel) ? PythonHelper.LEGACY_VIRTUALENV_ZIPAPP : PythonHelper.VIRTUALENV_ZIPAPP, - helpersAwareTargetRequest); - if (useGlobalSite) { - pythonExecution.addParameter("--system-site-packages"); - } - pythonExecution.addParameter(destinationDir); - // TODO [targets] Pass `parentDir = null` - getPythonProcessResult(pythonExecution, false, true, targetEnvironmentRequest); - - final Path binary = VirtualEnvReaderKt.VirtualEnvReader().findPythonInPythonRoot(Path.of(destinationDir)); - final char separator = targetEnvironmentRequest.getTargetPlatform().getPlatform().fileSeparator; - final String binaryFallback = destinationDir + separator + "bin" + separator + "python"; - - return (binary != null) ? binary.toString() : binaryFallback; - } - - private @NotNull HelpersAwareTargetEnvironmentRequest getPythonTargetInterpreter() throws ExecutionException { - HelpersAwareTargetEnvironmentRequest request = PythonInterpreterTargetEnvironmentFactory.findPythonTargetInterpreter(getSdk(), - ProjectManager.getInstance() - .getDefaultProject()); - if (request == null) { - throw new ExecutionException(PySdkBundle.message("python.sdk.package.managing.not.supported.for.sdk", getSdk().getName())); - } - return request; - } - - /** - * Is it a legacy python version that we still support - */ - private static @NotNull Boolean isLegacyPython(@NotNull LanguageLevel languageLevel) { - return languageLevel.isPython2() || languageLevel.isOlderThan(LanguageLevel.PYTHON37); - } - - private @NotNull String getPythonProcessResult(@NotNull PythonExecution pythonExecution, - boolean askForSudo, - boolean showProgress, - @NotNull TargetEnvironmentRequest targetEnvironmentRequest) throws ExecutionException { - ProcessOutputWithCommandLine result = getPythonProcessOutput(pythonExecution, askForSudo, showProgress, targetEnvironmentRequest); - String path = result.getExePath(); - List args = result.getArgs(); - ProcessOutput processOutput = result.getProcessOutput(); - int exitCode = processOutput.getExitCode(); - if (processOutput.isTimeout()) { - // TODO [targets] Make cancellable right away? - throw PyExecutionException.createForTimeout(PySdkBundle.message("python.sdk.packaging.timed.out"), path, args); - } - else if (exitCode != 0) { - throw new PyExecutionException(PySdkBundle.message("python.sdk.packaging.non.zero.exit.code", exitCode), path, args, processOutput); - } - return processOutput.getStdout(); - } - - protected final @NotNull Sdk getSdk() { - return mySdk; - } - - - private @NotNull PyTargetEnvCreationManager.ProcessOutputWithCommandLine getPythonProcessOutput(@NotNull PythonExecution pythonExecution, - boolean askForSudo, - boolean showProgress, - @NotNull TargetEnvironmentRequest targetEnvironmentRequest) - throws ExecutionException { - // TODO [targets] Use `showProgress = true` - // TODO [targets] Use `workingDir` - // TODO [targets] Use `useUserSite` (handle use sudo) - TargetProgressIndicator targetProgressIndicator = TargetProgressIndicator.EMPTY; - TargetEnvironment targetEnvironment = targetEnvironmentRequest.prepareEnvironment(targetProgressIndicator); - for (Map.Entry entry : targetEnvironment.getUploadVolumes() - .entrySet()) { - try { - entry.getValue().upload(".", TargetProgressIndicator.EMPTY); - } - catch (IOException e) { - throw new ExecutionException(e); - } - } - // TODO [targets] Should `interpreterParameters` be here? - TargetedCommandLine targetedCommandLine = PythonScripts.buildTargetedCommandLine(pythonExecution, - targetEnvironment, - getSdk(), - Collections.emptyList() - ); - // TODO [targets] Set parent directory of interpreter as the working directory - - LOG.info("Running packaging tool"); - - // TODO [targets] Apply environment variables: setPythonUnbuffered(...), setPythonDontWriteBytecode(...), resetHomePathChanges(...) - // TODO [targets] Apply flavor from PythonSdkFlavor.getFlavor(mySdk) - ProgressIndicator indicator = ProgressManager.getInstance().getProgressIndicator(); - Process process = createProcess(targetEnvironment, targetedCommandLine, askForSudo, indicator); - List commandLine = targetedCommandLine.collectCommandsSynchronously(); - String commandLineString = StringUtil.join(commandLine, " "); - final CapturingProcessHandler handler = - new CapturingProcessHandler(process, targetedCommandLine.getCharset(), commandLineString); - final ProcessOutput result; - if (showProgress && indicator != null) { - handler.addProcessListener(new IndicatedProcessOutputListener(indicator)); - result = handler.runProcessWithProgressIndicator(indicator); - } - else { - // TODO [targets] Check if timeout is ok for all targets - result = handler.runProcess(TIMEOUT); - } - if (result.isCancelled()) { - throw new RunCanceledByUserException(); - } - result.checkSuccess(LOG); - final int exitCode = result.getExitCode(); - String helperPath = ContainerUtil.getFirstItem(commandLine, ""); - List args = commandLine.subList(Math.min(1, commandLine.size()), commandLine.size()); - if (exitCode != 0) { - final String message = StringUtil.isEmptyOrSpaces(result.getStdout()) && StringUtil.isEmptyOrSpaces(result.getStderr()) - ? PySdkBundle.message("python.conda.permission.denied") - : PySdkBundle.message("python.sdk.packaging.non.zero.exit.code", exitCode); - throw new PyExecutionException(message, helperPath, args, result); - } - return new ProcessOutputWithCommandLine(helperPath, args, result); - } - - private @NotNull Process createProcess(@NotNull TargetEnvironment targetEnvironment, - @NotNull TargetedCommandLine targetedCommandLine, - boolean askForSudo, - @Nullable ProgressIndicator indicator) throws ExecutionException { - if (askForSudo) { - if (!(targetEnvironment instanceof LocalTargetEnvironment)) { - // TODO [targets] Execute process on non-local target using sudo - LOG.warn("Sudo flag is ignored"); - } - else if (PySdkExtKt.adminPermissionsNeeded(getSdk())) { - // This is hack to process sudo flag in the local environment - GeneralCommandLine localCommandLine = ((LocalTargetEnvironment)targetEnvironment).createGeneralCommandLine(targetedCommandLine); - return executeOnLocalMachineWithSudo(localCommandLine); - } - } - // TODO [targets] Pass meaningful progress indicator - return targetEnvironment.createProcess(targetedCommandLine, Objects.requireNonNullElseGet(indicator, EmptyProgressIndicator::new)); - } - - protected void installUsingPipWheel(String @NotNull ... pipArgs) throws ExecutionException { - HelpersAwareTargetEnvironmentRequest helpersAwareTargetRequest = getPythonTargetInterpreter(); - PythonScriptExecution pythonExecution = - PythonScripts.prepareHelperScriptExecution(getPipHelperPackage(), helpersAwareTargetRequest); - pythonExecution.addParameter(INSTALL); - pythonExecution.addParameters(pipArgs); - - getPythonProcessResult(pythonExecution, true, true, helpersAwareTargetRequest.getTargetEnvironmentRequest()); - } - - @RequiresReadLock(generateAssertion = false) - protected static @NotNull LanguageLevel getOrRequestLanguageLevelForSdk(@NotNull Sdk sdk) throws ExecutionException { - if (sdk instanceof PyDetectedSdk) { - final PythonSdkFlavor flavor = PythonSdkFlavor.getFlavor(sdk); - if (flavor != null && sdk.getHomePath() != null) { - return flavor.getLanguageLevel(sdk.getHomePath()); - } - throw new ExecutionException(PySdkBundle.message("python.sdk.packaging.cannot.retrieve.version", sdk.getHomePath())); - } - // Use the cached version for an already configured SDK - return PythonSdkType.getLanguageLevelForSdk(sdk); - } - - protected static @Nullable String getProxyString() { - final HttpConfigurable settings = HttpConfigurable.getInstance(); - if (settings != null && settings.USE_HTTP_PROXY) { - final String credentials; - if (settings.PROXY_AUTHENTICATION) { - credentials = String.format("%s:%s@", settings.getProxyLogin(), settings.getPlainProxyPassword()); - } - else { - credentials = ""; - } - return "http://" + credentials + String.format("%s:%d", settings.PROXY_HOST, settings.PROXY_PORT); - } - return null; - } - - protected static @NotNull List makeSafeToDisplayCommand(@NotNull List cmdline) { - final List safeCommand = new ArrayList<>(cmdline); - for (int i = 0; i < safeCommand.size(); i++) { - if (cmdline.get(i).equals("--proxy") && i + 1 < cmdline.size()) { - safeCommand.set(i + 1, makeSafeUrlArgument(cmdline.get(i + 1))); - } - if (cmdline.get(i).equals("--index-url") && i + 1 < cmdline.size()) { - safeCommand.set(i + 1, makeSafeUrlArgument(cmdline.get(i + 1))); - } - } - return safeCommand; - } - - private static @NotNull String makeSafeUrlArgument(@NotNull String urlArgument) { - try { - final URI proxyUri = new URI(urlArgument); - final String credentials = proxyUri.getUserInfo(); - if (credentials != null) { - final int colonIndex = credentials.indexOf(":"); - if (colonIndex >= 0) { - final String login = credentials.substring(0, colonIndex); - final String password = credentials.substring(colonIndex + 1); - final String maskedPassword = StringUtil.repeatSymbol('*', password.length()); - final String maskedCredentials = login + ":" + maskedPassword; - if (urlArgument.contains(credentials)) { - return urlArgument.replaceFirst(Pattern.quote(credentials), maskedCredentials); - } - else { - final String encodedCredentials = PyPackageRepositoryUtil.encodeCredentialsForUrl(login, password); - return urlArgument.replaceFirst(Pattern.quote(encodedCredentials), maskedCredentials); - } - } - } - } - catch (URISyntaxException ignored) { - } - return urlArgument; - } - - protected static @NotNull List parsePackagingToolOutput(@NotNull String output) { - List<@NotNull PythonPackage> packageList = PipParseUtils.parseListResult(output); - List packages = new ArrayList<>(); - for (PythonPackage pythonPackage : packageList) { - PyPackage pkg = new PyPackage(pythonPackage.getName(), pythonPackage.getVersion()); - packages.add(pkg); - } - return packages; - } - - private static void applyWorkingDir(@NotNull PythonScriptExecution execution, @Nullable String workingDir) { - if (workingDir == null) { - // TODO [targets] Set the parent of home path as the working directory - } - else { - execution.setWorkingDir(TargetEnvironmentFunctions.constant(workingDir)); - } - } - - - private static @NotNull Process executeOnLocalMachineWithSudo(@NotNull GeneralCommandLine localCommandLine) throws ExecutionException { - try { - return ExecUtil.sudo(localCommandLine, PySdkBundle.message("python.sdk.packaging.enter.your.password.to.make.changes")); - } - catch (IOException e) { - String exePath = localCommandLine.getExePath(); - List args = localCommandLine.getCommandLineList(exePath); - throw new PyExecutionException(e, null, exePath, args); - } - } - - - private static @NotNull HelperPackage getPipHelperPackage() { - return new PythonHelper.ScriptPythonHelper(PIP_WHEEL_NAME + "/" + PyPackageUtil.PIP, - PythonHelpersLocator.getCommunityHelpersRoot().toFile(), - Collections.emptyList()); - } - - private static class ProcessOutputWithCommandLine { - private final @NotNull String myExePath; - private final @NotNull List myArgs; - private final @NotNull ProcessOutput myProcessOutput; - - private ProcessOutputWithCommandLine(@NotNull String exePath, - @NotNull List args, - @NotNull ProcessOutput output) { - myExePath = exePath; - myArgs = args; - myProcessOutput = output; - } - - private @NotNull String getExePath() { return myExePath; } - - private @NotNull List getArgs() { return myArgs; } - - private @NotNull ProcessOutput getProcessOutput() { return myProcessOutput; } - } -} diff --git a/python/src/com/jetbrains/python/sdk/flavors/MacPythonSdkFlavor.java b/python/src/com/jetbrains/python/sdk/flavors/MacPythonSdkFlavor.java index 2d5067fdf9aa..8df1b4a48b7f 100644 --- a/python/src/com/jetbrains/python/sdk/flavors/MacPythonSdkFlavor.java +++ b/python/src/com/jetbrains/python/sdk/flavors/MacPythonSdkFlavor.java @@ -7,15 +7,9 @@ import com.intellij.execution.process.ProcessOutput; import com.intellij.execution.util.ExecUtil; import com.intellij.openapi.diagnostic.Logger; import com.intellij.openapi.module.Module; -import com.intellij.openapi.progress.ProgressManager; -import com.intellij.openapi.ui.ValidationInfo; import com.intellij.openapi.util.SystemInfo; import com.intellij.openapi.util.UserDataHolder; -import com.intellij.openapi.util.text.HtmlBuilder; -import com.intellij.openapi.util.text.HtmlChunk; import com.intellij.util.concurrency.annotations.RequiresBackgroundThread; -import com.jetbrains.python.PyBundle; -import com.jetbrains.python.sdk.PyDetectedSdk; import org.jetbrains.annotations.ApiStatus; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; @@ -26,9 +20,6 @@ import java.util.Collection; import java.util.HashSet; import java.util.Set; -import static com.intellij.openapi.util.text.HtmlChunk.raw; -import static com.intellij.openapi.util.text.HtmlChunk.text; - @ApiStatus.Internal public final class MacPythonSdkFlavor extends CPythonSdkFlavor { @@ -71,10 +62,6 @@ public final class MacPythonSdkFlavor extends CPythonSdkFlavor packages = PyPackageManager.getInstance(venvSdk).refreshAndGetPackages(false); - final PyPackage setuptools = findPackage("setuptools", packages); - assertNotNull(setuptools); - assertEquals("setuptools", setuptools.getName()); - final PyPackage pip = findPackage("pip", packages); - assertNotNull(pip); - assertEquals("pip", pip.getName()); - } - catch (IOException e) { - throw new RuntimeException(e); - } - catch (ExecutionException e) { - throw new RuntimeException(String.format("Error for interpreter '%s': %s", sdk.getHomePath(), e.getMessage()), e); - } - } - }); - } - @Nullable private static PyPackage findPackage(String name, List packages) {