From dafe83d2c7526b6e5a9d2541ebdf0f7fc6faf31c Mon Sep 17 00:00:00 2001 From: "Ilya.Kazakevich" Date: Thu, 30 Jan 2025 16:23:30 +0100 Subject: [PATCH] Python: temporary hack: Move SPP to community to break cyclic dependency. Will move it back soon. GitOrigin-RevId: b2f032dbc9926b2e23c0438d2ce522985c7a6ad4 --- python/openapi/intellij.python.community.iml | 1 + .../python/systemPythonSpi}/SystemPythonProvider.kt | 7 ++++--- .../jetbrains/python/systemPythonSpi}/package-info.java | 4 ++-- python/pluginCore/resources/META-INF/plugin.xml | 6 ++++++ .../intellij.python.community.services.systemPython.xml | 5 ----- .../community/services/systemPython/SystemPythonService.kt | 2 +- .../env/systemPython/impl/EnvTestPythonProvider.kt | 4 ++-- 7 files changed, 16 insertions(+), 13 deletions(-) rename python/{services/system-python/src/com/intellij/python/community/services/systemPython/spi => openapi/src/com/jetbrains/python/systemPythonSpi}/SystemPythonProvider.kt (54%) rename python/{services/system-python/src/com/intellij/python/community/services/systemPython/spi => openapi/src/com/jetbrains/python/systemPythonSpi}/package-info.java (56%) diff --git a/python/openapi/intellij.python.community.iml b/python/openapi/intellij.python.community.iml index 793a8248d990..413ca8fe6625 100644 --- a/python/openapi/intellij.python.community.iml +++ b/python/openapi/intellij.python.community.iml @@ -20,5 +20,6 @@ + \ No newline at end of file diff --git a/python/services/system-python/src/com/intellij/python/community/services/systemPython/spi/SystemPythonProvider.kt b/python/openapi/src/com/jetbrains/python/systemPythonSpi/SystemPythonProvider.kt similarity index 54% rename from python/services/system-python/src/com/intellij/python/community/services/systemPython/spi/SystemPythonProvider.kt rename to python/openapi/src/com/jetbrains/python/systemPythonSpi/SystemPythonProvider.kt index 508e84a3aa3e..4a67680f661f 100644 --- a/python/services/system-python/src/com/intellij/python/community/services/systemPython/spi/SystemPythonProvider.kt +++ b/python/openapi/src/com/jetbrains/python/systemPythonSpi/SystemPythonProvider.kt @@ -1,16 +1,17 @@ -// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. -package com.intellij.python.community.services.systemPython.spi +// 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.systemPythonSpi import com.intellij.openapi.extensions.ExtensionPointName import com.intellij.platform.eel.EelApi import com.jetbrains.python.PythonBinary +import com.jetbrains.python.systemPythonSpi.SystemPythonProvider.Companion.EP /** * Register [EP] to [findSystemPythons] */ interface SystemPythonProvider { companion object { - internal val EP: ExtensionPointName = ExtensionPointName("Pythonid.systemPythonProvider") + val EP: ExtensionPointName = ExtensionPointName("Pythonid.systemPythonProvider") } suspend fun findSystemPythons(eelApi: EelApi): Set diff --git a/python/services/system-python/src/com/intellij/python/community/services/systemPython/spi/package-info.java b/python/openapi/src/com/jetbrains/python/systemPythonSpi/package-info.java similarity index 56% rename from python/services/system-python/src/com/intellij/python/community/services/systemPython/spi/package-info.java rename to python/openapi/src/com/jetbrains/python/systemPythonSpi/package-info.java index aba5548c92a1..575af60ffd25 100644 --- a/python/services/system-python/src/com/intellij/python/community/services/systemPython/spi/package-info.java +++ b/python/openapi/src/com/jetbrains/python/systemPythonSpi/package-info.java @@ -1,9 +1,9 @@ -// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. +// Copyright 2000-2025 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. /** * This package is for JetBrains only */ @ApiStatus.Internal -package com.intellij.python.community.services.systemPython.spi; +package com.jetbrains.python.systemPythonSpi; import org.jetbrains.annotations.ApiStatus; \ No newline at end of file diff --git a/python/pluginCore/resources/META-INF/plugin.xml b/python/pluginCore/resources/META-INF/plugin.xml index 7f84a1664962..2e7f8d90a465 100644 --- a/python/pluginCore/resources/META-INF/plugin.xml +++ b/python/pluginCore/resources/META-INF/plugin.xml @@ -1037,4 +1037,10 @@ The Python plug-in provides smart editing for Python scripts. The feature set of + + + + diff --git a/python/services/system-python/resources/intellij.python.community.services.systemPython.xml b/python/services/system-python/resources/intellij.python.community.services.systemPython.xml index 63acf2f3f33d..e90adfbd3a0e 100644 --- a/python/services/system-python/resources/intellij.python.community.services.systemPython.xml +++ b/python/services/system-python/resources/intellij.python.community.services.systemPython.xml @@ -4,10 +4,5 @@ - - - \ No newline at end of file diff --git a/python/services/system-python/src/com/intellij/python/community/services/systemPython/SystemPythonService.kt b/python/services/system-python/src/com/intellij/python/community/services/systemPython/SystemPythonService.kt index 1e0c6a4badbb..b02e4372381a 100644 --- a/python/services/system-python/src/com/intellij/python/community/services/systemPython/SystemPythonService.kt +++ b/python/services/system-python/src/com/intellij/python/community/services/systemPython/SystemPythonService.kt @@ -12,11 +12,11 @@ import com.intellij.platform.eel.provider.localEel import com.intellij.python.community.impl.installer.PySdkToInstallManager import com.intellij.python.community.services.internal.impl.PythonWithLanguageLevelImpl import com.intellij.python.community.services.systemPython.SystemPythonServiceImpl.MyServiceState -import com.intellij.python.community.services.systemPython.spi.SystemPythonProvider import com.jetbrains.python.PythonBinary import com.jetbrains.python.Result import com.jetbrains.python.sdk.flavors.PythonSdkFlavor import com.jetbrains.python.sdk.installer.installBinary +import com.jetbrains.python.systemPythonSpi.SystemPythonProvider import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.withContext import org.jetbrains.annotations.ApiStatus diff --git a/python/services/system-python/tests/com/intellij/python/junit5Tests/env/systemPython/impl/EnvTestPythonProvider.kt b/python/services/system-python/tests/com/intellij/python/junit5Tests/env/systemPython/impl/EnvTestPythonProvider.kt index 6ae828afd723..f1bb8b44dfe5 100644 --- a/python/services/system-python/tests/com/intellij/python/junit5Tests/env/systemPython/impl/EnvTestPythonProvider.kt +++ b/python/services/system-python/tests/com/intellij/python/junit5Tests/env/systemPython/impl/EnvTestPythonProvider.kt @@ -1,12 +1,12 @@ -// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. +// Copyright 2000-2025 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. package com.intellij.python.junit5Tests.env.systemPython.impl import com.intellij.openapi.application.ApplicationManager import com.intellij.openapi.util.Disposer import com.intellij.platform.eel.EelApi import com.intellij.platform.eel.provider.localEel -import com.intellij.python.community.services.systemPython.spi.SystemPythonProvider import com.jetbrains.python.PythonBinary +import com.jetbrains.python.systemPythonSpi.SystemPythonProvider import com.jetbrains.python.tools.PythonType import kotlinx.coroutines.flow.map import kotlinx.coroutines.flow.toSet