1. Project rebuild process disposes modules and kills `PyV3` project generation (i.e. Django). We now skip autoimport for newly generated projects, and PyV3 calls `startAutoImportIfNeeded` after project generation.
2. EP introduced to update run configurations when module gets renamed.
GitOrigin-RevId: 55183da9c1f9d1e96e837e970254443fbaec6b5e
Not only `members` table declared in the root, but also root itself is member, and can depend on its members.
GitOrigin-RevId: b1ff05222ae240fac20b5d8bc69f06ff89f51fad
We drop old modules and create news ones on each `pyproject.toml` change.
We need to preserve SDK.
There were 2 bugs:
1. `relocateUserDefinedModuleSdk` was called **after** `removeFakeModuleAndConflictingEntities`, hence all modules were removed.
2. We didn't survice module renaming as we used module name as the only key. We now use path aswell.
Test included.
Merge-request: IJ-MR-189724
Merged-by: Ilya Kazakevich <ilya.kazakevich@jetbrains.com>
GitOrigin-RevId: 2a218ed14dcb2917834c6f554cdabfc975bb0cc5
When dropping existing modules using `removeFakeModuleAndConflictingEntities` we should ignore case.
GitOrigin-RevId: 2314f1916d1f2e43bce699703bdf8800c543f6b3
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
For every module we now have `Module.isPyProjectTomlBased`. It can be used to distinguish legacy modules from new ones, see the YT issue for the list of possible usages.
Merge-request: IJ-MR-189200
Merged-by: Ilya Kazakevich <ilya.kazakevich@jetbrains.com>
GitOrigin-RevId: 4f265bd66dc15609caae0624a61cd3a6ee41451c
Use `VirtualEnvReader()` instead of `VirtualEnvReader.Instance` as it is shorter and more idiomatic
Space-RevId: 58448643037948f1e7dc2e84303844b50bd56ee9
GitOrigin-RevId: 35d5b67b8a2d2964ec4b5f611b0f081ac722be2a
`com.intellij.python.pyproject.PyProjectToml.Companion.parse` used to return Error in case of broken file so we simply ignored it. We now return `TomlTable` itself even in case of error.
So `com.intellij.python.pyproject.model.internal.pyProjectToml.TomFileToolsKt.readFile` is only null (which means module is skipped) if there is `IOException` reading `pyproject.toml` (either file doesn't exist or unreadable).
GitOrigin-RevId: 94fa7f46516450a9b0922679aa0d9d12571fae4f
No need to look for `pyproject.toml` in venv dirs. Moreover, they must be marked as "excluded".
GitOrigin-RevId: 60d0491e9372db9eaaf8e8958c2fd160b096cec6
`dispose` might be called before `projectId` set.
Project might be rebuilt using blue refresh icon in any toml file
GitOrigin-RevId: 7ed180ec071960ca6b24ef3b2791cad6b1c4d316
Project dir is out of our control (as any IO) we must survive even when user deletes it in the middle of a process.
GitOrigin-RevId: 577fb26c1418f44fd09796d0c4d5082638433cbe
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
This function transfers SDK from old module (deleted one) to a new one.
This commit adds a test.
GitOrigin-RevId: 77c4cbbb81a166744076db9d5f5a9f3224a70746
[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
Currently, we don't have a special 'visible for testing' variant of the visibility modifier, so we need to mark such modules as internal to avoid errors after the visibility checks are enabled at runtime.
Reviewed in IJ-MR-180677.
GitOrigin-RevId: 1dcff728cc567e0c9c4055285b279402b7e5e030
1. Obey registry key.
2. Use `readAction` to prevent race when file chaned from another thread.
3. Extract action title to the i18n
GitOrigin-RevId: eb9ca0841c13de06fb636d1e14f34d4a1b72b598
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
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