The mutex was a global singleton whose isLocked StateFlow was observed by
every project's InterpreterFixExecutor. A lock state change from any
project fanned out updateAllNotifications() to all projects, triggering
stale cache refreshes with visible "Checking existing environments"
progress bars in idle projects.
Replace the global val with a per-project service so each project
observes only its own mutex state.
(cherry picked from commit cc14dce7d07231f6d7d4c3f654cdd8d3a2099ffc)
IJ-MR-197413
GitOrigin-RevId: 65753107b7fe9e654c99f7097f1f41c0499231dc
- Add autoConfigureSdkIfNeeded to sdkSuggestionTools that waits for
project model and uses the global mutex
- Add early return in getModuleInfo when SDK is already configured
- Simplify ModulesSdkConfigurator to use autoConfigureSdkIfNeeded
- Simplify InterpreterSettingsQuickFix to use autoConfigureSdkIfNeeded
- Remove SDK-configured notification from PyProjectSdkConfiguration
(cherry picked from commit f1423427eeb433d379519e3b9d1af00b46fc869d)
GitOrigin-RevId: b81353d3af62f2d1f694d8c0d470d4495a01c989
- Convert PyModuleService (abstract class) to Kotlin interface
- Convert PyModuleServiceImpl to Kotlin with project-level scope
- Change from application-level to project-level service
- Add findPythonSdkWaitingForProjectModel suspend method that awaits
JPS project model loading before resolving the SDK
- Mark old findPythonSdk as @ApiStatus.Obsolete
- Update all call sites to use getInstance(project)
(cherry picked from commit 4dc39a57dbc6063d37522fac8befe01329c10cde)
GitOrigin-RevId: 529405c76d8e2fa503ccc40e15dd0834dd59f469
We only autoconfigure SDK when there is one module. But there might be other (non-python) modules. We must ignore them.
(cherry picked from commit 6c45d3678aa16f54ba6967b24a8dd8afdb7fa2f6)
IJ-CR-196680
GitOrigin-RevId: 65dd0fbc6bcb6cc2abe123e820a1ae9dd4f60433
This MR cherry picks changes done for PY-87723 and PY-87578
Merge-request: IJ-MR-193482
Merged-by: David Lysenko <david.lysenko@jetbrains.com>
GitOrigin-RevId: c74229ed48ae8702667dda201613a2d0c3f25369
Support a mechanism for recommending a tool installation if we're
confident it should be used for SDK configuration. For now, it only
supports uv (with uv.lock check).
It also fixes PY-87744, since we dropped all usages of PyDetectedSdk in
our SDK configurators.
GitOrigin-RevId: f99a1089025079313db9aae09e3cfc0205e7e37f
This was done for two reasons. To support these configurators in Python
plugin, not only PyCharm. And to make it easier to split tools by plugins.
GitOrigin-RevId: 9954c0c70be4e0d87405e88a0547ba4984db3dc1
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
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
Look for toolId in build section to suggest this tool, but also use the same logic from inspection to configure the right tool automatically.
GitOrigin-RevId: faea6e6f7da89ba69e7c01dba7662d429596c46b
Even though project configurators are light, we still do not want to run 2000 `hatch` concurrently.
Conda is heavy, no more than 2 of them should ever be launched to freeze user OS.
We introduce a dead-simple API (see `ExecOptions.weight`) and use it to solve aforementioned cases.
GitOrigin-RevId: da20031c74824fc36288ddb57639e07d3a9ea5a3
[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
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
'intellij.python.sdkConfigurator.common' is marked as 'public' since it includes public API, other two modules are marked as 'internal'.
GitOrigin-RevId: 5c2d00cd0b20f9c46ec15c50e3cb0b13a8bf999c
It is not possible to use topics to access the backend. Only RPC API must be used.
Moreover, registry settings require restart.
GitOrigin-RevId: 74a266ef6318cc059b2819ce3a2224b51ecf82ac
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
When registry key is enabled, we replace all other SDK configurations (done by inspection and open processors) with a new one.
We also have an action to start this process
GitOrigin-RevId: b6e624cc0390c6f668625fffdb6b308a1c903455