Commit Graph

301 Commits

Author SHA1 Message Date
Ilya.Kazakevich
d17f8bbe67 cleanup [python]: remove unused symbols
GitOrigin-RevId: fbe0990d113825039ca6341860c24915a1493cf7
2026-02-11 05:14:23 +00:00
Ilya.Kazakevich
8fd70026cb cleanup [python]: remove unused symbols
GitOrigin-RevId: cbefb7c4667b2d2d1a8f38bcddc28fb51a0ce226
2026-02-10 23:07:23 +00:00
Andrey Vokin
0b462e6d48 PY-87533 Decrease amount of mostly unnecessary output from PySkeletonGenerator in logs
GitOrigin-RevId: 11f74e24c53c84667e98fc088a700937041b59f1
2026-02-10 21:51:36 +00:00
Ilya.Kazakevich
c797dcc7bc cleanup [python]: remove unused symbol, hide symbols not used by external plugins
GitOrigin-RevId: e5728587e408460009fa5c59fb2a1b0bcd7463a6
2026-02-04 22:34:24 +00:00
Ilya.Kazakevich
4a2ee0758f cleanup [python]: remove unused methods from PythonSdkType, mark legacy methods "internal"
GitOrigin-RevId: f7d1c0a4effefd459b6d88dd4011c1a26a93a277
2026-02-03 00:11:09 +00:00
Leonid Shalupov
188b7ef96f IJI-3282 Optimize imports
GitOrigin-RevId: 3b5c00d8ff20b8d0bb6005bc450921085d2da9b2
2026-01-31 17:03:42 +00:00
Ilya.Kazakevich
1ea3dee9b6 cleanup [python]: drop unused symbols
GitOrigin-RevId: 9ff98c4daccf35d570e47a714a7a306f5ffd23c0
2026-01-29 21:56:40 +00:00
Alexey Katsman
1c737661f5 cleanup [python]: Get rid of checkExistence in env checker
No need to perform environment check twice, first with checking the env
existence, and then without.

GitOrigin-RevId: cc49cc238b8b8a4ceabfd7d3757b06c62156deed
2026-01-29 13:25:49 +00:00
Ilya.Kazakevich
da3979b491 cleanup [python]: Stop using deprecated API basePath and rootManager
GitOrigin-RevId: 1687601dcc175ccf34e71de2bb0585ebc0fa2740
2026-01-28 21:12:16 +00:00
Ilya.Kazakevich
98320dd3d0 cleanup [python]: Module.baseDir and disposed modules problem improvement.
`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
2026-01-28 21:12:16 +00:00
Vitaly Legchilkin
95a17ccde1 PY-86776 Proper venv folders resolving
+ don't create sdks if they exist already in the sdk table

GitOrigin-RevId: 1e6d6e6b3bb62598e3bc4500852f9c1195ad4a6f
2026-01-28 00:27:29 +00:00
Alexey Katsman
0dada0f9c1 PY-86991 Remove Python sdk configurators dialogs
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
2026-01-27 20:03:34 +00:00
Ilya Kazakevich
8dd8162baf PY-87171: Wrap findAmongRoots in readAction.
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
2026-01-27 16:46:27 +00:00
Ilya.Kazakevich
89df7c174c cleanup [eel] [python]: Add extension Path.osFamily.
Calling `getEelDescriptor()` is too much ceremony.

Space-RevId: cc7d4b851dd8dbf484fe7f67e44625cdd1dd7772

GitOrigin-RevId: 2aaa72756a77a0cba7ee865eb9afc4ade39b6a27
2026-01-22 12:46:34 +00:00
Ilya.Kazakevich
d50a714a98 cleanup [python]: Use fake ctor instead of static Instance field for VirtualEnvReader.
Use `VirtualEnvReader()` instead of `VirtualEnvReader.Instance` as it is shorter and more idiomatic

Space-RevId: 58448643037948f1e7dc2e84303844b50bd56ee9

GitOrigin-RevId: 35d5b67b8a2d2964ec4b5f611b0f081ac722be2a
2026-01-22 04:24:57 +00:00
Ilya.Kazakevich
55e7ab0114 PY-85793: Enable project configuration by default
GitOrigin-RevId: a568b0b32b543cee7724d4ced4b9077e9300630d
2026-01-15 06:31:46 +00:00
Ilya Kazakevich
8990009f05 PY-86857: Show module names in the execution console during SDK configuration.
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
2026-01-14 20:16:10 +00:00
Mikhail Golubev
2d091c1080 PY-52467 Remove IronPython support in the skeleton generator
GitOrigin-RevId: 9353055482ff882309a8e186d9bd7e5e50d4bd58
2026-01-06 19:46:39 +00:00
Ilya.Kazakevich
a523b7d4d2 cleanup [python]: Make VirtualEnvReader support eel.
GitOrigin-RevId: 5855162b20bda624f764a0c75733a28b334c85ef
2025-12-26 19:40:48 +00:00
Ilya.Kazakevich
957eac5c13 [python] PY-79486: Move Module.pythonSdk to sdk module and reuse it multi-module project.
GitOrigin-RevId: db441216c40aa35cbf494e05e3f6b549cd261cd6
2025-12-26 00:13:51 +00:00
Ilya.Kazakevich
e922274b64 [python] PY-79486, PY-86454: WIP: Automatic SDK configuration, see ModuleConfigurationMode
Two modes are described in `ModuleConfigurationMode`

GitOrigin-RevId: bf6508571fd2f31ee87dd4b52c293155583c6eea
2025-12-24 21:33:56 +00:00
Vitaly Legchilkin
5b56a6ba73 PY-85756 update sdks.json registry - bump python/conda versions
GitOrigin-RevId: 64e5b234f14e79a49946cbf446f11ca174ec4971
2025-11-25 18:33:03 +00:00
Ilya Kazakevich
7a580fd48b link/PY-85711/skip-non-python-modules-for-non-pycharm-ides
[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
2025-11-24 22:50:38 +00:00
Gregory.Shrago
f4d7990970 [platform] IJPL-219282 Migrate to EDT.isCurrentThreadEdt
GitOrigin-RevId: 70586ac4da4fe8db8d2ed3975e2dd91538643f8f
2025-11-20 16:57:54 +00:00
Ilya.Kazakevich
f65bb65fd7 refactor [python]: Remove redundant Result.
`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
2025-11-13 03:21:47 +00:00
Ilya.Kazakevich
1de2d076f3 refactor [python]: Providing wrong additionalSearchPath is an error.
The contract is broken, no need to silently skip it.

GitOrigin-RevId: 3fd44268f0fd8b07d425cbb630302414b5c27574
2025-11-13 03:21:47 +00:00
Alexey Katsman
e74da66444 PY-85162 Pre-select tool based on existing envs and other markers
GitOrigin-RevId: f62cfd1e32d08ee193ff5f186f2a7d516fd9b8fa
2025-11-07 18:15:55 +00:00
Alexey Katsman
7a59af143c PY-84953: Unify tool detection approach
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
2025-11-03 11:34:53 +00:00
Alexey Katsman
ea82fe5cc2 [python] PY-83881 Provide python info during environment detection
GitOrigin-RevId: 4e424c8fa9c08ce3cd497586f5f13e5a5816f52a
2025-10-31 17:55:16 +00:00
Ilya.Kazakevich
6dbbff7253 [python] PY-79486 (WIP): Use real EPs to create SDKs.
The process is described in `ModulesSdkConfigurator` doc.

GitOrigin-RevId: 2a230c0f4cf6676108406c1af53f38dc0873f282
2025-10-24 19:25:13 +00:00
Alexey Katsman
afd63c4f9b [python] PY-83881 Remove unused API in sdk configuration
GitOrigin-RevId: 58441ba4a445b11d3bd6b38fe1a14c494ea18e50
2025-10-21 20:29:04 +00:00
Vladimir Krivosheev
b1d6fa74be IJPL-212791 IJ-MR-179029 Add intellij.platform.core.impl module dependency
GitOrigin-RevId: 3db5af6bec5f5db2eb7a4f9935dcfeb79f9ab3ab
2025-10-18 11:59:09 +00:00
Vladimir Krivosheev
dd21c53b19 IJPL-212791 IJ-MR-179029 Refactor code visibility modifiers
Add appropriate visibility modifiers (private, internal, final) to classes and constants

GitOrigin-RevId: 9ce78688b9a8c0280b63b33c38ea4d40c68aba79
2025-10-18 09:39:49 +00:00
Alexey Katsman
b82262ea01 [python] PY-84315: Use SDK configurators for inspection
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
2025-10-16 18:09:57 +00:00
Ilya.Kazakevich
c183e6e634 [python] PY-79486: (WIP) split pyproject.toml tools into backend/common.
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
2025-10-16 17:21:59 +00:00
Alexey Katsman
410645a7f3 [python] PY-82518 Support GraalPy python version
GitOrigin-RevId: 3311ca83f0875a77c0fd370d5d66afc66f7393ca
2025-10-16 12:02:08 +00:00
Ilya.Kazakevich
609582c9f5 [python] PY-79486: (WIP) EP can only have ToolId and not icon.
Icons can't be sent to the front

GitOrigin-RevId: 18da534d6872fb08c28681b82115c0edc12bdc89
2025-10-16 03:51:15 +00:00
Alexey Katsman
59fa0db43c [python] PY-83881 Detect existing environments when creating SDK
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
2025-10-14 19:24:05 +00:00
Vladimir Krivosheev
67a6dac7f8 IJPL-209476 IJ-CR-146078 kotlinx-datetime-jvm, kotlinx-document-store-mvstore, kotlinx-html-jvm, kotlinx-serialization-protobuf, kotlinx-collections-immutable
GitOrigin-RevId: 058331a1e834d7780456f98d003afe56abfc36a0
2025-10-12 11:10:47 +00:00
Vitaly Legchilkin
84934e9e9e [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

[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
2025-10-10 18:17:28 +00:00
Nikolay Chashnikov
3a8344fcad [plugin model] use 'public' visibility for content modules which classes are used from external plugins (IJPL-207059)
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
2025-10-08 18:39:06 +00:00
Vladimir Krivosheev
aef6fcfb61 IJ-MR-175479 IJ-CR-146078 IJPL-209476 intellij.libraries.kotlinx.coroutines.slf4j, icu4j, jackson, ion as product module
GitOrigin-RevId: 6ec3fc109676944133e91aff3a82c51572bf4dbc
2025-10-04 19:03:47 +00:00
Vladimir Krivosheev
601a44264f IJ-MR-175479 IJ-CR-146078 IJPL-209476 gson as product module
GitOrigin-RevId: 4e0ec5a56b91ff85cef4343c34f36e18adec1e9e
2025-10-04 19:03:47 +00:00
Vladimir Krivosheev
ec3242285e IJ-MR-175479 IJ-CR-146078 IJPL-209476 caffeine as product lib
GitOrigin-RevId: a4585825ed7a9f49d9c74266ea2ebd4323d6405e
2025-10-04 19:03:47 +00:00
Vladimir Krivosheev
9f425c84ea IJ-MR-175479 IJ-CR-146078 IJPL-209476 guava as product module (part 2)
GitOrigin-RevId: 22ee846c39d44cd481ad55d11889ff43ad3b389a
2025-10-04 19:03:47 +00:00
Vladimir Krivosheev
d7875f7d97 IJPL-209419 remove unused dependency on intellij.platform.eel.impl
GitOrigin-RevId: 4335e0cc630a881691909b11cc23b140acccbbc1
2025-10-03 15:08:44 +00:00
Ilya.Kazakevich
5a4843d743 PY-79486: Introduce sdkConfigurator module.
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
2025-10-02 06:59:28 +00:00
Ilya.Kazakevich
2888d207d9 PY-82580: pyproject.toml refactoring to combine all pyproject.toml EPs to single API
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
2025-10-01 02:21:16 +00:00
Ilia Kirianovskii
f43aa95086 [bazel] Update build files (IJI-3062)
GitOrigin-RevId: 98a67396a48bddc3d084cc93c50ae2f2017bfe8c
2025-09-29 00:11:15 +00:00
Vladimir.Koshelev
ba393efaa7 [python] PY-84398 get rid of embedded loading rules in PythonCore plugin, fix related issues
GitOrigin-RevId: 54f4bb333e0ca06a002a86c75f0bbc474863253e
2025-09-26 15:15:29 +00:00