Commit Graph

20 Commits

Author SHA1 Message Date
Ilya.Kazakevich
3e9fa8d2dd [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)

(cherry picked from commit f30e9a6cd7b5d103454d66f26a0c2282d7c587fc)

GitOrigin-RevId: 6894d00debe969ecdfdadd1a7ba0d44866d9bf53
2025-11-26 16:42:51 +00:00
Alexey Katsman
1ac353ef9a [python] PY-83881 Provide python info during environment detection
GitOrigin-RevId: 4382680255fc78925c4b23ce825a2894114040c5
2025-11-03 12:05:45 +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
Vitaly Legchilkin
5e2028d129 [python] (PY-78749) single dialog for all types of Python SDKs
+ old dialogs were removed

GitOrigin-RevId: 00ed85ba578c6419373d8605ed50954e7aa58f0a
2025-10-13 22:54:32 +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
Ilia Kirianovskii
6f8920da99 [bazel] Update build files (IJI-3062)
GitOrigin-RevId: 2394c1289e33945f7640f249b17cbf34b31fd695
2025-09-23 09:25:59 +00:00
Ilya.Kazakevich
0fecbf2ca1 Python: report wrong version string
GitOrigin-RevId: ebdcf4f5be07bd1a7ff4bffd2b81a7114c2f283e
2025-09-02 14:46:47 +00:00
Ilya.Kazakevich
85d34e9c0e Python: drop unused symbols
GitOrigin-RevId: 6d571b57c6e5abe2ac88765b1c73b7f31bb1503b
2025-09-01 18:57:34 +00:00
Ilya.Kazakevich
0cf893efdf Python: support getting version for python on target.
See test for usage example

GitOrigin-RevId: aa65f15d294585040c3cdadc2ef3057c85136a19
2025-08-27 22:56:52 +00:00
Ilia Kirianovskii
dc268560b6 [bazel] Update build files (IJI-2835)
GitOrigin-RevId: 275260ab73f59d3c08f0b4cb9f4c89b74054094a
2025-08-20 08:49:22 +00:00
Ilya.Kazakevich
12960161ff Python: Introduce functions to call code against SDK:
See `sdkExecApi.kt`

GitOrigin-RevId: 0014b607ee6efa058e9144cfb208c7e75dff1e47
2025-08-06 23:27:57 +00:00
Ilya Kazakevich
8f83b52355 Python: Support Targets API in ExecService.
API changes:
Class `Args` is not used to provide arguments for commands. Previous implementation was incompatible with Targets.
Instead of `Path` we now accept `BinaryToExec` which is either Eel or Target based.

Impl:
`ExecServiceImpl` now delegates execution to `com.intellij.python.community.execService.impl.processLaunchers`: there are two functions (Eel and Targets)


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

GitOrigin-RevId: 4c4ac7023e6605caaacb1880d60faf145b4160bf
2025-08-06 16:10:47 +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
Ilya.Kazakevich
fb1a3c893b Python: narrow various return types
GitOrigin-RevId: a98a36eefe29964754fd28e445703ac91464237b
2025-06-30 21:53:26 +00:00
Nikita.Ashihmin
024d2ae147 PY-82119 Packaging: Fix env tests for conda
Signed-off-by: Nikita.Ashihmin <nikita.ashihmin@jetbrains.com>

GitOrigin-RevId: 47286211e8ca894aa2e04c3f65528a2ab22fc37c
2025-06-25 17:06:43 +00:00
Evgenii Ilichev
06fb3e21e6 Update test definitions in BUILD.bazel
GitOrigin-RevId: 12636c0153e8909f9d9658a07278edac5ceb9c23
2025-06-18 19:05:49 +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
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