Commit Graph

39 Commits

Author SHA1 Message Date
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
Ilya.Kazakevich
80f248d842 Python: Move helpers locator out of PSI module
GitOrigin-RevId: 55fb4b41c56fdd41b6d9523cd7a148c002ffb8be
2025-06-07 21:59:42 +00:00
Ilya.Kazakevich
37827d23f7 Python: separate advancedApi.kt (low-level) from simple (api.kt) in ExecService.
Consider using `api.kt` whenever possible.

GitOrigin-RevId: fc08d3ffdcce1b68cfb568c9a4c94381c1f58042
2025-06-06 18:53:37 +00:00
Ilya.Kazakevich
19c3576535 Python: findPathInHelpers must not be nullable.
Unless user breaks installation, helpers are always there

GitOrigin-RevId: 080832690128e72128eef661f0a887ce4a85798d
2025-06-06 17:14:10 +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
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
Ilya.Kazakevich
6bf17f551a Python: introduce PyExecResult as an alias for Result<T, ExecError>.
It is just more convenient to right less generic params.

GitOrigin-RevId: cd33be23da4bb3cb09658aa6564e4d298a3ba72d
2025-05-14 20:47:57 +00:00
Andrii Zinchenko
2c59ca5374 [eel] IJPL-172897: extract ExecuteProcessException from the EelExecApi
GitOrigin-RevId: 85501068fec6ec96a82d83c5bb0f07a6b8cfeee1
2025-05-14 13:40:16 +00:00
Andrii Zinchenko
24ca6b4997 [eel] IJPL-172897: remove "results" from EelExecApi
GitOrigin-RevId: a99ed91bdfd15c018d5e12542b991c401ac190e8
2025-05-13 21:59:42 +00:00
Ilya.Kazakevich
d04ce81a54 PyCharm ExecService: provide a listener to awaitWithReporting to capture output.
It is not convenient to use progress reporting: it is sometimes better to collect it explicitly to customize output

GitOrigin-RevId: 79a68ec8b35540cfdc6aab4fda54245a7a270247
2025-05-13 21:22:14 +00:00
Vladimir Krivosheev
d7df13eea6 update bazel files
GitOrigin-RevId: c5f639cbe9180e4fa520b67738f392b8c6b8f21d
2025-05-13 08:14:56 +00:00
Ilya.Kazakevich
9655676567 PyCharm: Report progress for ExecService.
To migrate `runExecutable` to `ExecService`, we must report progress somehow.

We now emulate something like `runCommandLine` by reporting stdout/stderr as a progress.

GitOrigin-RevId: 3df511f797b06c02458c0cc30920b1ba7c20edfd
2025-05-13 00:02:26 +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
924a192984 Python: separate api and impl in ExecService
GitOrigin-RevId: b390c2c626fe14fc576da34de5b6ecd360bf6fd5
2025-05-09 04:12:06 +00:00
Ilya.Kazakevich
11c31cfde7 Python: refactor ExecService to get rid of ProcessOutput and better support interactive execution.
1. `ProcessOutput` is a legacy thing with some redundant flags: replaced with modern `EelProcessExecutionResult`.

2. There was a bug in `ProcessInteractiveHandler`: one could fetch all data from stdout, and we then did that again to get a result. That leads to an empty result. It is now fixed, see `executeInteractive` doc.

GitOrigin-RevId: 7fa57f8110a202a32a3531ff6507d42a270075a3
2025-05-08 23:32:15 +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
2378865181 Eel tests + Python: API to skip remote eels on certain OSes, use it for PyCharm test.
See `TestApplicationWithEel` for the explanation of `osesMayNotHaveRemoteEels` option.

See `RunExecutableTest` for usage.

GitOrigin-RevId: b7546d831328087993a6fc8e53ccf39dcd758bc5
2025-05-06 10:03:28 +00:00
Ilia Kirianovskii
1a2088f2c7 [bazel] Update build files
GitOrigin-RevId: 7c67cec8f9c7bb49918dec997484b7d24431e564
2025-05-01 18:01:00 +00:00
Ilya.Kazakevich
0d1edf1017 ExecService clean-up, add eel-test.
`Command` was a mistake: we should use `Binary` but with the ability to resolve it.

GitOrigin-RevId: 5151c6131af0338ea919d650c317cd9b88baeb12
2025-05-01 16:38: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
Ilya.Kazakevich
1d8be676cd Python: Migrate runExecutable to ExecService + PyResult
GitOrigin-RevId: 4e76993685f02f90cb2e4d0d8e8384aa47102eb9
2025-04-30 00:56:41 +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
Andrii Zinchenko
25825f5e6a [eel] IJPL-172897: move where function to the EelExecApi
GitOrigin-RevId: 349bd28772b8bf537ecc8421bccfeb00844ee1b6
2025-04-08 16:10:58 +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
Andrii Zinchenko
9f862f5b7e [eel] eel path utils refactoring
- IJ-CR-158810

GitOrigin-RevId: 0d3d895b16a818a3ef11ecf03179bd7d83a26646
2025-04-07 17:02:28 +00:00
Andrii Zinchenko
39aea0ea62 [eel] eel path utils: merge most of the transferring functions to the one
GitOrigin-RevId: ab93e3eb2973d2b22d864ba98007cbe2f5e89941
2025-03-30 20:42:55 +00:00
Vladimir Krivosheev
131241962d update bazel files
GitOrigin-RevId: b9299ef37d68f348f932f02341e0e1535efc3893
2025-03-13 00:44:46 +00:00
Vitaly Legchilkin
37dcd01f72 [python][exec service] add executeInteractive (PY-60410)
To work with stdin/stdout execute interactive allows direct access to the EelProcess.

GitOrigin-RevId: 81cfbded1a9e547bdecdd6224d13cd4bc7184892
2025-03-12 20:49:14 +00:00
Ilya.Kazakevich
d0b2de84bb Python: test renamed
GitOrigin-RevId: ede87b0b16f644a2d8663d541ec5bb8c23130d04
2025-02-20 00:26:25 +00:00
Ilya.Kazakevich
d066a2f02d Python: test renamed to be included into TC tests
GitOrigin-RevId: bdc70d54638f411ccffc4b45fcf003eb9d469317
2025-02-19 21:27:25 +00:00
Vitaly Legchilkin
d1bac97eb8 [python] ExecService / PyError adjustments (PY-60410)
+ replace processDescription and timeout fields with ExecOptions
+ add workingDirectory and env variables to exec options
+ support ProcessOutputTransformer for cases when both stdout/stderr and custom error handling is needed
+ make PyError classes open to have custom business errors

GitOrigin-RevId: 99c969e730cdbf23df4c9b176a43f78ede43001a
2025-02-12 21:19:30 +00:00
Vladimir Krivosheev
b8245e1370 IJ-CR-146078 update bazel files
GitOrigin-RevId: 3bcfd10f71c84283bded464e142ead99edc6a278
2025-02-02 15:20:11 +00:00
Ilya.Kazakevich
e0e38a7314 Python: ExecService: clean-up test and include into idea-main tests to be run in aggregator
GitOrigin-RevId: 52cacd8b0626a9ca13c29c08d6a60574bae0ed01
2025-02-02 05:05:52 +00:00
Ilya.Kazakevich
1bb2332f0c Python: ExecService API clean-up: it can only return ExecException, not PyError
GitOrigin-RevId: ca635cc7b5b639cb5d6434f7f360d6ddf1de0eb1
2025-01-31 23:16:54 +00:00
Ilya.Kazakevich
9d33ede5a9 Python: introduce ExecService.
This service should be used to execute one-shot processes (when you are only interested in execute-and-get-result).
It also supports simple helpers.

Code is fully Eel-compatible.

See `ExecService` and its showcase as an entry.

GitOrigin-RevId: 38f04914667b9b6c979c3cfe5acdd48718a75229
2025-01-31 06:21:41 +00:00