390 Commits
Author SHA1 Message Date
Vitaly Legchilkinandintellij-monorepo-bot 1dc7eb5123 PY-88280 Convert PyModuleService to Kotlin project-level service with suspended SDK resolution
- Convert PyModuleService (abstract class) to Kotlin interface
- Convert PyModuleServiceImpl to Kotlin with project-level scope
- Change from application-level to project-level service
- Add findPythonSdkWaitingForProjectModel suspend method that awaits
  JPS project model loading before resolving the SDK
- Mark old findPythonSdk as @ApiStatus.Obsolete
- Update all call sites to use getInstance(project)

(cherry picked from commit 4dc39a57dbc6063d37522fac8befe01329c10cde)

GitOrigin-RevId: 529405c76d8e2fa503ccc40e15dd0834dd59f469
2026-03-18 17:22:13 +00:00
Vitaly Legchilkinandintellij-monorepo-bot 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 Lysenkoandintellij-monorepo-bot 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
Vitaly Legchilkinandintellij-monorepo-bot eab2b8b719 PY-87191 Always provide system Python when setting up Poetry environment
- Extract PyVersionSpecifiers from Poetry-specific PoetryPythonVersion
  into python-community-openapi for reuse across subsystems
- Add PyVersionSpecifiers parameter to PythonInstallerService.installLatestPython()
  so installation respects pyproject.toml version constraints
- Pass version specifiers from getSystemPython() through to the installer
- Move pyproject.toml python-version parsing to pyproject PSI utilities
- Replace PoetryPyProjectTomlPythonVersionsService internals with PyVersionSpecifiers


(cherry picked from commit 5ef8f7cb3430826ee38cd80ab460ea4a52da919a)

IJ-MR-193218

GitOrigin-RevId: a989e2dffd5b3081db526b703f9cc6085eac96d5
2026-02-26 12:50:57 +00:00
Pavel Karateevandintellij-monorepo-bot 288cbb900e [python] PY-87838 support pythont and pythonw executables
(cherry picked from commit 310fe84b7ecd1533c75fadcfa542d022474822a0)

IJ-MR-192712

GitOrigin-RevId: 50d2d75c519506e861e9f87c957abceed0699c3a
2026-02-25 18:33:53 +00:00
Alexey Katsmanandintellij-monorepo-bot edaad5131e PY-87789 Fix existing venv alert for uv
The alert for existing venv in SDK creation dialog was missing. This
commit adds it back, also tying it together with the venv path field
validator. In particular, we now support existing venv alert for any
venv typed in the field (including on remotes). Also, it's now possible
to override existing venv.

Also these changes fix broken alert for in-project poetry environment.


(cherry picked from commit 3cf7202ab0a1393c510abb07e2e0d5676cff9a69)

IJ-MR-192485

GitOrigin-RevId: 79b6852ddd6edef14a1c808a1a5bf83e2ac5fc31
2026-02-20 08:45:28 +00:00
Ilya Kazakevichandintellij-monorepo-bot bb1ccaf504 PY-86605: Do not access IO from interpreterType.
This property violates kotlin ideology: properties must be fast, `O(1)`, and thread agnostic.

This one is used all over the system including plugins (unfortunately) and we can't force callers to use BG. So we have to make it thread-agnostic. We sacrifice accuracy in favor of speed. Most people use `.pyenv` as a dir name, and those who do not, will be excluded from the statistics. Note, that this function was never intended to be used for anything but statistics.

`LOG.error` throws exception in tests (but not in prod) so we use it to make sure we do not access IO from this function.


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

GitOrigin-RevId: a92a233bcce22d47e522034c04ba2c93d2efb33b
2026-02-13 15:15:05 +00:00
Nikolay Chashnikovandintellij-monorepo-bot 172138ad57 IJPL-212619 python: mark deprecated unused API for removal
API, which was marked as deprecated in 252 or earlier and has no external and internal usages, is marked for removal.

GitOrigin-RevId: 1b2718d98de6c12266e9224d59e594ffbc986670
2026-02-13 14:59:20 +00:00
Alexey Katsmanandintellij-monorepo-bot 17afc5ef19 PY-87517 Check python binary name for targets
When adding new interpreter, we could either specify venv root or python
binary path. Since we cannot check actual files for targets, we check
path regex to determine whether it's a venv root or a binary.

GitOrigin-RevId: d46ef025d9681b4d697d5d9572d0302c9599fdfc
2026-02-11 13:18:26 +00:00
Ilya.Kazakevichandintellij-monorepo-bot c797dcc7bc cleanup [python]: remove unused symbol, hide symbols not used by external plugins
GitOrigin-RevId: e5728587e408460009fa5c59fb2a1b0bcd7463a6
2026-02-04 22:34:24 +00:00
Ilya.Kazakevichandintellij-monorepo-bot 13045f4379 cleanup [python]: remove deprecated symbols.
If you need venv, use `createVenv(sdk.asBinToExecute()`.

GitOrigin-RevId: d2a2bd6df749ad22bf13496bd11595504a9da5cd
2026-02-04 06:51:26 +00:00
TimurMalaninandintellij-monorepo-bot 7e6ea0e505 PY-87281 Support versioned Python binaries
PY-87081 Prefer shortest Python binary name when resolving interpreters in virtual environments.

PY-87281 Support versioned Python binaries (python3, python3.13, pypy3, etc.)

Replace hardcoded Python binary name sets with regex patterns to match
versioned executables like python3.13, python3.11.5, pypy3.10.


Merge-request: IJ-MR-189909
Merged-by: Timur Malanin <timur.malanin@jetbrains.com>

GitOrigin-RevId: f60b1c15b75e63cd96fd21c087b051c38ab095fe
2026-02-03 19:08:12 +00:00
Leonid Shalupovandintellij-monorepo-bot 188b7ef96f IJI-3282 Optimize imports
GitOrigin-RevId: 3b5c00d8ff20b8d0bb6005bc450921085d2da9b2
2026-01-31 17:03:42 +00:00
Ilya.Kazakevichandintellij-monorepo-bot 89df7c174c cleanup [eel] [python]: Add extension Path.osFamily.
Calling `getEelDescriptor()` is too much ceremony.

Space-RevId: cc7d4b851dd8dbf484fe7f67e44625cdd1dd7772

GitOrigin-RevId: 2aaa72756a77a0cba7ee865eb9afc4ade39b6a27
2026-01-22 12:46:34 +00:00
Ilya.Kazakevichandintellij-monorepo-bot d50a714a98 cleanup [python]: Use fake ctor instead of static Instance field for VirtualEnvReader.
Use `VirtualEnvReader()` instead of `VirtualEnvReader.Instance` as it is shorter and more idiomatic

Space-RevId: 58448643037948f1e7dc2e84303844b50bd56ee9

GitOrigin-RevId: 35d5b67b8a2d2964ec4b5f611b0f081ac722be2a
2026-01-22 04:24:57 +00:00
Timur Malaninandintellij-monorepo-bot 887d6b9b74 PY-86247 Introduced an ability to choose folder that contains python binary instead of direct searching of file
GitOrigin-RevId: 20ab5cb28abd08fe05c528f11583bb9f37706926
2026-01-18 16:34:33 +00:00
Ilya.Kazakevichandintellij-monorepo-bot bc2191d11f cleanup [python]: Read only first file, do not create a list without a reason
GitOrigin-RevId: a0b8c7eb4268c8d26b01143fb34c9667269d70d9
2026-01-13 05:35:52 +00:00
Ilya.Kazakevichandintellij-monorepo-bot 3e47d60be1 cleanup [python]: Fix a couple of VirtualEnvReader bottlenecks.
1. No need to check if file is directory: FS isn't atomic anyway, and we need to handle exceptions. Let's not do one more useless syscall which might be expensive on eel.
2. Check filename before reading it metadata (one more syscall)

GitOrigin-RevId: 0fac159784c2c1d80c3418eb0d9c60a501662b7d
2025-12-27 05:01:58 +00:00
Ilya.Kazakevichandintellij-monorepo-bot 4cc9b0a3d3 cleanup [python]: Extract ".venv" to the constant and add inspection
GitOrigin-RevId: 1073c5bc97403d883d76646b2826e50ac84f2f04
2025-12-27 03:33:43 +00:00
Ilya.Kazakevichandintellij-monorepo-bot fe66f186e7 cleanup [python]: Move test to VirtualEnvReaderTest to run it on Windows as well.
GitOrigin-RevId: 65e3aed0ba560e5c00d8fe3852c830d853f0b4f5
2025-12-27 02:37:18 +00:00
Ilya.Kazakevichandintellij-monorepo-bot a523b7d4d2 cleanup [python]: Make VirtualEnvReader support eel.
GitOrigin-RevId: 5855162b20bda624f764a0c75733a28b334c85ef
2025-12-26 19:40:48 +00:00
Andrii Zinchenkoandintellij-monorepo-bot 092344bb30 [eel] IJPL-217770: Decouple EelDescriptor and EelMachine through EelMachineProvider
GitOrigin-RevId: 407055c63d852a064a689679f49a0beb06b8d205
2025-11-28 20:54:11 +00:00
Ilya Kazakevichandintellij-monorepo-bot 7a580fd48b link/PY-85711/skip-non-python-modules-for-non-pycharm-ides
[python]: PY-85709: Support Python facet for non-PyCharm IDEs.

The following code doesn't work for anything but PyCharm.
```kotlin
ModuleRootManager.getInstance(module).sdk
```

We now call `com.jetbrains.python.module.PyModuleService.findPythonSdk` which supports both Python SDK and Facet.

[python]: PY-85711 : Do not touch non-python modules in `removeFakeModuleEntity` and do not set `inherited` for newly created modules.

1. We should never delete any module which isn't python.

2. No need to look for sdk in workspace as we already do that for all modules by reverting their SDK settings. Moreover, `InheritedSdkDependency` was wrong: it set project-level Java JDK as Python SDK

[python]: PY-85711 : Make `PyActiveSdkModuleConfigurable` filter non-python modules.

See `com.jetbrains.python.configuration.PyActiveSdkModuleConfigurable.isSuitableForModule` comment

[python]: PY-85711 : Move `isPythonModule` to `PyModuleService`.

We are going to reuse it all over the code

[python]: PY-85711 : Refactor `PyModuleService`.

Drop unneeded class


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

GitOrigin-RevId: 19f65ba65ea7ea8d8ff8698a64e6a3cbe6803cb0
2025-11-24 22:50:38 +00:00
Ilya Kazakevichandintellij-monorepo-bot 6d732f5624 link/fix-system-pythons
[python]: `PathShortenerTest`: do not throw an exception for relative paths.

`EelPath` is always absolute, so we used to throw an exception if relative path was provided.

It makes no sense to substitute anything in relative path, so we simply return it as is.

[python]: `SystemPythonService`: remove duplicates.


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

GitOrigin-RevId: c391a55fda0f372184279e444e9188f71bceba3e
2025-11-24 21:21:09 +00:00
Ilya Kazakevichandintellij-monorepo-bot 679db704aa [python]: PY-85585 : Do not display vens as system pythons in "Add new interpreter" window.
Instead of old `addManuallyAddedInterpreter` we now have two functions: one that requires system python and one that doesn't.

Both functions register system python if provided, but the latter one accepts any python (venv included).

Various "selectors" use these functions.

We also make sure no non-system python is set to `baseInterpreters`: base are always system!

As a bonus, we show "system" or "virtual env" title near interpreter.

It now checks that python is system (see `ensureSystemPython`).

Non-system pythons are never reported, and `registerSystemPython` also returns an error for non-system pythons

We need `execGetBoolFromStdout` for the further changes


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

GitOrigin-RevId: 2950f5f0cd2745c12987a92e40774d366568f312
2025-11-19 14:24:40 +00:00
Ilya.Kazakevichandintellij-monorepo-bot 3a3053b63b [python] cleanup: Introduce PathSortener.shorten and obey case sensitivity.
1. utility method added
2. paths checked with correct case sensitivity

GitOrigin-RevId: a2d0917df2a1e4f0a1d3d33fbb1f403d1342cf8c
2025-11-14 05:37:37 +00:00
Ilya.Kazakevichandintellij-monorepo-bot d5018a1583 [python]: PY-85585 : (WIP) Introduce method to map errors
Utility method to map `Result<S, E>`` into `Result<S, E2>`` is required for the next changes

GitOrigin-RevId: 811ddf171794ffdf20f77de6c735ac7ac19ce30a
2025-11-14 00:16:38 +00:00
Ilya.Kazakevichandintellij-monorepo-bot 32cab0f74c refactor [python]: Fix incorrect orLogException usage and add some comments.
See `orLogException` comment

GitOrigin-RevId: 5c66d03297372c9abb0014a6c57b6f5287f1dcaf
2025-11-13 15:01:51 +00:00
Ilya.Kazakevichandintellij-monorepo-bot a3f6519a94 refactor [python]: Drop getOrLogException: it was used only during transition from Kotlin Result.
No need to have 2 similar methods

GitOrigin-RevId: 233e00cd5c9fd94bde4279f63b798d54cd4de7c4
2025-11-13 03:21:47 +00:00
Ilya.Kazakevichandintellij-monorepo-bot 753526cd88 [python] PY-79486: (WIP): Rename wrongly named class
GitOrigin-RevId: 81472246ac871c80655290f687f560d48b12094d
2025-11-11 01:22:11 +00:00
Ilya.Kazakevichandintellij-monorepo-bot 6326cb84cc [python] PY-79486: (WIP): introduce PathShorter.
See class doc for info

GitOrigin-RevId: fad3b31b1b3a8338897953ca79c661c6e18d4b9d
2025-11-06 07:18:04 +00:00
Alexey Katsmanandintellij-monorepo-bot ea82fe5cc2 [python] PY-83881 Provide python info during environment detection
GitOrigin-RevId: 4e424c8fa9c08ce3cd497586f5f13e5a5816f52a
2025-10-31 17:55:16 +00:00
Alexey Katsmanandintellij-monorepo-bot efa8a7a246 [python] PY-84777 Use system pythons as a fallback for SDK configuration
There was a problem with detecting system-wide pythons, which relied on
binary not being a part of conda env or virtualenv. But it led to
unrelated Hatch and Poetry pythons automatically configured as
interpreters in new projects. Another problem is that free-threaded
python was chosen as default interpreter with highest priority because
of the newest version.

This change uses SystemPythonService to detect system pythons properly,
also free-threaded python used as a default interpreter only if it's the
only available option.


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

GitOrigin-RevId: f32238b063575a125642ee91984ed45ba47010ec
2025-10-21 12:52:02 +00:00
David Lysenkoandintellij-monorepo-bot f9835df460 PY-81494
[pycharm] PY-81494 Fix further flakiness

[pycharm] PY-81494 Address feedback

[pycharm] PY-81494 Fix flakiness

[pycharm] PY-81494 Separate modules

[pycharm] PY-81494 Fix tests

[pycharm] PY-81494 Change waitFor to awaitExit for coroutines

[pycharm] PY-81494 Configuration fixes

[pycharm] PY-81494 Add usage statistics

[pycharm] PY-81494 Address feedback

[pycharm] PY-81494 Add more limit tests

[pycharm] PY-81494 Post-rebase fixes

[pycharm] PY-81494 Implement logging tests

[pycharm] PY-81494 Final design adjustments

[pycharm] PY-81494 Refactor flows

[pycharm] PY-81494 Add more OutputSection tests

[pycharm] PY-81494 Add Toolbar tests

[pycharm] PY-81494 Add InterText tests

[pycharm] PY-81494 Add FilterActionGroup tests

[pycharm] PY-81494 Add EmptyContainerNotice tests

[pycharm] PY-81494 Add CollapsibleListSection tests

[pycharm] PY-81494 Add ActionIconButton tests

[pycharm] PY-81494 Address feedback

[pycharm] PY-81494 Address feedback

[pycharm] PY-81494 Post-rebase fixes

[pycharm] PY-81494 Address initial feedback

[pycharm] PY-81494 Fix existing tests & add new to tree

[pycharm] PY-81494 Implement copy to clipboard button

[pycharm] PY-81494 Amend design

[pycharm] PY-81494 Begin implementing output tests

[pycharm] PY-81494 Refactor file structure

[pycharm] PY-81494 Implement tests for process list

[pycharm] PY-81494 wip tests for process list

[pycharm] PY-81494 Finishing touches

[pycharm] PY-81494 Consolidate list logic in the model

[pycharm] PY-81494 Add logging limits

[pycharm] PY-81494 Implement open tool window on exec service error

[pycharm] PY-81494 Implement open command in terminal

[pycharm] PY-81494 Add expansion actions

[pycharm] PY-81494 Implement categorization by coroutine names

[pycharm] PY-81494 Memorize expansion states between tool window openings

[pycharm] PY-81494 Memorize scroll state between tool window openings

[pycharm] PY-81494 Introduce collapsible section for process info

[pycharm] PY-81494 Implement view setting filtering

[pycharm] PY-81494 Refactor process logging to use shared flows

[pycharm] PY-81494 Implement tests for ProcessList composable

[pycharm] PY-81494 Implement process toolwindow prototype


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

GitOrigin-RevId: 16ffe4980f92254afd269f5c65bb5cf4d5d78fc9
2025-10-21 07:58:13 +00:00
Vladimir Lagunovandintellij-monorepo-bot f2f2551120 Revert "Python Env Tests: support python.exe from Windows Apps in PYTHON_FOR_TESTS"
This reverts commit dc3c04ab43749a1c02285ccdc4deab01f49b13c1.

GitOrigin-RevId: 93aaf56d801631313443cf9f04b58f6da1cd964e
2025-10-16 19:49:54 +00:00
Ilya.Kazakevichandintellij-monorepo-bot 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
Vladimir Krivosheevandintellij-monorepo-bot 30413b84c9 IJPL-209476 IJ-MR-175479 extract jettison, jaxen, bouncy-castle
GitOrigin-RevId: d9f6e8e745fbfb69604eb02d0f95cad976d4d7f9
2025-10-09 21:36:26 +00:00
Vladimir Lagunovandintellij-monorepo-bot 956af7d0aa Python Env Tests: support python.exe from Windows Apps in PYTHON_FOR_TESTS
GitOrigin-RevId: dc3c04ab43749a1c02285ccdc4deab01f49b13c1
2025-10-09 14:41:12 +00:00
Nikolay Chashnikovandintellij-monorepo-bot 3a8344fcad [plugin model] use 'public' visibility for content modules which classes are used from external plugins (IJPL-207059)
153 modules which contain classes used from external plugins from the Marketplace are marked as public. This is needed to ensure that it'll be possible to use that API after converting code from these external plugins to content modules.

GitOrigin-RevId: dc48e8970041fddd3bf50d280711e95ce9e9ad9b
2025-10-08 18:39:06 +00:00
Ilya.Kazakevichandintellij-monorepo-bot 5a4843d743 PY-79486: Introduce sdkConfigurator module.
This module listens for topic that model was just rebuilt from `pyproject.toml` and does its best to configure SDK.

It will support UI to make this process configurable

GitOrigin-RevId: c752c94385814b5fc4413316c0d9d4cc2adb41e4
2025-10-02 06:59:28 +00:00
Ilya.Kazakevichandintellij-monorepo-bot 894f26c7e9 Python: Rename and move UIInfo to openapi to reuse it from other modules
GitOrigin-RevId: 2f46a6e934853d14600351112da292586938cd86
2025-10-01 23:01:06 +00:00
Ilia Kirianovskiiandintellij-monorepo-bot f43aa95086 [bazel] Update build files (IJI-3062)
GitOrigin-RevId: 98a67396a48bddc3d084cc93c50ae2f2017bfe8c
2025-09-29 00:11:15 +00:00
Ilia Kirianovskiiandintellij-monorepo-bot b09e3546ec [python] Add intellij.python.community._test module descriptor to run tests in dev-mode (IJPL-116621)
GitOrigin-RevId: 59dc5a2b0b52d0b3c10288a5394fd560c7aabc2a
2025-09-24 23:20:50 +00:00
Vitaly Legchilkinandintellij-monorepo-bot 0999615909 [python] add TraceContext as a trace tracker for coroutine inner calls
* will be used by the Process Tool Window to show the context of the executed command

Merge-request: IJ-MR-176530
Merged-by: Vitaly Legchilkin <Vitaly.Legchilkin@jetbrains.com>

GitOrigin-RevId: 70d41845943b5c19b0647ef4711b16f48c53b28c
2025-09-24 18:56:23 +00:00
Ilia Kirianovskiiandintellij-monorepo-bot 6f8920da99 [bazel] Update build files (IJI-3062)
GitOrigin-RevId: 2394c1289e33945f7640f249b17cbf34b31fd695
2025-09-23 09:25:59 +00:00
Ilya.Kazakevichandintellij-monorepo-bot 3fafaf4bf6 Python: close symbols and "tests" package to test to make sure no new symbol gets opened.
Bazel plugin isn't a problem as it is now controlled by JB

GitOrigin-RevId: c54256deac88c6c2f5a3a29c9efb7a0a80b5e106
2025-09-01 22:15:43 +00:00
Ilia Kirianovskiiandintellij-monorepo-bot e857678b3f [bazel] Update build files (IJI-2835)
GitOrigin-RevId: 4029606395c15069d4528b2558b29d78f6987bb3
2025-08-20 10:24:48 +00:00
Ilia Kirianovskiiandintellij-monorepo-bot dc268560b6 [bazel] Update build files (IJI-2835)
GitOrigin-RevId: 275260ab73f59d3c08f0b4cb9f4c89b74054094a
2025-08-20 08:49:22 +00:00
Vitaly Legchilkinandintellij-monorepo-bot eb336fedc2 [python] show execution command and outputs for conda runner in case of parsing failures (PY-76274)
+ ZeroCodeStdoutParserTransformer  
 + ZeroCodeJsonParserTransformer
 + add transformer showcase


Merge-request: IJ-MR-172758
Merged-by: Vitaly Legchilkin <Vitaly.Legchilkin@jetbrains.com>

GitOrigin-RevId: 1f293e8725a986eaed2a6050a3c6a240441f09fe
2025-08-19 08:09:48 +00:00
Ilya Kazakevichandintellij-monorepo-bot ec7562bf07 Python: Introduce API to get process from SDK via ExecService
Look `src/com/jetbrains/python/sdk/sdkExecApi.kt` for method that executes SDK and returns a process.

See `PySdkOnTargetTest` as a usage example.


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

GitOrigin-RevId: a7e9b6995eba7ae1fa71019b370acca2d98738d2
2025-08-08 19:08:05 +00:00