Commit Graph

695 Commits

Author SHA1 Message Date
Alexey Katsman
27838bc2da 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: 18e9c4cc085c8d373c82ad2874033b53711f09c6
2025-11-03 16:25:22 +00:00
Egor Eliseev
0e99914369 [python] PY-83446 Function is executed on hover while debugging
Merge-request: IJ-MR-180916
Merged-by: Egor Eliseev <Egor.Eliseev@jetbrains.com>

(cherry picked from commit a57d32cd81bb3817639fe0d5190d6de8522a8b1f)

IJ-MR-180916

GitOrigin-RevId: 1ae4e5e801c91d3677d61f65485fe3cb08e1eec4
2025-11-01 08:16:41 +00:00
Morgan Bartholomew
9da0d7106e [python] PY-85014/PY-85037 PyLspToolConfigurable work
- fixed path mode not being able to find the executable at all
- switched mode to a segmented button
- don't show install button for path mode
- don't show install button when no interpreter specified
- use `PySdkListCellRenderer` for interpreter dropdown
- hard code spacing of label column
- auto detect tools in path mode
- path validation

(cherry picked from commit fe7d2b4701a5350896bb6ca173d133f8ffc54fb7)

GitOrigin-RevId: 465a939326e86f284eda8fb3faa90165800df468
2025-10-28 09:35:55 +00:00
Vitaly Legchilkin
0c27c361c8 [python] (PY-84251) UI/UX changes for uv and Hatch dialogs
* adjust validated path field logic: remove 2 sec timer, remove the action icon, make a warning, add browse action

+ detect existing environment for uv selection based on the module path (show all existing virtual environments in the module root)


(cherry picked from commit 0fb4cf1f77ebe799b4bc60f3a44974678e94bc5a)

IJ-MR-180201

GitOrigin-RevId: ab218030527774cb9ec1a1bfee37b220e6b82928
2025-10-27 21:38:43 +00:00
Nikita Pavlenko
bfd52b4a3f [PyCharm] Jupyter (fix): Proper way to set title and icon for DataView, Plots and HuggingFace toolwindows. #PY-82232 Ready For Merge
(cherry picked from commit 80216ce8fecea34ae208913be71fe34dbdfe2c96)

GitOrigin-RevId: c9cecbf9a50721a3d996c0f82cd7c20fd33bad33
2025-10-26 11:32:04 +00:00
Nikita.Ashihmin
23cfe9dea3 PY-84790 Jupyter: Fix review and small refactors
(cherry picked from commit 83d42335c6e6a0ee8014b5b0e4ac61f01538ab50)

GitOrigin-RevId: aca283d1a38dd54877a42e3bb7d948d4f26dde8d
2025-10-26 11:32:04 +00:00
Tatiana Ber
dd0c7203c7 [python] PY-79525 Is "Uv env use" required?
Update UI text for uv environment selector to improve clarity

(cherry picked from commit c286d4b692e5b28a35c93274e6f16570e79b567b)

GitOrigin-RevId: 4dcd8f49fa7383bf953a17d8dfbe0cc99d6c836e
2025-10-23 16:12:17 +00:00
Vitaly Legchilkin
dbe4ecc864 [python] (PY-84116) get base path for poetry from project if module is not defined
* make it similar to other tools
+ add trace context for remote sdks

(cherry picked from commit 04bc4bee6467cb708cb39875bf31448461e2bca3)

GitOrigin-RevId: 38bdf8c12a8af95ac3ceab29193b854b95eb40e4
2025-10-23 09:04:31 +00:00
Alexey Katsman
a03643bb9c [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: 73bc98aed2918c44832b57f22b86c9c7d17a4301
2025-10-22 13:10:20 +00:00
Alexey Katsman
9140cb4e7b [python] PY-84315: Use SDK configurators for inspection
There was a problem that we can detect uv environment as a virtualenv in
PyInterpreterInspection. The problem is that we don't use the knowledge
about the existing environment anyhow.

This change relies on SDK configurators to tell whether environment is
present or can be configured.

GitOrigin-RevId: 27f55c7d1b4712b0b8c3d39b1b8f7d8643680910
2025-10-22 13:10:20 +00:00
David Lysenko
fc7d863a50 IJ-MR-176106-to-253
[pycharm] PY-81494 Fix deadlocking code


Merge-request: IJ-MR-179432
Merged-by: David Lysenko <david.lysenko@jetbrains.com>
[pycharm] PY-81494 Config fixes

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>


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

GitOrigin-RevId: 44552a582dd628d206b207e02e6f24c7749b4d9f
2025-10-22 09:04:47 +00:00
Alexey Katsman
cc191a617f [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: dd0cf0c02b18e90022e9ec828b7f9ad2282cd5b3
2025-10-21 21:47:11 +00:00
Pavel Karateev
c371e4b876 [python] PY-84951 fix uv capitalization on the new project screen
(cherry picked from commit 0dce63c24272b3288addaebc79fb46d39499dbdb)

IJ-MR-179232

GitOrigin-RevId: 80666ba1e76bed30115300aa7242780601983eb7
2025-10-21 13:26:17 +00:00
Morgan Bartholomew
1514a1fc00 [python] python-lsp-core
(cherry picked from commit e07d457d959a1b589861180c1be06b995218aa2c)

GitOrigin-RevId: 032d78e90ff3263c494ceeafb2411aaceb29c643
2025-10-21 06:20:05 +00:00
Timur Malanin
266c5fa121 PY-84905 Introduce run.with.py.tool registry key to enable running with specific run tools.
(cherry picked from commit d62efa40233864a49bf0c4c79395b9a726b0eca9)

IJ-MR-178963

GitOrigin-RevId: 8d564387328ebf00dd6a6124c69d1fdacf492069
2025-10-20 21:08:19 +00:00
Timur Malanin
ea39ed6ad9 PY-84846 Log Python "Run with" tool usage.
(cherry picked from commit ee13b27a80b759d2c12169a30499ba8dd39a03ea)

IJ-MR-178767

GitOrigin-RevId: a1c87d6cb426ef195c4fbf1c60cf01a56547ffad
2025-10-20 20:19:30 +00:00
Vitaly Legchilkin
5bd261f8ea [python] (PY-84885) sdk v2 model refactoring
* move tool specific properties to tool sections

(cherry picked from commit 543c1f6ba44c564e31a956309bfaee44c6492b67)

GitOrigin-RevId: 84b1f2af49dffe7a5e1928b4362917c2a9194fb0
2025-10-20 19:01:51 +00:00
Vitaly Legchilkin
7e64eff197 [python] (PY-84885) (PY-84869) add sdk dialog / fix tool autodetection
(cherry picked from commit 7bfefab68b17b6abfe9a46718f4933b12b80ca56)

GitOrigin-RevId: 81dfe55e4a4f0de03116a1da9cd753c02a527d7f
2025-10-20 19:01:51 +00:00
Timur Malanin
0d76aa8817 PY-77929 Move uv project creation from custom section to top-level in new project panel
(cherry picked from commit 6bb6eda2b554de46fbdf4616eb6d9b17fd1949f9)

IJ-MR-178621

GitOrigin-RevId: 537158b52cf7e3f6cb49eb669fccafb229f65b56
2025-10-18 20:37:50 +00:00
Ilya.Kazakevich
011c111b86 [python] PY-84910 PY-79486: (WIP) Replace old SDK configuration process with new one if enabled.
When registry key is enabled, we replace all other SDK configurations (done by inspection and open processors) with a new one.

We also have an action to start this process

GitOrigin-RevId: 425ae78b769c5b5d40974cee9f19227410f63d45
2025-10-17 18:12:21 +00:00
Vitaly Legchilkin
5e2028d129 [python] (PY-78749) single dialog for all types of Python SDKs
+ old dialogs were removed

GitOrigin-RevId: 00ed85ba578c6419373d8605ed50954e7aa58f0a
2025-10-13 22:54:32 +00:00
Timur Malanin
defbf5a1d0 PY-80882 Introduce support for "Run with" tools in Python run configurations. Introduce PyRunToolProvider and UvRunToolProvider to enable uv run for UV SDKs and update Python run configuration logic accordingly
GitOrigin-RevId: 0323bba73b2f9d3530280c5d03e749c664adb425
2025-10-13 19:57:17 +00:00
Daniil Kalinin
97ce0f6cd7 PY-82344 Enable the new UI for Update Dialog for PyCharm
GitOrigin-RevId: 794ca7ea6ccba61e4a2ead522c672dcfcd592502
2025-10-13 15:11:48 +00:00
Vitaly Legchilkin
84934e9e9e [python] (IJPL-205889) (BAZEL-2462) don't call getOrCreateAdditionalData for non-python sdks
+ add requirePythonSdk() verification for the Sdk extension functions, these methods are not designed to be called for non-python sdks and now will throw IllegalArgumentException.

also corrects dependency tree:
+ move PythonSdkUtil to the python.sdk module, remove dependency on psi.impl
+ create PySkeletonUtil for skeleton utils and leave it in the psi.impl

[python] (IJPL-205889) (BAZEL-2462) don't call getOrCreateAdditionalData for non-python sdks

+ add requirePythonSdk() verification for the Sdk extension functions, these methods are not designed to be called for non-python sdks and now will throw IllegalArgumentException

also corrects dependency tree:
+ move PythonSdkUtil to the python.sdk module, remove dependency on psi.impl
+ create PySkeletonUtil for skeleton utils and leave it in the psi.impl

GitOrigin-RevId: 20d958c5e15cc4e05545b2e61b126b5e015696ed
2025-10-10 18:17:28 +00:00
Nikolay Chashnikov
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
Alexey Katsman
0c509dbb23 PY-82666 Fix undetached process cancellation when running packaging tool
Pip packaging tool used legacy process handler, which led to undetached
processes being spawned and even process leaks if they are really long
running. This led to flaky tests that were trying to delete temporary
directories after the test was finished, and at the same time process
was still running and creating __pycache__ directories there. That's
where a DirectoryNotEmptyException was thrown leading to a test failure.

The whole problem was fixed by using a new ExecService instead of a
legacy process handler. Also unused register keys `python.packaging.tool.use.project.location.as.working.dir` and `python.packaging.tool.upload.project` have been removed.


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

GitOrigin-RevId: 31c02fc8c25abd5941518958e7e2651f3771bad1
2025-10-05 17:18:24 +00:00
bogdan.kirilenko
0105c053bb [PyCharm] PY-78165 converted PyCellLineMarkerProvider to kotlin, hopefully fix for leaks in this class
GitOrigin-RevId: 95248547f076f299080215a56b6585c3a7b78899
2025-10-02 16:18:34 +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
Tatiana Ber
10e16c0236 PY-84168 UI Texts: Fix typos and grammar mistakes (September)
GitOrigin-RevId: d69dd2abed8cec96e25c3714f9fe0cfac6647d18
2025-09-30 15:46:24 +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
Vitaly Legchilkin
fe3004fa2b [python] i18n of constants
GitOrigin-RevId: e88347583e21a47802c8b7e5e866e24acfa3d936
2025-09-25 14:27:19 +00:00
Vitaly Legchilkin
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 Permiashkin
bea0075b8f [grazie] IJPL-200544 Migrate tests from spellchecker to grazie module
Merge-request: IJ-MR-175297
Merged-by: Ilia Permiashkin <ilia.permiashkin@jetbrains.com>

GitOrigin-RevId: f2d353c8b8516cf2a3b3fe0622147787c8a26066
2025-09-16 16:58:12 +00:00
Mikhail Golubev
7df5f2ad48 PY-36368 Move scipyNameMapping.tsv to the right resource root
GitOrigin-RevId: fb112a7dabecce82c87a3c9f239fccd4961b5b35
2025-09-16 16:33:56 +00:00
Ilya.Kazakevich
3d6abaf160 PY-79486: Cleanup (WIP)
We now have only one (`python.pyproject.model`) registry key enabled by default.

Number of boilerplate was a little bit decreased too.

GitOrigin-RevId: 0f7ecf324be038430230d9865688ce22ee922de6
2025-09-15 22:28:10 +00:00
Yuriy Artamonov
64512e8d6c [icons] IJPL-207480 Move generic purpose icons from PythonIcons to AllIcons
GitOrigin-RevId: 966f5d8f9fe1a42064c56ca50d936347ea067273
2025-09-14 19:47:10 +00:00
Alexey Katsman
69523b7c6a PY-82352 Fix reading of env files for old command line python runner
GitOrigin-RevId: 81df145e58cf0a509dd92ad1157916fc77978afb
2025-09-12 17:35:51 +00:00
Timur Malanin
c98d45b58b PY-84135 Revert "PY-81854 Introduce UvRunConfigurationProducer to support run via uv run for UV SDKs"
This reverts commit 1a456731fcea42ad2f374b3baa90a3bbf058ca1f.


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

GitOrigin-RevId: f023ddab144e0d88202f27ae23a031fa67f76715
2025-09-12 10:47:38 +00:00
Nikita.Ashihmin
b804677f62 PY-83138 requirements.txt: To update icon and wording for floating toolbar
GitOrigin-RevId: a4ee64089960c93a45c7f758ddb34fb2047205b1
2025-09-12 09:51:32 +00:00
Timur Malanin
ed13009694 PY-81854 Introduce UvRunConfigurationProducer to support run via uv run for UV SDKs
GitOrigin-RevId: 1a456731fcea42ad2f374b3baa90a3bbf058ca1f
2025-09-10 18:05:56 +00:00
Nikita Pavlenko
ce3e5aada4 [PyCharm] SingleDistributive (feat): Reworked Django and JS promo pages in NPW in PyCharm Community and Standard. #PY-78995 Ready For Merge
1. In Community on promo buttons and text titles now have "Pro" suffix
2. In Standard, when a user has no license, we started to show promo pages.
3. Promo pages in Standard are looking closer to sketches.

GitOrigin-RevId: f95c8ab0dd83c86b3068e29a29353b0b9f1b87d7
2025-09-10 11:40:56 +00:00
Natalia.Murycheva
feb51851df [PyCharm Tables] PY-78903 Added a registry key to save preferences between new and old tables #PY-78903 Ready for Merge
* Added the "python.data.view.allow.save.preferences.community.vs.powerful.data.view" registry key. If it's enabled, then we will remember a user's choice which data viewer they prefer.
* Will show the Slicing editor field in the new data view by default, as users cannot find this slicing field (the "input expression" field)

GitOrigin-RevId: 1c03357451d3dc8a228b06fd4c59210b313e8478
2025-09-10 10:48:31 +00:00
Egor Eliseev
c017cf9b49 PY-83446 Function is executed on hover while debugging
Merge-request: IJ-MR-175035
Merged-by: Egor Eliseev <Egor.Eliseev@jetbrains.com>

GitOrigin-RevId: 0917d6b69dc336fa64eec087b31cdbd762f62bbc
2025-09-09 17:17:13 +00:00
Vladimir.Koshelev
d1c9862263 [PY-83677] remove notification about enabling compatibility inspection
GitOrigin-RevId: 789b9b73bac6761cd3e267d3a186f336f1d1ff46
2025-08-26 16:21:36 +00:00
Vitaly Legchilkin
56fbdf6fee [python][poetry] don't create pyproject.toml if it already exists (PY-76274)
+ project.basePath -> module.basePath migrations

GitOrigin-RevId: 8461d6d273f7482aca180abe63d958e551c3c7dd
2025-08-19 15:49:34 +00:00
Timur Malanin
716ad92ab6 PY-82801 Introduce support for error display and quick fixes in Python Packaging Toolwindow
- Integrated error nodes into the Packaging Toolwindow UI and implemented rendering strategies.
- Introduced `SyncLockFileQuickFix` interface and UV-specific synchronization quick fix.

GitOrigin-RevId: e47ae06a5772a9fd2f3a176805483fe32f2110c1
2025-08-18 16:01:59 +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
Pavel Karateev
134585329c PY-83336 update PyCharm built-in spell check dict (August)
(cherry picked from commit fa50c92a7d05790dea0322b0af53113c5759c323)

IJ-MR-172304

GitOrigin-RevId: e541ec4a6297bfe7dab4ef0842be4344f10e8358
2025-08-13 18:43:34 +00:00
Mikhail Golubev
3e7b16f248 PY-24834 Implement the strict semantics of union types
Under the registry flag "python.typing.strict.unions", enabled by default.

"Strict" union is considered a subtype of another type only if *all* its
members are subtypes of this type. Similarly, accessing an attribute on
a union type considered safe only if *all* its members contain this attribute.
It holds even if one of the union members is Any, i.e. "str | Any" is still
incompatible with "int", and it's not safe to access a non-str attribute on
it.

This is how all other type checkers treat union types. Historically, we
use so called "weak unions", where the above rules were relaxed so that
it was enough to have at least one compatible member type. It was
necessary because back then there was no way to declare function overloads,
type narrowing was limited (no pattern matching, no TypeIs/TypeGuard),
so proper strict unions, as in the type theory, would cause too many false
positives.

Co-authored-by: Aleksandr.Govenko <aleksandr.govenko@jetbrains.com>

GitOrigin-RevId: 8a676d810548bf71ac0ff3497e59d8694e03e4db
2025-08-12 17:19:34 +00:00
Nikita.Ashihmin
248b69f8cc PY-78749 Packages: Remove not used PyPackageManagers
GitOrigin-RevId: 64afac916b5e99bdb6eecfbd0714dea88f5ad626
2025-08-10 12:31:15 +00:00