PY-73024 Jupyter(feat): Show waring and suggest update if notebook 6.x and python 3.7+, remove install jupyter warning

GitOrigin-RevId: 0de65c84f3cfc38436ace59034a9c5ce3909eb38
This commit is contained in:
Nikita.Ashihmin
2024-06-03 19:00:23 +04:00
committed by intellij-monorepo-bot
parent 1cfcce3b7a
commit 80aad882d5

View File

@@ -47,9 +47,18 @@ object PyPackageInstallUtils {
return true
}
suspend fun installPackage(project: Project, sdk: Sdk, packageName: String): Result<List<PythonPackage>> {
suspend fun upgradePackage(project: Project, sdk: Sdk, packageName: String, version: String? = null): Result<List<PythonPackage>> {
val pythonPackageManager = PythonPackageManager.forSdk(project, sdk)
val packageSpecification = pythonPackageManager.repositoryManager.repositories.firstOrNull()?.createPackageSpecification(packageName)
val packageSpecification = pythonPackageManager.repositoryManager.repositories.firstOrNull()?.createPackageSpecification(packageName, version)
?: return Result.failure(Exception("Could not find any repositories"))
return pythonPackageManager.updatePackage(packageSpecification)
}
suspend fun installPackage(project: Project, sdk: Sdk, packageName: String, version: String? = null): Result<List<PythonPackage>> {
val pythonPackageManager = PythonPackageManager.forSdk(project, sdk)
val packageSpecification = pythonPackageManager.repositoryManager.repositories.firstOrNull()?.createPackageSpecification(packageName, version)
?: return Result.failure(Exception("Could not find any repositories"))
return pythonPackageManager.installPackage(packageSpecification)