Commit Graph

67 Commits

Author SHA1 Message Date
Ilya.Kazakevich
3da2fb2642 PY-87021: (Part 1, TBC): Postpone project rebuild until project generation finished and transfer run config. settings
1. Project rebuild process disposes modules and kills `PyV3` project generation (i.e. Django). We now skip autoimport for newly generated projects, and PyV3 calls `startAutoImportIfNeeded` after project generation.

2. EP introduced to update run configurations when module gets renamed.

GitOrigin-RevId: 55183da9c1f9d1e96e837e970254443fbaec6b5e
2026-02-05 21:31:45 +00:00
Roman Shevchenko
e9e9b1620f AP-8446 [*]: dropping descriptions from the codebase
GitOrigin-RevId: 247054fd028e5213c06aedf635c75706268cf177
2026-02-05 11:51:17 +00:00
Leonid Shalupov
188b7ef96f IJI-3282 Optimize imports
GitOrigin-RevId: 3b5c00d8ff20b8d0bb6005bc450921085d2da9b2
2026-01-31 17:03:42 +00:00
Ilya.Kazakevich
d37f3aeefa PY-87266: uv: workspace roots are also workspace members.
Not only `members` table declared in the root, but also root itself is member, and can depend on its members.

GitOrigin-RevId: b1ff05222ae240fac20b5d8bc69f06ff89f51fad
2026-01-30 05:00:01 +00:00
Ilya Kazakevich
c4561ca262 PY-87222: Preserve SDKs while rebuilding a project model.
We drop old modules and create news ones on each `pyproject.toml` change.
We need to preserve SDK.

There were 2 bugs:
1. `relocateUserDefinedModuleSdk` was called **after** `removeFakeModuleAndConflictingEntities`, hence all modules were removed.
2. We didn't survice module renaming as we used module name as the only key. We now use path aswell.

Test included.


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

GitOrigin-RevId: 2a218ed14dcb2917834c6f554cdabfc975bb0cc5
2026-01-29 23:55:32 +00:00
Ilya.Kazakevich
e80fdcb1b8 PY-86744: Ignore cases when comparing project names and paths and add test.
When dropping existing modules using `removeFakeModuleAndConflictingEntities` we should ignore case.

GitOrigin-RevId: 2314f1916d1f2e43bce699703bdf8800c543f6b3
2026-01-29 05:20:13 +00:00
Vitaly Legchilkin
95a17ccde1 PY-86776 Proper venv folders resolving
+ don't create sdks if they exist already in the sdk table

GitOrigin-RevId: 1e6d6e6b3bb62598e3bc4500852f9c1195ad4a6f
2026-01-28 00:27:29 +00:00
Ilya Kazakevich
8dd8162baf PY-87171: Wrap findAmongRoots in readAction.
The following method throws exception if module id disposed:
`com.intellij.openapi.roots.ModuleRootManager.getInstance`

Even if we ask a caller to check it in advance, we still can't guarantee that nobody disposes this module in the middle of the operation.


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

GitOrigin-RevId: b48f6bafbd7a2c856ed753b7c32d2de0bfae8da9
2026-01-27 16:46:27 +00:00
Ilya Kazakevich
0a14bd8c9f PY-87168: Provide API to check if module is pyproject.toml based.
For every module we now have `Module.isPyProjectTomlBased`. It can be used to distinguish legacy modules from new ones, see the YT issue for the list of possible usages.


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

GitOrigin-RevId: 4f265bd66dc15609caae0624a61cd3a6ee41451c
2026-01-27 01:01:09 +00:00
Ilya.Kazakevich
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
Ilya.Kazakevich
8c0deced79 [python] PY-86999: Survive broken pyproject.toml.
`com.intellij.python.pyproject.PyProjectToml.Companion.parse` used to return Error in case of broken file so we simply ignored it. We now return `TomlTable` itself even in case of error.

So `com.intellij.python.pyproject.model.internal.pyProjectToml.TomFileToolsKt.readFile` is only null (which means module is skipped) if there is `IOException` reading `pyproject.toml` (either file doesn't exist or unreadable).

GitOrigin-RevId: 94fa7f46516450a9b0922679aa0d9d12571fae4f
2026-01-21 06:05:31 +00:00
Ilya.Kazakevich
bc925b842a [python] PY-82580: Enable intellij.python.pyproject.model by default.
It is now only `intellij.python.pyproject.model`, and it is enabled by default.

GitOrigin-RevId: 7e2b73e9b87cc50dab098d9b0cc21187795b6ad7
2026-01-20 02:11:15 +00:00
Ilya.Kazakevich
55e7ab0114 PY-85793: Enable project configuration by default
GitOrigin-RevId: a568b0b32b543cee7724d4ced4b9077e9300630d
2026-01-15 06:31:46 +00:00
Anton Efimchuk
4f5b07293f PY-86778 [python] Migrate Python test environments from local builds to prebuilt standalone distributions
Replace Gradle-based local Python compilation with prebuilt standalone distributions
downloaded from JetBrains cache redirector. Introduces provider-based architecture
for test environment management with improved JUnit4/JUnit5 integration.

Key changes:
- Remove setup-test-environment Gradle module and build infrastructure
- Introduce python-test-env modules (core, common, plain, conda, uv, junit4, junit5)
- Implement PyEnvironmentProvider/PyEnvironmentSpec abstractions
- Add JUnit5 annotations (@RequiresPoetry, @RequiresUv, @RunOnEnvironments)
- Implement caching system with PyEnvDownloadCache and variant-specific directories
- Predefined environments like: VANILLA_2_7, VANILLA_3_11, VANILLA_3_12, VANILLA_3_13

Benefits:
- Faster test environment provisioning (no compilation required)
- Consistent cross-platform behavior with identical Python builds
- Improved reliability by eliminating platform-specific build failures
- Better test framework integration with parameterized environment testing

GitOrigin-RevId: a44957c3014f9e1fc7dbec347a7e245675f999c1
2026-01-10 00:33:44 +00:00
Ilya.Kazakevich
7942f4337b PY-86744: Drop autogenerated and JPS projects that clash with pyproject.toml based modules.
See `removeFakeModuleAndConflictingEntities``

GitOrigin-RevId: fab3a02328e856bc4c8019afb5b83b60b892a9cc
2026-01-09 20:01:35 +00:00
Ilya.Kazakevich
ac3dd44c2c PY-82580: Add PEP621 deps for UV, add tests.
GitOrigin-RevId: 162d4d2e8876fd5d765bfddb2cb5ab5428fc24e4
2026-01-09 16:25:36 +00:00
Vitaly Legchilkin
92be2e1b81 PY-86614 using {enum#python_packages} for tool validation instead of own whitelist
GitOrigin-RevId: bf8093d620f815e0be75607a59aeba8a91b72445
2026-01-07 16:55:35 +00:00
Vitaly Legchilkin
f37cdcfc8d PY-86614 additional FUS logging for python tools
+ more tools added (including pixi)
+ scan for file markers (like pixi.toml, uv.lock, poetry.lock, etc)

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

GitOrigin-RevId: e9dfe9e4d1f5719c9ab387ec0159735e4d893eae
2026-01-05 21:03:13 +00:00
Ilya.Kazakevich
a2b0da8274 PY-82580: Exclude dirs with venvs.
No need to look for `pyproject.toml` in venv dirs. Moreover, they must be marked as "excluded".

GitOrigin-RevId: 60d0491e9372db9eaaf8e8958c2fd160b096cec6
2025-12-27 05:39:38 +00:00
Ilya.Kazakevich
11d0c31d71 [python] PY-79486: Exclude .venv only, do not visit dot dirs.
No need to exclude all dot dirs (`.venv` is enough) but no need to visit them either.

GitOrigin-RevId: db5405b659a1da9174f2bc5a01b0a808f4d59668
2025-12-26 00:13:51 +00:00
Ilya.Kazakevich
994ed3ec13 [python] PY-79486: Fix race in PyProjectAutoImportService, remove useless action PyProjectTomlSyncAction
`dispose` might be called before `projectId` set.

Project might be rebuilt using blue refresh icon in any toml file

GitOrigin-RevId: 7ed180ec071960ca6b24ef3b2791cad6b1c4d316
2025-12-25 22:20:01 +00:00
Ilya.Kazakevich
ec05d50276 [python] PY-79486: Survive inaccessible project dir.
Project dir is out of our control (as any IO) we must survive even when user deletes it in the middle of a process.

GitOrigin-RevId: 577fb26c1418f44fd09796d0c4d5082638433cbe
2025-12-25 21:35:39 +00:00
Ilya.Kazakevich
56189b1e58 [python] PY-79486, PY-86454: Configure SDK if venv already exists in inspection
GitOrigin-RevId: 5b1e4d049a7fa8b8e43b983dbbc3697105948820
2025-12-25 04:44:58 +00:00
Ilya.Kazakevich
8d86575f7c [python] PY-86335: Parse toml build section for tool id.
Look for toolId in build section to suggest this tool, but also use the same logic from inspection to configure the right tool automatically.

GitOrigin-RevId: faea6e6f7da89ba69e7c01dba7662d429596c46b
2025-12-25 00:14:15 +00:00
Ilya.Kazakevich
e922274b64 [python] PY-79486, PY-86454: WIP: Automatic SDK configuration, see ModuleConfigurationMode
Two modes are described in `ModuleConfigurationMode`

GitOrigin-RevId: bf6508571fd2f31ee87dd4b52c293155583c6eea
2025-12-24 21:33:56 +00:00
Kirill Bochkarev
469accf5ff IJPL-895 Workspace Model: Regenerate all IntelliJ Workspace Code and enable the test
Merge-request: IJ-MR-186465
Merged-by: Kirill Bochkarev <kirill.bochkarev@jetbrains.com>

GitOrigin-RevId: 7a89b88a238fae6fc962f36a9b98335abf156eeb
2025-12-19 15:27:07 +00:00
Ilya.Kazakevich
e26426a72f [python] PY-82580: (WIP): Add test for relocateUserDefinedModuleSdk.
This function transfers SDK from old module (deleted one) to a new one.

This commit adds a test.

GitOrigin-RevId: 77c4cbbb81a166744076db9d5f5a9f3224a70746
2025-12-17 22:00:04 +00:00
Ilya Kazakevich
93c46239a3 [python] PY-82580: (WIP): Clean-up workspace API usage.
Merge-request: IJ-MR-184543
Merged-by: Ilya Kazakevich <ilya.kazakevich@jetbrains.com>

GitOrigin-RevId: d3478cb8cd33313099fafa2ccd691a4dbdec6517
2025-12-17 13:53:49 +00:00
Ilya Kazakevich
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.Kazakevich
249c8ce892 [python] PY-79486: (WIP): Improve UI towards the new design:
1. Show module paths
2. Show icons
3. Make window 65% wide

GitOrigin-RevId: 31c1e0e8e7f25bb9d387d9fc6165f7170626d3f0
2025-11-06 07:18:04 +00:00
Tatiana Ber
6957755efb PY-85347 UI Texts: Fix typos and grammar mistakes (November)
GitOrigin-RevId: 20816980809477a2c7421a3a81ab65f18f35bded
2025-11-04 17:40:15 +00:00
Nikolay Chashnikov
9888c763e4 [plugin model] use internal visibility for content modules which are used from test plugins (IJPL-206556)
Currently, we don't have a special 'visible for testing' variant of the visibility modifier, so we need to mark such modules as internal to avoid errors after the visibility checks are enabled at runtime.

Reviewed in IJ-MR-180677.

GitOrigin-RevId: 1dcff728cc567e0c9c4055285b279402b7e5e030
2025-11-04 10:12:54 +00:00
Ilya.Kazakevich
7fab803a39 [python] cleanup PY-79486, PY-82580: 2 -> 3 dots fix.
GitOrigin-RevId: 67407c1629755db9c6effe4bee9aa72ecb0a3344
2025-10-28 21:24:31 +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
Kirill Bochkarev
450c612caa [workspace model] IJPL-847 Generated code changes
Merge-request: IJ-MR-179111
Merged-by: Kirill Bochkarev <kirill.bochkarev@jetbrains.com>

GitOrigin-RevId: 0e4c171b74be8bbac0c705a006b766212abe52a9
2025-10-22 19:31:32 +00:00
Ilya.Kazakevich
0471ccb0d8 [python] PY-79486, PY-84609, PY-84572: Fix pyproject.toml-based opener.
1. Obey registry key.
2. Use `readAction` to prevent race when file chaned from another thread.
3. Extract action title to the i18n

GitOrigin-RevId: eb9ca0841c13de06fb636d1e14f34d4a1b72b598
2025-10-16 22:02:05 +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
59a1fccc3f [python] PY-79486: (WIP) Refactor to extract boilerplate from tools.
No need to run the same project structure parsing logic again and again.

GitOrigin-RevId: d46c35d7327071038e4c9122ad3980e83f2faad4
2025-10-15 18:46:29 +00:00
Kirill Bochkarev
f577a4eb12 [workspace model] IJPL-847 move all code to generated sources
Merge-request: IJ-MR-166048
Merged-by: Kirill Bochkarev <kirill.bochkarev@jetbrains.com>

GitOrigin-RevId: 7085d49e0c9e01cda503b45d57575110f3956020
2025-10-15 15:52:36 +00:00
Kirill Bochkarev
eaa7c70266 [workspace model] IJPL-196541 Workspace generator fixes; Regenerate all IntelliJ workspace code
IJPL-895, IJPL-178663, IJPL-212395, IJPL-212407


Merge-request: IJ-MR-178140
Merged-by: Kirill Bochkarev <kirill.bochkarev@jetbrains.com>

GitOrigin-RevId: 097f61d76f785db240a94046461d445d5497f605
2025-10-11 09:47:21 +00:00
Ilya.Kazakevich
cc2a447cc5 PY-79486: Split sdk detector to backend-frontend
GitOrigin-RevId: c06ca10a1640e7dea536f1b94df82b7bcfadf14b
2025-10-03 06:26:19 +00:00
Ilya.Kazakevich
ea63edfa47 PY-79486: Call configuration in any case
GitOrigin-RevId: 508cecb8a4b53a9a0e09a63e5056fe4a32c5ba1a
2025-10-02 16:03:08 +00:00
Ilya.Kazakevich
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.Kazakevich
d03c264a1b PY-82580: Move action i18n to xml
GitOrigin-RevId: 280e878cd2335039fc2bac2e7cfa5c1ee91e7217
2025-10-01 21:27:53 +00:00
Ilya.Kazakevich
2888d207d9 PY-82580: pyproject.toml refactoring to combine all pyproject.toml EPs to single API
The main idea is to decouple tool implementation from low-level platform APIs: Open project processor, workspace model e.t.c.
Implementing `spi.Tool` should be enough to introduce new tool.

GitOrigin-RevId: 1177b57fc0eee1ca2c88cac5b20618a6170bf521
2025-10-01 02:21:16 +00:00
Vladimir.Koshelev
657e9ebee3 update bazel files
GitOrigin-RevId: f8ee7c74051e66b41bddbc976d457d25939bc008
2025-09-30 18:46:16 +00:00
Vladimir.Koshelev
497622b4c8 [python] PY-84498 fix CNEs, add tests, and fix the issue to make these tests runnable.
GitOrigin-RevId: a9d9d14750174c85a75049a2020b179977d6d4dc
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.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