Commit Graph

50 Commits

Author SHA1 Message Date
Vladimir Lagunov
230ec9b156 IJPL-190497 Eel: Rename EelDescriptor.{platform,osFamily}
GitOrigin-RevId: 8f50c3d0adf900298ec54b3e89c539da9c806909
2025-06-14 23:58:35 +00:00
Vladimir Lagunov
0c5c2a29db IJPL-190497 Eel: introduce EelOsFamily
GitOrigin-RevId: 85dc13d238d63f620c799a6e52f6cf50e87fd2b6
2025-06-14 23:58:35 +00:00
Vladimir Krivosheev
ef0323d07c IJ-MR-162467 don't export intellij.platform.core
GitOrigin-RevId: 05f350c1c087be1bf9b46d8bdac5345a65f55958
2025-06-13 21:52:48 +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
Vitaly Legchilkin
06b7a98504 [python] unify Local SDK creation UI in PyCharm and IDEA (PY-79881)
* 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
2025-06-06 22:08:02 +00:00
Vladimir Krivosheev
65fe061584 IJ-MR-162467 don't export intellij.platform.analysis
GitOrigin-RevId: fcbcb68010b58cb507fee2c47473758b999e471b
2025-06-04 11:16: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
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
Vladimir Krivosheev
0199763f2b update bazel files
GitOrigin-RevId: cfae2a38fa2430540eb4baf91b6cd2c25d48eba6
2025-05-05 12:06:54 +00:00
Ilia Kirianovskii
85311e9889 [python] Add intellij.libraries.testcontainers (not testcontainers library) to dependencies in intellij.python.community.junit5Tests.framework._test module (IJPL-116621)
Also adds intellij.libraries.testcontainers module.

GitOrigin-RevId: b230f320ca4d058994570640367c549251ceab19
2025-05-04 19:51:17 +00:00
Ilia Kirianovskii
8eb4cc6f28 [bazel] Update build files
GitOrigin-RevId: b1e6b2ea8731ab7ec544b6fbcaea337a34c2937e
2025-05-04 09:23:02 +00:00
Ilia Kirianovskii
14437f2e2f [python] Add intellij.python.community.junit5Tests.framework.conda._test module descriptor to run tests in dev-mode (IJPL-116621)
GitOrigin-RevId: 14c6508d5500b14196ab85de209a1768c931b189
2025-05-03 23:59:28 +00:00
Ilia Kirianovskii
b39b775c41 [python] Add intellij.python.community.junit5Tests.framework._test module descriptor to run tests in dev-mode (IJPL-116621)
GitOrigin-RevId: 6e5047cc36fb3ee4e592b40fcc4399e863167b51
2025-05-03 23:59:28 +00:00
Ilya.Kazakevich
73325d4a19 Python tests: Increase logging verbosity and allow people to run them without installing our pythons.
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
2025-05-01 11:58:17 +00:00
Andrii Zinchenko
c92d860f76 [eel] IJPL-172897: remove EelPath.OS, use only EelPlatform in the API
GitOrigin-RevId: 1a1b676865f759f4dbabc97165b62c77decb5087
2025-04-27 19:21:46 +00:00
Ilia Kirianovskii
675eab0b82 [bazel] Update build files
GitOrigin-RevId: 8666e87d2a1221f1d48e9c170bdf632ed0cfd6d9
2025-04-22 20:36:03 +00:00
Ilya.Kazakevich
d07f7dfdfc Python: create a hamcrest matcher for tests to check if a path is an ancestor.
Hamcrest doesn't support `nio.Path` out of the box.

See `com.intellij.python.junit5Tests.framework.TestToolsKt.startsWith`

GitOrigin-RevId: 843cf711bb441e0f2daae6c94b3df6f8ca3e7b8b
2025-04-18 00:13:21 +00:00
Ilya.Kazakevich
0893401e81 Python: Add tool to mock env vars in tests.
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
2025-04-16 21:14:49 +00:00
Vladimir Krivosheev
2826736b48 update bazel files
GitOrigin-RevId: 9a1f20bfe703fbdc66366dd15f45569df0688201
2025-03-28 18:42:12 +00:00
Ilya Kazakevich
ca46fea6b0 PY-78762: Activate conda in Powershell.
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
2025-03-28 14:51:58 +00:00
Leonid Shalupov
2e048d9e57 housekeeping: remove kotlin unused imports
GitOrigin-RevId: 1ba9dd92e225ce5e8df8fbc429acdcd38d114f36
2025-02-24 20:03:20 +00:00
Konstantin Nisht
b6d3690b12 [threading] IJPL-149765: Rename writeAction to edtWriteAction #6
GitOrigin-RevId: 635c50933068a86ac0bf62608185bd359c7ac98c
2025-02-19 22:13:13 +00:00
Vladimir Krivosheev
2afd344094 update bazel files
GitOrigin-RevId: 602896538c31a4822f284f83d7fda9cba934258f
2025-02-18 08:17:48 +00:00
David Lysenko
24544e3599 [pycharm] PY-78648 Address feedback
GitOrigin-RevId: 363b0f62c631d9cebf547088f16780100c36dcf8
2025-02-17 13:58:20 +00:00
David Lysenko
a782da7be5 [pycharm] PY-78648 Resolve uv correctly on windows
GitOrigin-RevId: f280a79ce566d43682fd77da735d037fff2e9ed3
2025-02-17 13:58:20 +00:00
David Lysenko
e256d82539 [pycharm] PY-78648 Resolve uv correctly on windows
GitOrigin-RevId: 9b8772f05a9854f1449fd933be0628fa46305dea
2025-02-14 12:43:19 +00:00
Vladimir Krivosheev
c3c21baac5 update bazel files
GitOrigin-RevId: 1a10e8174a47f688a95a93af0540f722462acd97
2025-02-03 11:42:18 +00:00
Ilya.Kazakevich
f266455cbe Python: remove test-framework -> PyCharm runtime dependency.
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
2025-02-02 21:05:54 +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
Ilya.Kazakevich
f5846e0aab Python tests: extract conda junit5 framework
it will help us to decouple test framework from community because conda is coupled tightly to it

GitOrigin-RevId: 75e4fc43f90b6e5c35adf3c80f286729b0f64ddf
2025-02-02 16:49:39 +00:00
Ilya.Kazakevich
94f852297f Python tests: extract conda setup env into separate module.
Test framework doesn't have to depend on conda now

GitOrigin-RevId: c5cb78df09324dc8ab9d335b2ab4deb945633b48
2025-02-02 16:49:39 +00:00
Vladimir Krivosheev
b8245e1370 IJ-CR-146078 update bazel files
GitOrigin-RevId: 3bcfd10f71c84283bded464e142ead99edc6a278
2025-02-02 15:20:11 +00:00
Ilya.Kazakevich
1be9caaac9 Python tests: separate conda from vanilla python env types for tests.
With this change we can move conda into the separate module to decouple test framework from community.impl

GitOrigin-RevId: 589dc29f39d9d46252681c8f31b8fe482e63595f
2025-02-02 07:05:23 +00:00
Ilya.Kazakevich
88dc070d16 Python: move classes to access pythons created by setup-env script into right module.
We now store classes to access pythons installed by tests setup env right next to the script

GitOrigin-RevId: 922e5cfbb89e1e550679796e02deb24553ad6852
2025-02-02 07:05:23 +00:00
Ilya.Kazakevich
f90034ed75 Python: close files after project generation
GitOrigin-RevId: 4d166e871d6be6eba86efbf9d72bf5585035ca61
2025-01-31 13:31:06 +00:00
Ilya.Kazakevich
1b8625925c Python: remove package attr from PythonCore and move its modules into right packages.
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
2025-01-29 02:56:22 +00:00
Ilya.Kazakevich
d1706ef57c Python: move a couple of classes to tests as they do not belong to the general framework
GitOrigin-RevId: b5cdb1c5c3575a2d9ab1f53eac07e095927c8de6
2025-01-28 03:00:25 +00:00
Ilya.Kazakevich
54b33961fe Python: Extract poetry to a separate module to resue it.
We need to decouple it from community.impl

GitOrigin-RevId: 1636a67bc2f0d4d7a93ad255cde58b4bddb84211
2025-01-28 02:47:22 +00:00
Ilya.Kazakevich
ca2148932f PY-78649: Improve error handling.
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
2025-01-22 23:07:52 +00:00
Mikhail Golubev
184c44c223 [python][tests] Reformat VanillaPythonEnvExtension to be able to find "additionalTags" among them
GitOrigin-RevId: bddc7d39a0994aec0511c971520ac49fb39438f0
2025-01-14 10:55:47 +00:00
Mikhail Golubev
691c582014 [python][tests] Don't use array's toString in an error message
GitOrigin-RevId: fd1bc599c10d3dcc76679d20491b9a70c2581439
2025-01-13 21:33:58 +00:00
Vladimir Krivosheev
9485392013 update bazel files
GitOrigin-RevId: c4c38c3273b34ae07b97f31a6f7d9ef80e7d6387
2025-01-12 14:08:41 +00:00
Ilya.Kazakevich
882c455d4d Python: Introduce "Python Services."
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
2025-01-11 16:43:37 +00:00
Ilya.Kazakevich
06ca1d1139 Python tests: make venv SDK module SDK if a module provided.
That is quite logical.

GitOrigin-RevId: 96df0b1c18680fda44300022e2e661755483077c
2025-01-07 20:30:55 +00:00
Ilya Kazakevich
6b5e485ea8 Introduce wintools module for Native API tools.
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
2025-01-06 18:18:10 +00:00
Vladimir Krivosheev
e21ef0ff94 bazel jps compiler
GitOrigin-RevId: 6fbb72277f1ca0a30b930baf33aee9e7ea0176be
2025-01-02 13:24:58 +00:00
Ilya.Kazakevich
417e214ea0 Python test cleanup: no need to depend on main module in tests: it brings too many dependencies.
GitOrigin-RevId: e7a2f750ea6296f416ff7322c0363b4fbf773bb0
2024-12-31 23:51:38 +00:00
Vladimir Krivosheev
0bc1cf1557 update bazel files
GitOrigin-RevId: 7320d3eff3aba093692ce66839c720ece6d7c4db
2024-12-30 11:28:24 +00:00
Vladimir Krivosheev
7b9ec58009 do not export intellij.database.connectivity.tests
GitOrigin-RevId: a1ef44dfa34cde110c9e6cad19d11b5e3019ab72
2024-12-28 21:45:55 +00:00
Ilya.Kazakevich
8d8fe4750f Python: move junit5 framework to community
We might need it some community modules

GitOrigin-RevId: 015a8d5baacde8b74f6939f476b9ccfbce950ca2
2024-12-25 03:19:23 +00:00