No need to perform environment check twice, first with checking the env
existence, and then without.
GitOrigin-RevId: cc49cc238b8b8a4ceabfd7d3757b06c62156deed
`basePath` and `rootManager` are useless, and will be dropped soon. `baseDir` is also doubtful, but still usable.
`ModuleRootManager.getInstance` throws exception if module is disposed, so we use workspace model to make sure module isn't disposed.
GitOrigin-RevId: 01507a46539195907fb74e1e43c178fb5ff968c0
Dialogs are no longer used in sdk configurators, so those were removed.
System pythons are sorted in a way so that free-threaded Python won't be
the first one (as it's unstable and may cause issues when used as a
default for venv creation).
Venv creation is now the default fallback, so that we won't use system
python as an interpreter.
SdkCreator won't return nullable SDK anymore. Also WSL sdk configurator
should be supported by respective tools, no need in a separate
configurator.
GitOrigin-RevId: 4db65e50363ced52a9ab468c56191095354d3fa2
The following method throws exception if module id disposed:
`com.intellij.openapi.roots.ModuleRootManager.getInstance`
Even if we ask a caller to check it in advance, we still can't guarantee that nobody disposes this module in the middle of the operation.
Merge-request: IJ-MR-189222
Merged-by: Ilya Kazakevich <ilya.kazakevich@jetbrains.com>
GitOrigin-RevId: b48f6bafbd7a2c856ed753b7c32d2de0bfae8da9
Calling `getEelDescriptor()` is too much ceremony.
Space-RevId: cc7d4b851dd8dbf484fe7f67e44625cdd1dd7772
GitOrigin-RevId: 2aaa72756a77a0cba7ee865eb9afc4ade39b6a27
Use `VirtualEnvReader()` instead of `VirtualEnvReader.Instance` as it is shorter and more idiomatic
Space-RevId: 58448643037948f1e7dc2e84303844b50bd56ee9
GitOrigin-RevId: 35d5b67b8a2d2964ec4b5f611b0f081ac722be2a
SDK creator (`com/jetbrains/python/sdk/configuration/CreateSdkInfo.kt:19`) creates SDK, and we set `TraceContext` so every single call it does to `ExecutionService` (to run external tool for example) is accomplished with a module name.
Merge-request: IJ-MR-187827
Merged-by: Ilya Kazakevich <ilya.kazakevich@jetbrains.com>
GitOrigin-RevId: 86823980c1d7b0ee7901545617d6f904c55ecb7f
[python]: PY-85709: Support Python facet for non-PyCharm IDEs.
The following code doesn't work for anything but PyCharm.
```kotlin
ModuleRootManager.getInstance(module).sdk
```
We now call `com.jetbrains.python.module.PyModuleService.findPythonSdk` which supports both Python SDK and Facet.
[python]: PY-85711 : Do not touch non-python modules in `removeFakeModuleEntity` and do not set `inherited` for newly created modules.
1. We should never delete any module which isn't python.
2. No need to look for sdk in workspace as we already do that for all modules by reverting their SDK settings. Moreover, `InheritedSdkDependency` was wrong: it set project-level Java JDK as Python SDK
[python]: PY-85711 : Make `PyActiveSdkModuleConfigurable` filter non-python modules.
See `com.jetbrains.python.configuration.PyActiveSdkModuleConfigurable.isSuitableForModule` comment
[python]: PY-85711 : Move `isPythonModule` to `PyModuleService`.
We are going to reuse it all over the code
[python]: PY-85711 : Refactor `PyModuleService`.
Drop unneeded class
Merge-request: IJ-MR-183088
Merged-by: Ilya Kazakevich <ilya.kazakevich@jetbrains.com>
GitOrigin-RevId: 19f65ba65ea7ea8d8ff8698a64e6a3cbe6803cb0
`Result` was introduced to attach addition error information. If there is one, and only one possible error, `null` is much cleaner solution.
Just like `Map.get` doesn't return `PyResult` but `null` of no element found, one doesn't use `PyResult` for things like `detectTool` if the only two possible results are either tool or "no tool found".
GitOrigin-RevId: 969c817f84dfc9d61cc3737214deac1bc5c84327
Our tool detection approach varies a lot. We have different logic for
uv, poetry and other tools. Also, uv detection is not suspendable and
doesn't have any explicit thread requirements, even though it performs
I/O operations.
This change makes such detection unified and suspendable (where
possible) and moves it to BGT.
GitOrigin-RevId: 31701e9f0a66a25628f1b5c1e4f1864692e38217
There was a problem that we can detect uv environment as a virtualenv in
PyInterpreterInspection. The problem is that we don't use the knowledge
about the existing environment anyhow.
This change relies on SDK configurators to tell whether environment is
present or can be configured.
GitOrigin-RevId: 5cd5c38ca724208f9af65c8daa40bf6d2da55fca
Each tool (uv, poetry) now has `common` and `backend` part. `common` has icons because we need them both on the front and on the back.
We might need to create `front` module also if we wouldn't be able to use icons in compose.
GitOrigin-RevId: b5662fbdf3d23f1ddaa5926469d1cfd2051a0fba
Before the changes, there wasn't any mechanism to detect that
environment was already created (for example, .venv exists in the
project). In these situations, during SDK creation we could've created
another environment which was not expected by users.
With these changes, it's now possible to detect in the configurator that
environment already exists, and use it when creating SDK.
Merge-request: IJ-MR-177317
Merged-by: Alexey Katsman <alexey.katsman@jetbrains.com>
GitOrigin-RevId: a612a1069ca5275bedbcfa6af9377059dab7c072
+ add requirePythonSdk() verification for the Sdk extension functions, these methods are not designed to be called for non-python sdks and now will throw IllegalArgumentException.
also corrects dependency tree:
+ move PythonSdkUtil to the python.sdk module, remove dependency on psi.impl
+ create PySkeletonUtil for skeleton utils and leave it in the psi.impl
[python] (IJPL-205889) (BAZEL-2462) don't call getOrCreateAdditionalData for non-python sdks
+ add requirePythonSdk() verification for the Sdk extension functions, these methods are not designed to be called for non-python sdks and now will throw IllegalArgumentException
also corrects dependency tree:
+ move PythonSdkUtil to the python.sdk module, remove dependency on psi.impl
+ create PySkeletonUtil for skeleton utils and leave it in the psi.impl
GitOrigin-RevId: 20d958c5e15cc4e05545b2e61b126b5e015696ed
153 modules which contain classes used from external plugins from the Marketplace are marked as public. This is needed to ensure that it'll be possible to use that API after converting code from these external plugins to content modules.
GitOrigin-RevId: dc48e8970041fddd3bf50d280711e95ce9e9ad9b
This module listens for topic that model was just rebuilt from `pyproject.toml` and does its best to configure SDK.
It will support UI to make this process configurable
GitOrigin-RevId: c752c94385814b5fc4413316c0d9d4cc2adb41e4
The main idea is to decouple tool implementation from low-level platform APIs: Open project processor, workspace model e.t.c.
Implementing `spi.Tool` should be enough to introduce new tool.
GitOrigin-RevId: 1177b57fc0eee1ca2c88cac5b20618a6170bf521