+ 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
No need to have a separate class
Signed-off-by: Ilya.Kazakevich <ilya.kazakevich@jetbrains.com>
GitOrigin-RevId: 9af33f30bbab9a85609c0c6536cb3120347fa20b
`com.jetbrains.python.Result<Something, PyError>` is supported by `com/jetbrains/python/util/ErrorSink.kt`
The idea: if your function executes some external command, return an error as the aforementioned class. `ErrorSink` will display it nicely.
GitOrigin-RevId: d8a7d6997a9aded91691dbb531c3d4286de85f15
There were three problems:
1.
There was `PyExecutionException` with an optional message which was intended to be displayed via dialog using a message as a title.
It breaks an exception contract (code that isn't aware of this particular class should still be able to fetch info, and a message is usually blank).
2.
Moreover, `ErrorSink` wasn't aware of it either and displayed it as a plain text.
3.
`PyExecutionException` didn't distinguish between "process can't be started" and "process died with error code != 0". Those are different cases.
This change:
1. Fixes `PyExecutionException` for 1 and 3.
2. Introduces API in `ErrorSink.kt` to display `PyExecutionException`
GitOrigin-RevId: a8d835afb086b23c73ced15f243d2b27b59dcf82
This package (aka PyV3) fixes several issues, including
1. Lots of `DirectoryProjectGenerator` misuses: We now create UI and settings with `ProjectGeneratorPeer`: no more manuals casts in callback
2. Decouples project generation from UI: Settings aren't aware of UI but generate a project instead. Settings are mapped to the UI using Kotlin DSL UI
3. Kotlin DSL UI panel enables validation
4. `PySdkCreator` (an interface implemented by all "v2" SDK panels) now accepts `Module`, so we can provide it Poetry
The whole machinery of `PythonGenerateProjectCallback` (a pack of manual casts only mother could love) is completely deprecated and will be removed soon.
Lots of small changes towards `suspend` functions, Kotlin DSL UI and `Flow` decrease the technical debt.
Merge-request: IJ-MR-144503
Merged-by: Ilya Kazakevich <ilya.kazakevich@jetbrains.com>
GitOrigin-RevId: 21963e843b0ae67c71a6fc5ea1229cb0f57915a9
'getSdk' and 'shouldSubscribeToLocalChanges' were called not from a subclass, so they were actually used via 'package private' visibility. And this will fail with IllegalAccessError if intellij.python.community and intellij.python.community.impl are loaded by different classloaders.
GitOrigin-RevId: 6e2f779063ae9fc188b60b3d52bb5cbe6fe496a9
We used to create `main.py` in any case, but must do that with checkbox.
This code is not elegant due to boilerplate and possible inconsistency (generator might ask for the welcome script and ignore it), but this is the only API for now.
GitOrigin-RevId: 5ecf78f017229aa77d9ec296e46fc8bb742ccc0a
Python packages use hyphens and underscores in their names. However, when publishing/searching the package on PyPI the underscore gets normalized to hyphen which can lead to inconsistencies between displaying/manipulating packages and requirements.txt files in PyCharm.
GitOrigin-RevId: 3382a6c002b8e593b9e398c182289e740dc3e19f
Now we have Code Vision hints which determine the author via Git history and show it in the editor automatically, and this information is more accurate than the tags which were automatically added when files were created.
GitOrigin-RevId: 30586ed1915e3b35394ff3ee6251607c64bbabdd
* Coroutines must call ``blockingContext`` when run legacy code with ``invokeAndWait``. Modality state leads to livelock otherwise.
* Coroutines must use ``runInterruptible` when accessing process streams (see ProcessExt.kt)
GitOrigin-RevId: 5aaa357ff329dc95efd072d50fbca7e36ab07563
Each sdk has additional data with flavor and flavor-specific data. For target-based SDK there is also target information. ``PySdkExt`` has extension method that uses this data to execute code on some SDK. For Conda we store path to conda binary and env name.
GitOrigin-RevId: c63b57aac9b5a267b3a6710902670bfe7d10c722
Each package manager must report explicitly if it needs to be subscribed to local changes or not.
Then, ``PyPackageManagersImpl`` obeys this flag.
Package manager disposed when SDK is disposed.
GitOrigin-RevId: 2cac8411c322c3b499ad6125b764c5c7e9dae8b7