Commit Graph

26 Commits

Author SHA1 Message Date
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
Ilya.Kazakevich
6953f5f6c0 ExecService: all high-level sugar extensions to simplify usages
GitOrigin-RevId: ffc01ccc4c1c8f95820f3eb2b1b7c232cde81fee
2025-06-04 20:34:12 +00:00
Vitaly Legchilkin
532bcaa795 [python] use legacy virtualenv helper for pythons 3.6 & 3.7 (PY-81174)
GitOrigin-RevId: 66c432067aa012b451cedf134f019e783945f1c5
2025-06-04 16:56:43 +00:00
Vladimir Krivosheev
398df72a86 don't export intellij.grid.types
GitOrigin-RevId: f38a458a8614ae3e95616146512d9fc056ed3bbc
2025-05-28 18:00:33 +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 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
Leonid Shalupov
ffa9fb5880 project model: do not re-export intellij.platform.testFramework.common
GitOrigin-RevId: 7d4f3c50f4a91c55af565e4cab5b6f74b20f4e10
2025-05-11 21:56:24 +00:00
Ilya.Kazakevich
7a0754c1a3 Python: drop non-suspend version of setAssociationToModule
GitOrigin-RevId: db366d6641e2df2456fe96070acd835fa88f4e1f
2025-05-08 19:30:13 +00:00
Ilia Kirianovskii
8eb4cc6f28 [bazel] Update build files
GitOrigin-RevId: b1e6b2ea8731ab7ec544b6fbcaea337a34c2937e
2025-05-04 09:23:02 +00:00
Ilia Kirianovskii
dfb8791ce6 [python] Add intellij.python.community.impl.venv._test module descriptor to run tests in dev-mode (IJPL-116621)
GitOrigin-RevId: dda176a71ffdd60b5e265232b4a4219887361520
2025-05-03 23:59:28 +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
Ilya.Kazakevich
803e270d45 Python: refactor PyError hierarchy, migrate to PyResult.
DO:
For upper-level (public) API use `PyResult`.
(Optionally) for low-level APIs inside your modules use python `Result<S, E>`.
Represent errors as `PyError` whenever possible.
Report `PyError` to `ErrorSink` at the top of your code.

DON'T:
Use `kotlin.Result`
Use `PyExecutionException`
Use any exception to represent user errors.

GitOrigin-RevId: 4ecf69e1fae8be9192cd33b90e0147c725a98964
2025-04-29 00:43:56 +00:00
Ilya Kazakevich
4fa65266ab PY-78035: Sort existing pythons for V2 "new interpreter" widget.
There is a list of `PythonSelectableInterpreter` which should be sorted and filtered.

`PythonSelectableInterpreter`s are comparable now: we can sort them by type (using `uiCustomization` hash) and then by language.

There is a `sortForExistingEnvironment` function that implements the core logic of this patch.

The test is `SortForExistingEnvironmentTest`, but we also run `DetectedSelectableInterpreterSortTest` several times to make sure the order is not broken.


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

GitOrigin-RevId: 030e1b3fd171b2c41ca3473abde90607b95a9414
2025-04-24 14:43:04 +00:00
Ilya.Kazakevich
e055030ced PY-65425: Save SDK->Module assoc. to make SDK module-specific.
Wrong function was used: one must use either sdk modification or special helper function that commits the model.

GitOrigin-RevId: 343e536a195170654ddfef7de42f505806405c9e
2025-04-23 01:36:07 +00:00
Ilya.Kazakevich
36d87867b7 Various Python refactorings as prerequirements for PY-65425 and PY-78035.
1. Make SDK->Module association function `suspend` to make it testable (one can't test something that runs code by `invokeLater`)
2. Add SDK->Module associations checks into `ensureSdkIsUsable` test tool.
3. Rename fields in v2 widgets to emphasize their purpose.
4. Make this association default for `pyVenv` fixture.

GitOrigin-RevId: 58267750b6dda0b596183c8bd335ce75b00fd41d
2025-04-23 01:36:07 +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
20e38f0dfc PY-80128: Update bundled venv because an old one is incompatible with the latest.
We use bundled venv to create virtual envs because system python might not have one. However, if it does, it must be compatible with the one we bundle. A new version was released 31.mar.2025. When installed, it breaks our bundled one.

So, we bundled a version. It doesn't work with Py2 though, dus we now check language level.

GitOrigin-RevId: cc7ff994bf32ef4333908321c6bb189a0e9ca9e5
2025-04-01 23:59:35 +00:00
Konstantin Nisht
b6d3690b12 [threading] IJPL-149765: Rename writeAction to edtWriteAction #6
GitOrigin-RevId: 635c50933068a86ac0bf62608185bd359c7ac98c
2025-02-19 22:13:13 +00:00
Ilya.Kazakevich
ddcd3466f8 Python: increase test timeout
GitOrigin-RevId: 8ac544fc1b34656d15bcff666daf846147a7b3c1
2025-02-07 05:55:16 +00:00
Vladimir Krivosheev
32eeb4ee9f update bazel files
GitOrigin-RevId: 524d4c1ce8590184de334693be7d6a207d8682f7
2025-02-05 12:27:57 +00:00
Ilya.Kazakevich
f14069c14b PY-78937: Mark misc project as a wizard-based, clear flavor cache, mark trusted.
Short after project creation, so-called sdk-configuration process starts and substitutes sdk with whatever it finds.
This isn't happen for projects, created with `isProjectCreatedWithWizard`.

There is also sdk validation inspection that checks if sdk is valid. It caches results, so after new project creation it is generally good idea to clear the cache.

We also mark project trusted explicitly, so once you have all your settings deleted, you can still open this project. There is no API to test it for now

GitOrigin-RevId: 69141efc6ad36982b26602f9b34982fd7a71cb28
2025-02-05 03:31:15 +00:00
Vladimir Krivosheev
c3c21baac5 update bazel files
GitOrigin-RevId: 1a10e8174a47f688a95a93af0540f722462acd97
2025-02-03 11:42:18 +00:00
Ilya.Kazakevich
69d4f52dbb Python tests: move venv test fixture into a separate module
We finally decouple test framework from community impl

GitOrigin-RevId: 87178107f2fe785d295aca4cb46527634f465f90
2025-02-02 21:05:54 +00:00
Vladimir Krivosheev
b8245e1370 IJ-CR-146078 update bazel files
GitOrigin-RevId: 3bcfd10f71c84283bded464e142ead99edc6a278
2025-02-02 15:20:11 +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