- Remove PYPROJECT_TOML_PENDING_KEY; use settings::usePyprojectToml directly
- Disable dependencies list per-module based on Module.isPyProjectTomlBased
- Fix Apply button staying active after applying changes
- Sort module list alphabetically, apply only changed dependencies
(cherry picked from commit cd759107b7bec10003f0977a1f1f3f0973d8c429)
IJ-MR-193755
GitOrigin-RevId: fc78dc32efedea640a2cf883d6424d48e53042e1
We now have 3 options in registry: see `FeatureState`.
For the Idea we disable `pyproject.toml` autoimport due to instability.
For PyCharm we ask user as user might have different preferences for different projects.
For Rider, we enable it unconditionally, because:
1. We can't ask user in Rider: our "asking logic" depends on index, and it doesn't work in Rider, see `intellij.rider.customization.xml` comment.
2. There is no UI in Rider to configure this preference: `PythonContentEntriesConfigurable` sits in PyCharm.
(cherry picked from commit 78566e94641eef5b90feb42a1fe9737695fec951)
IJ-CR-193846
GitOrigin-RevId: 2b19070a84b0e67a01e78ef0e4d5d5233b688932
See IJPL-115436 for more info
(cherry picked from commit 6c300e982830c5cd70d501763daf6b2087b51c64)
GitOrigin-RevId: 5d47cdd2da551fbc44040418ff8613c4c4d4580a
`PyProjectAutoImportService` is only automatically started by `startAutoImportIfNeeded` if `PyProjectModelSettings.getUsePyprojectToml` is enabled.
Once enabled/disabled, `PyProjectModelSettings` starts/stops `PyProjectAutoImportService`.
Also:
1. Move `PyProjectModelStartupActivity` to `askUserIfPyProjectMustBeEnabled` to make sure it is called __after__ project creation. Otherwise, it might start project import process in the middle of project creation and delete modules.
2. Make import non-suspend (no need to access IO anyway) to make sure we can call it from `PyProjectModelSettings`
GitOrigin-RevId: e9328721ad90c76d1a473cffa15c7fec2e365c9c
Add PyProjectModelSettings with persistent state for pyproject.toml
workspace configuration. Show a notification when pyproject.toml is
detected, allowing users to enable the feature or dismiss it.
Convert PythonContentEntriesConfigurable to Kotlin and guard the
checkbox with the registry flag.
# Conflicts:
# community/python/python-pyproject/src/com/intellij/python/pyproject/model/internal/AutoImportstarter.kt
GitOrigin-RevId: 4f07afe0ad1179f99c8a05f596379e83c7b299fc
StatusBar.currentEditor is a StateFlow initialized with null that
resolves asynchronously via a serviceAsync chain. After cloning,
the widget's initial update() runs before the flow resolves, so
getSelectedFile() returns null and the widget stays hidden.
Subscribe to the flow so the widget re-evaluates once the editor
becomes available.
(cherry picked from commit db0cd436a76fef47e5a1913c2c23b5231c15c60a)
IJ-MR-192257
GitOrigin-RevId: 79140e2a60ea656eae21fe9da1f8fdecdb2eb377
Non-project files by default are not indexed, do not have a module and do not have an SDK.
`PyExternalFilesIndexService` is resposible for adding a custom entities to the workspace model.
Space-RevId: dd7c50009e56dea0d69914c9f7f1524c7e77fe20
GitOrigin-RevId: cdfa2a578a01431fb9e0a06ce820c1d9b0f3fc0d
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
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
+ Remove the redundant "existing SDKs" parameter; it always uses PythonSdkUtil.getAllSdks() under the hood.
GitOrigin-RevId: 4b6576fd3ff8782f985418a1efbacd5b576e217d
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
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
First problem was that for Hatch interpreter we didn't set module
association in configurator. Because of that we could sometimes choose
an unrelated SDK for another project.
The second problem is that for workspace members we cached SDK
inspection results. That led to an issue when we created an SDK from the
inspection quick fix, but the cached result didn't allow to set the SDK
for a child workspace member. It was fixed by not caching the result of
an inspection for workspace children.
GitOrigin-RevId: 891b12f521672cc7004f6fdb10389cc68379b73d