Extract various classes to the shared modules, `ExecutablePython` now has `env` map as it can be used by conda.
GitOrigin-RevId: eb45ea29f49132fa4f91c979f71453e6a2ade344
* use the same UI in IDEA for local SDKS as currently PyCharm has, removing redundant code
Merge-request: IJ-MR-164681
Merged-by: Vitaly Legchilkin <Vitaly.Legchilkin@jetbrains.com>
GitOrigin-RevId: fe26897837f41dd2f3b23a328d2a9098ad388e37
* 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
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
Hamcrest doesn't support `nio.Path` out of the box.
See `com.intellij.python.junit5Tests.framework.TestToolsKt.startsWith`
GitOrigin-RevId: 843cf711bb441e0f2daae6c94b3df6f8ca3e7b8b
There is a tool named `EnvironmentVariables` which mocks `System.env`.
We use it to mock `System.env` and `EnvironmentUtil`.
See `EnvironmentVariablesPathMockTest` as an example.
GitOrigin-RevId: ef48bf27d0ee2a1f0e02d62ab8370c01c0ecee52
We used to use `Invoke-Expression` but then migrated to `&`.
However, a conda activation script is a command (code block), not a file, so we need to use `Invoke-Expression` as '&' doesn't support it.
We check if a file exists, and if it does -- we use '&' which is safe and fast. We use `Invoke-Expression` otherwise.
Merge-request: IJ-MR-158505
Merged-by: Ilya Kazakevich <ilya.kazakevich@jetbrains.com>
GitOrigin-RevId: ea0772b3f5f9641a85b542903c44c3b78aed0715
To run tests you need an app (see `PlatformPrefix` logic).
We were using runtime PyCharm dependency (so all tests were run against PyCharm) but that broke `packageChecker` tests: they can only run against Idea. They depend on python modules, hence
```
packageChecker -> pythonModules -> PyCharm
```
While we believe that `packageChecker` should somehow configure the right platform explicitly (see `initializeTestEnvironment`) we remove this dependency for now
GitOrigin-RevId: 9ca04de67549ede5f413e7b8d293e0433c33df3e
it will help us to decouple test framework from community because conda is coupled tightly to it
GitOrigin-RevId: 75e4fc43f90b6e5c35adf3c80f286729b0f64ddf
With this change we can move conda into the separate module to decouple test framework from community.impl
GitOrigin-RevId: 589dc29f39d9d46252681c8f31b8fe482e63595f
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
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
See `README.txt`.
The "Python Services" is a new API for PyCharm execution subsystem.
The idea is to build the following mental model:
1. If you need an API -- there should be a service.
2. Each service has a showcase in "tests" root so you can see how it works in real life.
3. Code against interfaces.
4. Only link against those modules/services you really need.
5. No UI, no leaky abstractions in services.
This change introduces two services:
1. `SystemPythonService` to work with CPythons installed on OS.
GitOrigin-RevId: b07df246d1510a02c060fa7a929cf134879c7677
Windows Native API is a semi-documented API resided in `ntdll.dll`.
Some tasks can't be achieved on Windows without using this API.
We now have a module that calls native API via JNA and provides some kind of "high" level API for that.
Merge-request: KT-MR-19532
Merged-by: Ilya Kazakevich <ilya.kazakevich@jetbrains.com>
GitOrigin-RevId: aab141d6ae380c4595622b3f5329e48164ed1bf0