Commit Graph

66 Commits

Author SHA1 Message Date
Vitaly Legchilkin
67235b83d2 PY-88099 Normalize project names and improve new project wizard UX
- Add PyPackageName.normalizeProjectName() per PEP 503 name normalization spec
- Normalize project names in uv, poetry, and hatch project generators
- Fix hatch createNewProject to use NioFiles.copyRecursively instead of broken EEL move
- Add background progress indicators for module structure creation and SDK setup
- Refresh VFS with markDirtyAndRefresh after module structure creation
- Add TraceContext to project generation and packaging tool window coroutines


(cherry picked from commit b64dfb4ae541e4a220698d804aec3fe95103bdf2)

IJ-MR-194426

GitOrigin-RevId: 0a1212d70d8136e1ba8821b736d09e00d78f310e
2026-03-04 18:44:08 +00:00
David Lysenko
c23c78ac0d potw-changes-to-261
This MR cherry picks changes done for PY-87723 and PY-87578

Merge-request: IJ-MR-193482
Merged-by: David Lysenko <david.lysenko@jetbrains.com>

GitOrigin-RevId: c74229ed48ae8702667dda201613a2d0c3f25369
2026-02-26 19:55:47 +00:00
Alexey Katsman
e81dfd761d PY-87290 Collect dependencies from groups and tool specific keys
These changes support collecting python project dependencies from PEP
621 standard pyproject.toml locations (including dependency groups).
Also a support for tool specific keys to collect their dependencies was
added as well.


(cherry picked from commit cc376c1696b3ddd435e113cfa39b547d60f0f791)

IJ-MR-193200

GitOrigin-RevId: 6d87d4983755525322ca0a4f2c1aedc4510a817b
2026-02-25 09:39:19 +00:00
David Lysenko
7906446900 PY-87123
[pycharm] PY-87123 Synchronize build files

[pycharm] PY-87123 Add icons for process weight

[pycharm] PY-87123 Extract Pipenv icons/mapper into a pipenv module

[pycharm] PY-87123 Extract Conda icons/mapper into a separate module

[pycharm] PY-87459 Fix process tree autoscroll

Fixes an issue in which the process tree would not automatically scroll up
after new processes are added.

[pycharm] PY-87112 Change the icon of the tool window to a new one

[pycharm] PY-87123 Rename `Styling` object to `OutputSectionStyling`

This is done to match the naming of `TreeSectionStyling`.

[pycharm] PY-87123 Render spinner instead of an icon for running processes

[pycharm] PY-87123 Refactor TreeSection

* Extract tree content into its own composable
* Extract styling values into a styling object
* Remove redundant icons that can be constructed programmatically

[pycharm] PY-87123 Address feedback

[pycharm] PY-87123 Implement custom styling for critical errors

Critical errors are ones that are displayed to the user via the error sink.

[pycharm] PY-87123 Add tool-dependant icons to POTW process tree

[pycharm] PY-87123 Implement ProcessOutputIconMapping extension point

The extension point provides a way for tooling-related modules to define
custom mapping between file extensions and icons that should be used by
the Process Output Tool Window.


Merge-request: IJ-MR-189367
Merged-by: David Lysenko <david.lysenko@jetbrains.com>

GitOrigin-RevId: 0d728779f04f2066e929954681ec7a23741f5f74
2026-02-10 21:28:26 +00:00
Leonid Shalupov
188b7ef96f IJI-3282 Optimize imports
GitOrigin-RevId: 3b5c00d8ff20b8d0bb6005bc450921085d2da9b2
2026-01-31 17:03:42 +00:00
Ilya.Kazakevich
da3979b491 cleanup [python]: Stop using deprecated API basePath and rootManager
GitOrigin-RevId: 1687601dcc175ccf34e71de2bb0585ebc0fa2740
2026-01-28 21:12:16 +00:00
Vitaly Legchilkin
b1b1d701bc PY-60410 fix hatch cli tests (Hatch has changed own outputs in the latest release)
GitOrigin-RevId: fba9e2ee1afeded13044e7a08602eb71270d9ab9
2026-01-26 15:06:41 +00:00
Mikhail Filippov
ea41f7932a [build] IJI-2993 enable progressive mode for Kotlin
GitOrigin-RevId: f506021c20fc3b3e5ef692c9092592e3bf247036
2026-01-14 11:00:39 +00:00
Yuriy Artamonov
9514b1d461 [platform] IJPL-224518 Cleanup private modifier usages with extensions/services in intellij.python.*
GitOrigin-RevId: 8a3b9d6763dbb00e30c9266ca1decc9803ef6304
2025-12-22 22:17:32 +00:00
Mikhail Filippov
7744eca84a [build] IJPL-220367 bump Kotlin language and API versions
GitOrigin-RevId: c58c2f2ca3e4fbbe5116bd19119345174b7db32f
2025-12-20 13:35:48 +00:00
Andrii Zinchenko
092344bb30 [eel] IJPL-217770: Decouple EelDescriptor and EelMachine through EelMachineProvider
GitOrigin-RevId: 407055c63d852a064a689679f49a0beb06b8d205
2025-11-28 20:54:11 +00:00
Ilya.Kazakevich
f65bb65fd7 refactor [python]: Remove redundant Result.
`Result` was introduced to attach addition error information. If there is one, and only one possible error, `null` is much cleaner solution.

Just like `Map.get` doesn't return `PyResult` but `null` of no element found, one doesn't use `PyResult` for things like `detectTool` if the only two possible results are either tool or "no tool found".

GitOrigin-RevId: 969c817f84dfc9d61cc3737214deac1bc5c84327
2025-11-13 03:21:47 +00:00
Alexey Katsman
7a59af143c PY-84953: Unify tool detection approach
Our tool detection approach varies a lot. We have different logic for
uv, poetry and other tools. Also, uv detection is not suspendable and
doesn't have any explicit thread requirements, even though it performs
I/O operations.

This change makes such detection unified and suspendable (where
possible) and moves it to BGT.

GitOrigin-RevId: 31701e9f0a66a25628f1b5c1e4f1864692e38217
2025-11-03 11:34:53 +00:00
Alexey Katsman
ea82fe5cc2 [python] PY-83881 Provide python info during environment detection
GitOrigin-RevId: 4e424c8fa9c08ce3cd497586f5f13e5a5816f52a
2025-10-31 17:55:16 +00:00
Ilya.Kazakevich
6dbbff7253 [python] PY-79486 (WIP): Use real EPs to create SDKs.
The process is described in `ModulesSdkConfigurator` doc.

GitOrigin-RevId: 2a230c0f4cf6676108406c1af53f38dc0873f282
2025-10-24 19:25:13 +00:00
Ilya.Kazakevich
c183e6e634 [python] PY-79486: (WIP) split pyproject.toml tools into backend/common.
Each tool (uv, poetry) now has `common` and `backend` part. `common` has icons because we need them both on the front and on the back.

We might need to create `front` module also if we wouldn't be able to use icons in compose.

GitOrigin-RevId: b5662fbdf3d23f1ddaa5926469d1cfd2051a0fba
2025-10-16 17:21:59 +00:00
Ilya.Kazakevich
f1a3b39973 [python] PY-79486: (WIP) Move tools to separate modules to access them from the frontend.
We are slowly moving all tools to the separate modules to register them as EP. On the front we might have `ToolId` only. To map it to an icon we will use EP.

GitOrigin-RevId: 642f4b8d77a0a14b6b61a5192607fbc7984529c7
2025-10-15 22:13:46 +00:00
Alexey Katsman
59fa0db43c [python] PY-83881 Detect existing environments when creating SDK
Before the changes, there wasn't any mechanism to detect that
environment was already created (for example, .venv exists in the
project). In these situations, during SDK creation we could've created
another environment which was not expected by users.

With these changes, it's now possible to detect in the configurator that
environment already exists, and use it when creating SDK.


Merge-request: IJ-MR-177317
Merged-by: Alexey Katsman <alexey.katsman@jetbrains.com>

GitOrigin-RevId: a612a1069ca5275bedbcfa6af9377059dab7c072
2025-10-14 19:24:05 +00:00
Vladimir Krivosheev
d7875f7d97 IJPL-209419 remove unused dependency on intellij.platform.eel.impl
GitOrigin-RevId: 4335e0cc630a881691909b11cc23b140acccbbc1
2025-10-03 15:08:44 +00:00
Vladimir.Koshelev
657e9ebee3 update bazel files
GitOrigin-RevId: f8ee7c74051e66b41bddbc976d457d25939bc008
2025-09-30 18:46:16 +00:00
Vladimir.Koshelev
68caf2edce [python] fix symver packaging into python core plugin.
GitOrigin-RevId: 10d17df2e222722ebf1e3206dea7ac88c5201bd1
2025-09-30 18:46:16 +00:00
Ilia Kirianovskii
f43aa95086 [bazel] Update build files (IJI-3062)
GitOrigin-RevId: 98a67396a48bddc3d084cc93c50ae2f2017bfe8c
2025-09-29 00:11:15 +00:00
Vladimir Krivosheev
1b3c93d736 IJ-CR-146078 IJPL-209510 use kotlinx-serialization core and json product modules instead of jps lib (except fleet - no idea what to do)
GitOrigin-RevId: b74e1ac62eb7917aac3d5edb4bbfd2be2a4a191e
2025-09-26 20:36:41 +00:00
Vladimir.Koshelev
c5b44ca085 [python] PY-84398 get rid of package prefix in python modules.
It doesn't work. Sad, but true.

GitOrigin-RevId: c6cf4f2971ce813a2ce18afb2dcee22c2c5dad75
2025-09-26 15:15:29 +00:00
Vladimir.Koshelev
ba393efaa7 [python] PY-84398 get rid of embedded loading rules in PythonCore plugin, fix related issues
GitOrigin-RevId: 54f4bb333e0ca06a002a86c75f0bbc474863253e
2025-09-26 15:15:29 +00:00
Ilya.Kazakevich
fd6322f117 Python: move classes to com.jetbrains.python.sdk.impl and close it.
`com.jetbrains.python` was closed by accident.

GitOrigin-RevId: 78109e34c720abfa2cefb1fa7d8d20db2ed1ad11
2025-09-22 18:50:06 +00:00
Nikolay Chashnikov
4f63150cff [intellij project configuration] change JVM target level from 17 to 21 in Kotlin facets (IJPL-176259)
GitOrigin-RevId: d518be3562a359b9d4034c2972d7c8444741b7f0
2025-08-30 07:50:09 +00:00
Aleksei.Cherepanov
c7515bfd3a KTIJ-35250 [Bazel] Promote "Missing dependency superclass" warning to error (part 2)
This commit enables check only for modules WITH a Kotlin facet
Bazel generator was updated as well

GitOrigin-RevId: 90a3427d4b5a3ebc29e257693cb3748ac09bfc6a
2025-08-24 18:49:00 +00:00
Ilia Kirianovskii
dc268560b6 [bazel] Update build files (IJI-2835)
GitOrigin-RevId: 275260ab73f59d3c08f0b4cb9f4c89b74054094a
2025-08-20 08:49:22 +00:00
Vitaly Legchilkin
42e77f6682 [python][evolution] Python Sdk Evolution widget (PoC)
Merge-request: IJ-MR-172341
Merged-by: Vitaly Legchilkin <Vitaly.Legchilkin@jetbrains.com>

GitOrigin-RevId: 46dd03abe5bbcb02a9b0202d232979dff5f4e492
2025-08-13 21:51:41 +00:00
Ilya.Kazakevich
12960161ff Python: Introduce functions to call code against SDK:
See `sdkExecApi.kt`

GitOrigin-RevId: 0014b607ee6efa058e9144cfb208c7e75dff1e47
2025-08-06 23:27:57 +00:00
Ilya Kazakevich
8f83b52355 Python: Support Targets API in ExecService.
API changes:
Class `Args` is not used to provide arguments for commands. Previous implementation was incompatible with Targets.
Instead of `Path` we now accept `BinaryToExec` which is either Eel or Target based.

Impl:
`ExecServiceImpl` now delegates execution to `com.intellij.python.community.execService.impl.processLaunchers`: there are two functions (Eel and Targets)


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

GitOrigin-RevId: 4c4ac7023e6605caaacb1880d60faf145b4160bf
2025-08-06 16:10:47 +00:00
Leonid Shalupov
cff76ea65e bazel: split test and build sections in convert jps to bazel:L update Bazel files
GitOrigin-RevId: 90063178de33c2a95bfdebd160a721d6977d8097
2025-07-18 16:18:47 +00:00
Vitaly Legchilkin
0dbe740d84 [python] support of two ways of possible responses from Hatch (make it internal) (PY-60410)
GitOrigin-RevId: 79fd57310a7861e6ef4923296749d264b71df43c
2025-07-07 19:06:34 +00:00
Vitaly Legchilkin
09369d9e73 [python] support of two ways of possible responses from Hatch (PY-60410)
GitOrigin-RevId: d47225d7606fca1d65339b919b8250204360593a
2025-07-07 16:41:58 +00:00
Vitaly Legchilkin
e2c9b90b03 [python] remove the not installed inspection from pyproject.toml/build-system (PY-82182)
GitOrigin-RevId: 5668767874c720af7794a33d38626a7531610c33
2025-06-25 22:43:47 +00:00
Nikita.Ashihmin
024d2ae147 PY-82119 Packaging: Fix env tests for conda
Signed-off-by: Nikita.Ashihmin <nikita.ashihmin@jetbrains.com>

GitOrigin-RevId: 47286211e8ca894aa2e04c3f65528a2ab22fc37c
2025-06-25 17:06:43 +00:00
Nikita Ashihmin
7a7c9b3f2d PY-82191 PySDK: Refactor new priject creation to support progress
GitOrigin-RevId: 6af82359528b086811c958577f296669eb578353
2025-06-23 15:41:20 +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
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
Mikhail Filippov
40e854e522 IJPL-188826 bump Kotlin language version to 2.2
GitOrigin-RevId: 61c9fecae6a713d7e328e74b83186bc5d2f6bf66
2025-05-26 13:41:54 +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
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
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
Vitaly Legchilkin
91a13e2436 [python] implement python package manager actions (PY-79451)
* PythonPackageManagerJobService.kt added to manage tool jobs
* Base PythonPackageManagerAction.kt was added to cover all python package manager actions
* Implementations for Poetry / Hatch / uv
* Poetry pyproject.toml watcher was removed (replaced with poetry actions)

GitOrigin-RevId: 0bbc5a7802826674140ca1c80be27b6cd7d0f59e
2025-05-08 01:15:49 +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