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
- 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
* 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
Update UI text for uv environment selector to improve clarity
(cherry picked from commit c286d4b692e5b28a35c93274e6f16570e79b567b)
GitOrigin-RevId: 4dcd8f49fa7383bf953a17d8dfbe0cc99d6c836e
* make it similar to other tools
+ add trace context for remote sdks
(cherry picked from commit 04bc4bee6467cb708cb39875bf31448461e2bca3)
GitOrigin-RevId: 38bdf8c12a8af95ac3ceab29193b854b95eb40e4
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
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
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
* move tool specific properties to tool sections
(cherry picked from commit 543c1f6ba44c564e31a956309bfaee44c6492b67)
GitOrigin-RevId: 84b1f2af49dffe7a5e1928b4362917c2a9194fb0
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
+ 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
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
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
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
* 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
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
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
* 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
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