mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-01-08 23:39:39 +07:00
PY-72443 fix module => package mapping for some of the popular ml libs
GitOrigin-RevId: 962d57b87333c8c196dbd52bcfd4b5a41ba7317b
This commit is contained in:
committed by
intellij-monorepo-bot
parent
dfc0946c45
commit
8754f98cbe
@@ -4773,10 +4773,11 @@ bson pymongo
|
||||
dotenv python-dotenv
|
||||
avro avro-python3
|
||||
modeltranslation django-modeltranslation
|
||||
torch torch-nightly
|
||||
can python-can
|
||||
github PyGithub
|
||||
gitlab python-gitlab
|
||||
tensorflow tensorflow-gpu
|
||||
aocd advent-of-code-data
|
||||
slugify python-slugify
|
||||
slugify python-slugify
|
||||
huggingface_hub huggingface-hub
|
||||
tensorflow_text tensorflow-text
|
||||
tensorflow_graphics tensorflow-graphics
|
||||
@@ -17,8 +17,7 @@ object PyPsiPackageUtil {
|
||||
/**
|
||||
* Contains mapping "importable top-level package" -> "package names on PyPI".
|
||||
*/
|
||||
@JvmField
|
||||
val PACKAGES_TOPLEVEL: Map<String, String> = loadPackageAliases()
|
||||
private val PACKAGES_TOPLEVEL: Map<String, String> = loadPackageAliases()
|
||||
|
||||
@JvmStatic
|
||||
fun findPackage(packages: List<PyPackage>, name: String): PyPackage? {
|
||||
@@ -31,8 +30,8 @@ object PyPsiPackageUtil {
|
||||
return null
|
||||
}
|
||||
|
||||
fun moduleToPackageName(module: String): String {
|
||||
return PACKAGES_TOPLEVEL.getOrDefault(module, module)
|
||||
fun moduleToPackageName(module: String, default: String = module): String {
|
||||
return PACKAGES_TOPLEVEL.getOrDefault(module, default)
|
||||
}
|
||||
|
||||
private fun loadPackageAliases(): Map<String, String> {
|
||||
|
||||
@@ -100,7 +100,7 @@ object PyTypeShed {
|
||||
return true
|
||||
}
|
||||
val possiblePackage = name.firstComponent ?: return false
|
||||
val alternativePossiblePackages = PyPsiPackageUtil.PACKAGES_TOPLEVEL[possiblePackage] ?: ""
|
||||
val alternativePossiblePackages = PyPsiPackageUtil.moduleToPackageName(possiblePackage, default = "")
|
||||
|
||||
val packageManager = PyPackageManagers.getInstance().forSdk(sdk)
|
||||
val installedPackages = if (ApplicationManager.getApplication().isHeadlessEnvironment && !PlatformUtils.isFleetBackend()) {
|
||||
|
||||
Reference in New Issue
Block a user