Commit Graph

63 Commits

Author SHA1 Message Date
Vitaly Legchilkin
304a1877d2 [python] new icons for system pythons pyenv/homebrew (UX-3490, UX-3365)
(cherry picked from commit af8d8d78e0bea842737ee07cc84a6de9eb005ed2)

IJ-MR-172209

GitOrigin-RevId: ba4466e1b2c3afb775bd2f0457c2acf26c9cf031
2025-08-12 18:59:44 +00:00
Aleksandr Sorotskii
bef3e00469 support system pythons provided by asdf; PY-32643 Ready for Merge
(cherry picked from commit 926ee14228644c33ab4a17247a07cdf71799b265)

IJ-MR-169793

GitOrigin-RevId: 9259bfa8a8c527ce87ddf8bc441a16bdc4bb24a1
2025-07-19 14:01:21 +00:00
Aleksandr Sorotskii
b218418321 fix system python providers registration config; PY-47379
(cherry picked from commit 4b0e7d9bf893ed5b014691e3b1081652f33e8d58)

GitOrigin-RevId: 9f5f474826f091cb442eb642e005daad6190e116
2025-07-18 12:52:47 +00:00
Aleksandr Sorotskii
363175ed94 system python providers for unix/mac/win/legacy platform; pyenv/brew system python providers; PY-47379
(cherry picked from commit 02c3c3f3e682aa60e48bd429b7862d431ce5ddac)

GitOrigin-RevId: f0b84f7603bc2d3604d797f9d078a25c54e1ec3e
2025-07-18 12:52:47 +00:00
Vladimir Lagunov
9a0da96e42 IJPL-194952 Revert "[eel] IJPL-172897: remove EelPath.OS, use only EelPlatform in the API"
This reverts commit 1a1b6768


(cherry picked from commit f07a5eac3280186c0f27e156a70498a7ed962469)

IJ-MR-167682

GitOrigin-RevId: db14b1563fc992df3842d3407321bf2cc67381e9
2025-07-01 20:42:58 +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
Ilya.Kazakevich
92b5532dc1 PY-80049: Check Python2 version correctly.
We execute `--version` to find python version.
Since 3.4 Python uses stdout for output, but before that it used stderr.

We now check both: stdout and stderr.

GitOrigin-RevId: ca9059b71cabbd1a94e26523192cdf9eeb8c1eb1
2025-03-28 18:06:13 +00:00
Ilya Kazakevich
92e25c9022 Python: Cache system pythons to speed up a function result.
1. Preload pythons from a project start activity
2. Cache them for some time (see `cache` variable)
3. Provide API to refresh


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

GitOrigin-RevId: 8b58ad3f35f144364d4103578d20a3cfc9b637f2
2025-03-27 14:31:48 +00:00
Ilya.Kazakevich
aee1c47ce5 Python: allow access to all system pythons in tests.
GitOrigin-RevId: 9b771c291bff1e1ecbaa6f890d706d2c8dae5f51
2025-03-27 04:28:56 +00:00
Leonid Shalupov
263c16140f bazel: update definitions
GitOrigin-RevId: 0f77aee04ab41b053887f490c10079bbbef2d662
2025-02-25 03:08:15 +00:00
Ilya.Kazakevich
bebfb0b848 Python: rename file to add semantics
GitOrigin-RevId: dfca7284d8c87067c515e6783398a9e4f0ec2c70
2025-02-13 22:38:38 +00:00
Vladimir Krivosheev
44a42be7a8 update bazel files
GitOrigin-RevId: e0fed946f60168a3dbca165143bbdda4191ef921
2025-02-12 09:15:06 +00:00
Ilya.Kazakevich
c6e616043d Python: add UI for system pythons
See `spi.kt`

Show provided pythons in UI And sort them.
See sort logic and a test.

GitOrigin-RevId: 7b98be47f41653d73400a64c65fbbfe3e1d78ee2
2025-02-11 22:25:45 +00:00
Vladimir Krivosheev
e9f6e4644d update bazel files
GitOrigin-RevId: c332387fc13f74305d2440f3c738be00fa0ef25a
2025-02-07 10:05:46 +00:00
Ilya.Kazakevich
1eeee6da08 Python: speed-up v2 interpreter widget initialization.
1. No need to use shell to expand simple vars for local execution.
2. Check pythons (sys and venv) in parallel (see `PythonWithLanguageLevelImpl`)

GitOrigin-RevId: d5432b12452a6a64213cd9da59a7d94e1ae2aa11
2025-02-07 00:32:11 +00:00
Vladimir Krivosheev
32eeb4ee9f update bazel files
GitOrigin-RevId: 524d4c1ce8590184de334693be7d6a207d8682f7
2025-02-05 12:27:57 +00:00
Leonid Shalupov
e4e5753846 housekeeping: remove unused imports
GitOrigin-RevId: ccba6d05260f5eb551ffa87e0d8a38dc93148a3a
2025-02-04 11:00:15 +00:00
Ilya.Kazakevich
3e14c16503 Python: Use SystemPythonService in v2 add interprets widget, also fix PY-78732.
We now use `SystemPythonService` to look for system pythons and validate new pythons against it.

GitOrigin-RevId: c06201cd03f7e1cb060a44c4578dd71f8bb05df6
2025-02-04 04:31:32 +00:00
Ilya.Kazakevich
8f069a6548 Python: sort system pythons in the correct order by default
GitOrigin-RevId: 4638d07bb3e0f18c01db157596ec5e892cd44de4
2025-02-03 23:26:34 +00:00
Ilya.Kazakevich
6b6658fbc9 Python: make system python service available from community.
We make it a part of PythonCore module to use it from community

GitOrigin-RevId: ea6b00b6ac1a24478f9ff74cb34beffab0942089
2025-02-03 22:07:16 +00:00
Aleksandr Sorotskii
e0e9e611a6 support for listing uv provided pythons PY-77537
GitOrigin-RevId: 7003a66ba729d7565c1cf876198d85d45d025659
2025-02-03 17:10:53 +00:00
Vladimir Krivosheev
c3c21baac5 update bazel files
GitOrigin-RevId: 1a10e8174a47f688a95a93af0540f722462acd97
2025-02-03 11:42:18 +00:00
Vladimir Krivosheev
b8245e1370 IJ-CR-146078 update bazel files
GitOrigin-RevId: 3bcfd10f71c84283bded464e142ead99edc6a278
2025-02-02 15:20:11 +00:00
Ilya.Kazakevich
1be9caaac9 Python tests: separate conda from vanilla python env types for tests.
With this change we can move conda into the separate module to decouple test framework from community.impl

GitOrigin-RevId: 589dc29f39d9d46252681c8f31b8fe482e63595f
2025-02-02 07:05:23 +00:00
Ilya.Kazakevich
88dc070d16 Python: move classes to access pythons created by setup-env script into right module.
We now store classes to access pythons installed by tests setup env right next to the script

GitOrigin-RevId: 922e5cfbb89e1e550679796e02deb24553ad6852
2025-02-02 07:05:23 +00:00
Ilya.Kazakevich
d38bf97b98 Python: introduce module for tool to create virtual envs.
This tool supports remote eels.

GitOrigin-RevId: d4f43a782435cef6afa66c92d6d71596269c9ea1
2025-02-02 05:05:52 +00:00
Ilya.Kazakevich
dafe83d2c7 Python: temporary hack: Move SPP to community to break cyclic dependency.
Will move it back soon.

GitOrigin-RevId: b2f032dbc9926b2e23c0438d2ce522985c7a6ad4
2025-01-30 17:45:52 +00:00
Ilya.Kazakevich
eab4466488 Python: move VirtualEnvReader out of psi-impl module
GitOrigin-RevId: c4d7bd0bf0c5592b13a2ccffcd217c1bae819637
2025-01-29 21:40:40 +00:00
Ilya.Kazakevich
1b8625925c Python: remove package attr from PythonCore and move its modules into right packages.
PythonCore consists of several v1 modules (they aren't v2 modules in its content, but bare v1 modules to be packed directly in it).

They used to have `com.jetbrains` package to match plugin's package.

I now removed plugin package and moved modules to the appropriate packages.

https://jetbrains.slack.com/archives/CMDBCUBGE/p1738073999835749?thread_ts=1738008244.276339&cid=CMDBCUBGE

GitOrigin-RevId: 5702998a23598d4aa363064025afad8951faf7f7
2025-01-29 02:56:22 +00:00