[python] API cleanup: mark deprecated unused API for removal (IJPL-156972)

Deprecated APIs which still have internal usage are marked as internal to ensure that new external usages won't appear.

GitOrigin-RevId: 09818b884851d7b768f8ee0f356f982e79b46ed9
This commit is contained in:
Nikolay Chashnikov
2024-10-10 23:55:42 +00:00
committed by intellij-monorepo-bot
parent 413c38a585
commit b03b560520
5 changed files with 9 additions and 5 deletions
@@ -3,6 +3,7 @@ package com.jetbrains.python;
import com.intellij.openapi.util.NlsSafe;
import com.jetbrains.python.psi.LanguageLevel;
import org.jetbrains.annotations.ApiStatus;
import org.jetbrains.annotations.NonNls;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
@@ -447,6 +448,7 @@ public final @NonNls class PyNames {
/**
* @deprecated use {@link #getBuiltinMethods(LanguageLevel)} instead
*/
@ApiStatus.Internal
@Deprecated
public static final Map<String, BuiltinDescription> PY36_BUILTIN_METHODS = concat(
PY35_BUILTIN_METHODS,
@@ -6,6 +6,7 @@ import com.intellij.psi.StubBasedPsiElement;
import com.jetbrains.python.ast.PyAstImportElement;
import com.jetbrains.python.psi.resolve.RatedResolveResult;
import com.jetbrains.python.psi.stubs.PyImportElementStub;
import org.jetbrains.annotations.ApiStatus;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
@@ -36,6 +37,7 @@ public interface PyImportElement extends PyAstImportElement, PyElement, PyImport
/**
* @deprecated Use {@link #multiResolve()} instead.
*/
@ApiStatus.Internal
@Deprecated
@Nullable
PsiElement resolve();
@@ -27,10 +27,7 @@ import com.jetbrains.python.psi.impl.PyBuiltinCache;
import com.jetbrains.python.run.CommandLinePatcher;
import com.jetbrains.python.run.PyVirtualEnvReader;
import com.jetbrains.python.sdk.flavors.PythonSdkFlavor;
import org.jetbrains.annotations.Nls;
import org.jetbrains.annotations.NonNls;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.jetbrains.annotations.*;
import javax.swing.*;
import java.io.File;
@@ -220,6 +217,7 @@ public final class PySdkUtil {
/**
* @deprecated doesn't support targets
*/
@ApiStatus.Internal
@Deprecated
@NotNull
public static Map<String, String> activateVirtualEnv(@NotNull String sdkHome) {
@@ -28,7 +28,6 @@ import com.intellij.openapi.ui.Messages;
import com.intellij.openapi.util.Disposer;
import com.intellij.openapi.util.Pair;
import com.intellij.openapi.util.io.FileUtilRt;
import com.intellij.openapi.util.registry.Registry;
import com.intellij.openapi.util.text.StringUtil;
import com.intellij.openapi.vfs.StandardFileSystems;
import com.intellij.openapi.vfs.VfsUtilCore;
@@ -269,6 +268,7 @@ public final class PythonSdkUpdater {
/**
* @deprecated Use {@link #scheduleUpdate} or {@link #updateVersionAndPathsSynchronouslyAndScheduleRemaining}
*/
@ApiStatus.Internal
@Deprecated
public static boolean update(@NotNull Sdk sdk, @Nullable Project project, @Nullable Component ownerComponent) {
return updateVersionAndPathsSynchronouslyAndScheduleRemaining(sdk, project);
@@ -15,11 +15,13 @@ import com.jetbrains.python.codeInsight.typing.PyTypingTypeProvider.GENERATOR
import com.jetbrains.python.psi.*
import com.jetbrains.python.psi.resolve.ImportedResolveResult
import com.jetbrains.python.psi.types.*
import org.jetbrains.annotations.ApiStatus
class PyTestFixtureReference(pyElement: PsiElement, fixture: PyTestFixture, private val importElement: PyElement? = null, range: TextRange? = null) : BaseReference(pyElement, range), PsiPolyVariantReference {
private val functionRef = fixture.function?.let { SmartPointerManager.createPointer(it) }
private val resolveRef = fixture.resolveTarget?.let { SmartPointerManager.createPointer(it) }
@ApiStatus.ScheduledForRemoval
@Deprecated("Use new constructor")
constructor(namedParameter: PyNamedParameter, fixture: PyTestFixture) : this(namedParameter, fixture, null)