Commit Graph

86 Commits

Author SHA1 Message Date
Ilya.Kazakevich
3388536d2c [python]: PY-85585 : Do not display vens as system pythons in "Add new interpreter" window.
Instead of old `addManuallyAddedInterpreter` we now have two functions: one that requires system python and one that doesn't.

Both functions register system python if provided, but the latter one accepts any python (venv included).

Various "selectors" use these functions.

We also make sure no non-system python is set to `baseInterpreters`: base are always system!

As a bonus, we show "system" or "virtual env" title near interpreter.

It now checks that python is system (see `ensureSystemPython`).

Non-system pythons are never reported, and `registerSystemPython` also returns an error for non-system pythons

We need `execGetBoolFromStdout` for the further changes

Merge-request: IJ-MR-182415
Merged-by: Ilya Kazakevich <ilya.kazakevich@jetbrains.com>

(cherry picked from commit 2950f5f0cd2745c12987a92e40774d366568f312)

GitOrigin-RevId: f30e9a6cd7b5d103454d66f26a0c2282d7c587fc
2025-11-26 13:52:46 +00:00
Alexey Katsman
a03643bb9c [python] PY-84777 Use system pythons as a fallback for SDK configuration
There was a problem with detecting system-wide pythons, which relied on
binary not being a part of conda env or virtualenv. But it led to
unrelated Hatch and Poetry pythons automatically configured as
interpreters in new projects. Another problem is that free-threaded
python was chosen as default interpreter with highest priority because
of the newest version.

This change uses SystemPythonService to detect system pythons properly,
also free-threaded python used as a default interpreter only if it's the
only available option.

Merge-request: IJ-MR-179008
Merged-by: Alexey Katsman <alexey.katsman@jetbrains.com>

GitOrigin-RevId: 73bc98aed2918c44832b57f22b86c9c7d17a4301
2025-10-22 13:10:20 +00:00
David Lysenko
fc7d863a50 IJ-MR-176106-to-253
[pycharm] PY-81494 Fix deadlocking code


Merge-request: IJ-MR-179432
Merged-by: David Lysenko <david.lysenko@jetbrains.com>
[pycharm] PY-81494 Config fixes

PY-81494

[pycharm] PY-81494 Fix further flakiness

[pycharm] PY-81494 Address feedback

[pycharm] PY-81494 Fix flakiness

[pycharm] PY-81494 Separate modules

[pycharm] PY-81494 Fix tests

[pycharm] PY-81494 Change waitFor to awaitExit for coroutines

[pycharm] PY-81494 Configuration fixes

[pycharm] PY-81494 Add usage statistics

[pycharm] PY-81494 Address feedback

[pycharm] PY-81494 Add more limit tests

[pycharm] PY-81494 Post-rebase fixes

[pycharm] PY-81494 Implement logging tests

[pycharm] PY-81494 Final design adjustments

[pycharm] PY-81494 Refactor flows

[pycharm] PY-81494 Add more OutputSection tests

[pycharm] PY-81494 Add Toolbar tests

[pycharm] PY-81494 Add InterText tests

[pycharm] PY-81494 Add FilterActionGroup tests

[pycharm] PY-81494 Add EmptyContainerNotice tests

[pycharm] PY-81494 Add CollapsibleListSection tests

[pycharm] PY-81494 Add ActionIconButton tests

[pycharm] PY-81494 Address feedback

[pycharm] PY-81494 Address feedback

[pycharm] PY-81494 Post-rebase fixes

[pycharm] PY-81494 Address initial feedback

[pycharm] PY-81494 Fix existing tests & add new to tree

[pycharm] PY-81494 Implement copy to clipboard button

[pycharm] PY-81494 Amend design

[pycharm] PY-81494 Begin implementing output tests

[pycharm] PY-81494 Refactor file structure

[pycharm] PY-81494 Implement tests for process list

[pycharm] PY-81494 wip tests for process list

[pycharm] PY-81494 Finishing touches

[pycharm] PY-81494 Consolidate list logic in the model

[pycharm] PY-81494 Add logging limits

[pycharm] PY-81494 Implement open tool window on exec service error

[pycharm] PY-81494 Implement open command in terminal

[pycharm] PY-81494 Add expansion actions

[pycharm] PY-81494 Implement categorization by coroutine names

[pycharm] PY-81494 Memorize expansion states between tool window openings

[pycharm] PY-81494 Memorize scroll state between tool window openings

[pycharm] PY-81494 Introduce collapsible section for process info

[pycharm] PY-81494 Implement view setting filtering

[pycharm] PY-81494 Refactor process logging to use shared flows

[pycharm] PY-81494 Implement tests for ProcessList composable

[pycharm] PY-81494 Implement process toolwindow prototype

Merge-request: IJ-MR-176106
Merged-by: David Lysenko <david.lysenko@jetbrains.com>


Merge-request: IJ-MR-179303
Merged-by: David Lysenko <david.lysenko@jetbrains.com>

GitOrigin-RevId: 44552a582dd628d206b207e02e6f24c7749b4d9f
2025-10-22 09:04: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
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
894f26c7e9 Python: Rename and move UIInfo to openapi to reuse it from other modules
GitOrigin-RevId: 2f46a6e934853d14600351112da292586938cd86
2025-10-01 23:01:06 +00:00
Vladimir.Koshelev
657e9ebee3 update bazel files
GitOrigin-RevId: f8ee7c74051e66b41bddbc976d457d25939bc008
2025-09-30 18:46:16 +00:00
Vladimir.Koshelev
8a9a4a5eb8 [python] fix running intellij.python.community.services.systemPython
GitOrigin-RevId: 166a0991c7b5032a63efebad1eb078cc15540b46
2025-09-30 18:46: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
3779e63fa2 [python] PY-84398 move icon files to make the icon generator happy
GitOrigin-RevId: 1c678f53eea4732cc71739df3721513b351ddeb4
2025-09-26 15:15:29 +00:00
Vladimir.Koshelev
c5b44ca085 [python] PY-84398 get rid of package prefix in python modules.
It doesn't work. Sad, but true.

GitOrigin-RevId: c6cf4f2971ce813a2ce18afb2dcee22c2c5dad75
2025-09-26 15:15:29 +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
Ilia Kirianovskii
1cbae62ad0 [python] Add intellij.python.community.services.systemPython._test module descriptor to run tests in dev-mode (IJPL-116621)
GitOrigin-RevId: 25fe4967dd614f21dc88e495bd0c02bdd2cd2ac8
2025-09-25 08:48:32 +00:00
Ilia Kirianovskii
62aaf2e1ab [python] Add intellij.python.community.services.internal.impl._test module descriptor to run tests in dev-mode (IJPL-116621)
GitOrigin-RevId: bdacf3c5e1bf59a31110e05b580ce2188be03278
2025-09-25 08:37:39 +00:00
Ilia Kirianovskii
4aef697527 [python] Add intellij.python.community.services.shared._test module descriptor to run tests in dev-mode (IJPL-116621)
GitOrigin-RevId: 8acac1956e5601527d14e9e58dc3bb8f68ecf78a
2025-09-25 08:24:59 +00:00
Ilia Kirianovskii
6f8920da99 [bazel] Update build files (IJI-3062)
GitOrigin-RevId: 2394c1289e33945f7640f249b17cbf34b31fd695
2025-09-23 09:25:59 +00:00
Vladimir.Koshelev
4fca8ab8c8 [python] migrate junit5python tests to dev run
GitOrigin-RevId: c2b474f4fe944f6ed9c6729b730574f6dc56350d
2025-09-04 16:40:32 +00:00
Ilya.Kazakevich
682550148c PY-83776: Add logging to trace the problem.
Enable the following log:
```
#com.intellij.python.community.services.shared:debug
```

GitOrigin-RevId: 7ea444ebca62d3f8186d983cd10381199165a0a2
2025-08-31 18:05:23 +00:00
Ilia Kirianovskii
e857678b3f [bazel] Update build files (IJI-2835)
GitOrigin-RevId: 4029606395c15069d4528b2558b29d78f6987bb3
2025-08-20 10:24:48 +00:00
Ilia Kirianovskii
dc268560b6 [bazel] Update build files (IJI-2835)
GitOrigin-RevId: 275260ab73f59d3c08f0b4cb9f4c89b74054094a
2025-08-20 08:49:22 +00:00
Vitaly Legchilkin
f2cf197bb8 [python] new icons for system pythons pyenv/homebrew (UX-3490, UX-3365)
GitOrigin-RevId: af8d8d78e0bea842737ee07cc84a6de9eb005ed2
2025-08-12 17:03:57 +00:00
Andrii Zinchenko
cc2954797c [eel][wsl] IJPL-196973 Compile error open target not source in wsl
- provide the possibility to get IjentApi instance by specific EelDescriptor

GitOrigin-RevId: 874542c0261cad5908da1fd10162f66800e97928
2025-07-23 15:04:29 +00:00
Andrii Zinchenko
2fa1af099c [eel][wsl] IJPL-196973 Compile error open target not source in wsl
- Split EelDescriptor in to EelDescriptor and the EelMachine
- Add EelPathBoundDescriptor

GitOrigin-RevId: e0b7e5d5f3532682498466642b034e1892ef3cda
2025-07-23 15:04:29 +00:00
Aleksandr Sorotskii
a79ea7edfd support system pythons provided by asdf; PY-32643 Ready for Merge
GitOrigin-RevId: 926ee14228644c33ab4a17247a07cdf71799b265
2025-07-18 20:36:53 +00:00
Leonid Shalupov
cff76ea65e bazel: split test and build sections in convert jps to bazel:L update Bazel files
GitOrigin-RevId: 90063178de33c2a95bfdebd160a721d6977d8097
2025-07-18 16:18:47 +00:00
Aleksandr Sorotskii
1e3bf294c7 system python providers for unix/mac/win/legacy platform; pyenv/brew system python providers; PY-47379
GitOrigin-RevId: 02c3c3f3e682aa60e48bd429b7862d431ce5ddac
2025-07-14 17:33:19 +00:00
Ilya.Kazakevich
3156c22dee Python: localize string
GitOrigin-RevId: 63f2e888bff6d4e9ebccf67d43c6d9a927cba900
2025-06-25 16:54:15 +00:00
Evgenii Ilichev
06fb3e21e6 Update test definitions in BUILD.bazel
GitOrigin-RevId: 12636c0153e8909f9d9658a07278edac5ceb9c23
2025-06-18 19:05:49 +00:00
Ilya.Kazakevich
93d8518b8d PY-78033/Sort-Base-interpreter-list
After this refactoring we how have `comparators.kt` with sorting logic that is used both by `SystemPython` and `PythonSelectableInterpreter` (ViewModel thing for V2).

Tests are also added.

GitOrigin-RevId: 9d04405829f31874d15cb893d9261c7997cb2dd5
2025-06-09 19:24:35 +00:00
Ilya.Kazakevich
107201d413 Python: refactoring before interpreters service.
Extract various classes to the shared modules, `ExecutablePython` now has `env` map as it can be used by conda.

GitOrigin-RevId: eb45ea29f49132fa4f91c979f71453e6a2ade344
2025-06-08 04:14:00 +00:00
Ilya.Kazakevich
105554c91d Python: introduce getOr("message"){} API to add errors on an appropriate level.
See `getOr` extension doc.

GitOrigin-RevId: 859af221e99f03b99ee2f82e829e83e0f00a9e6d
2025-06-07 22:05:56 +00:00
Ilya.Kazakevich
cea3e7d9c0 Python: make python with language level independent from python binary to support conda and other python types.
GitOrigin-RevId: 2752eed732ab6d3e45da38714106700ba2014bd8
2025-06-07 22:05:56 +00:00
Ilya.Kazakevich
2e14347844 Python: extract python-specific extensions from exec service to simplify API and make it extendable for intepreters.
Use `ExecService` `api.kt` to exec any binary and extensions from `execService.python/api.kt` for python-specific things (i.e helpers)

GitOrigin-RevId: bb217798a9d1ee886c4b12220ec1f66a5ef08336
2025-06-07 22:05:56 +00:00
Ilya.Kazakevich
2a0d551f3c Migrate to PyResult
GitOrigin-RevId: 1e89a6eebccaf3fa42b3d64c7e483af29583b8d6
2025-06-06 02:07:29 +00:00
Vitaly Legchilkin
50995c2812 [python] migration from kotlin.Result to python.PyResult in package managers (PY-81238)
* introduce PyResult.localizedError() (instead of failure()
* get rid of obsolete kotlin.Result.failure(..) extension
* add errorOrNull to python.Result, to access it from Java classes

Merge-request: IJ-MR-163973
Merged-by: Vitaly Legchilkin <Vitaly.Legchilkin@jetbrains.com>

GitOrigin-RevId: 2bd8336cf4c53170eea5d050f609fd64541ebd99
2025-05-27 07:18:45 +00:00
Vladimir Lagunov
87760e00c4 Eel cleanup: optimize imports
GitOrigin-RevId: fcf10b235485a79402805793d13150983e595e33
2025-05-20 16:27:30 +00:00
Vladimir Lagunov
3fcec7e44c IJPL-172897 Rename EelDescriptor.{upgrade,toEelApi}
According to feedback, the name `upgrade` confuses people.

We refused `getEelApi` because this call usually implies a getter, and a getter usually implies some lightweight operation.

We refused `make`, `convert`, `get` and other short methods because they're as confusing as `upgrade`.

GitOrigin-RevId: 56adf5362f93bc4f98954db79c039e5e898b4550
2025-05-20 16:27:30 +00:00
Andrii Zinchenko
5ace6d13eb [eel] IJPL-184988: Get rid of EelResult
- remove results from the channels

GitOrigin-RevId: 25c5ab5cfcc56c5bf62e53427e7702de1e3368a3
2025-05-15 08:24:55 +00:00
Andrii Zinchenko
24ca6b4997 [eel] IJPL-172897: remove "results" from EelExecApi
GitOrigin-RevId: a99ed91bdfd15c018d5e12542b991c401ac190e8
2025-05-13 21:59:42 +00:00
Vladimir Krivosheev
e6503904f1 update bazel files
GitOrigin-RevId: 56d6864910cad2dfe611d38d680ee290d4209f79
2025-05-13 18:02:20 +00:00
Ilia Kirianovskii
a38a19fa65 [bazel] Update build files
GitOrigin-RevId: b3eb595781593209fca189a18c0091f11621bd51
2025-05-13 15:36:09 +00:00
Vladimir Krivosheev
3616fb0a2f simplify bazel labels (another step towards using simple names that reflect directory structure) — handle camelCase case
GitOrigin-RevId: 709eafe49fcb3be48c50440ae19a08e083bc8cb3
2025-05-12 07:18:42 +00:00
Vladimir Krivosheev
6f8ff07ccc simplify bazel labels (another step towards using simple names that reflect directory structure)
GitOrigin-RevId: 12bfb2d0fa315d87c7a4ade363d0f834cf324b71
2025-05-08 16:58:30 +00:00
Ilya.Kazakevich
73325d4a19 Python tests: Increase logging verbosity and allow people to run them without installing our pythons.
People usually struggle to run a Gradle script to install pythons, so we:

1. Tell them explicitly what to do.
2. Provide `PYTHON_FOR_TESTS` env var they can point to Python.

GitOrigin-RevId: 06337f1f7d831f1d4b1e94134bdc78c2db2a08dc
2025-05-01 11:58:17 +00:00
Vladimir Krivosheev
e3d5d85a47 update bazel files
GitOrigin-RevId: 4a1f45312f93e76248b05a7c8cc27a2b2ac84036
2025-04-30 14:07:08 +00:00
Vladimir.Koshelev
67594cdaad [pycharm] finish community migration to v2
# Conflicts:
#	community/python/pluginCore/resources/META-INF/plugin.xml

GitOrigin-RevId: e4d6969fd15a3fddc4d6a03491fb9f9634285edf
2025-04-30 10:08:56 +00:00
Andrii Zinchenko
c92d860f76 [eel] IJPL-172897: remove EelPath.OS, use only EelPlatform in the API
GitOrigin-RevId: 1a1b676865f759f4dbabc97165b62c77decb5087
2025-04-27 19:21:46 +00:00
Ilya Kazakevich
87a5090585 Python: Do not access the Registry in SystemPythonServiceImpl ctor as it might not be available at that moment.
If we access `SystemPythonServiceImpl` before the Application is fully loaded (i.e. `com.intellij.python.junit5Tests.env.systemPython.SystemPythonRootsFixer.execute`), we might encounter an error:
```
 Registry key python.system.refresh.minutes is not defined
 ```

 With this change we access Registry lazily and, unlike `Registry.get`, `RegistryManager` async service is fully safe: it just suspends until the Registry is available.


Merge-request: IJ-MR-160727
Merged-by: Ilya Kazakevich <ilya.kazakevich@jetbrains.com>

GitOrigin-RevId: ef56cfee7b15907c7c99b859b5704b6fcef66b01
2025-04-23 18:32:37 +00:00
Andrii Zinchenko
a7e22b196b [eel] IJPL-172897: cleanup: remove deprecated exec api builder
GitOrigin-RevId: 4eee2a51401f229a57ac4f5057e078f57fc9bcb9
2025-04-08 16:10:58 +00:00
Ilya.Kazakevich
baf30ce79a Python tests: timeout increased (venv might be slow on some agents)
GitOrigin-RevId: 49cb95c758ce51743e8e1c4c67b79f20b19ceef4
2025-04-02 21:38:42 +00:00