159 Commits

Author SHA1 Message Date
Timur Malanin
c57369d4d2 PY-72070 Add a registry key for new logic
(cherry picked from commit e4ba7ef985a72006008ba4e377aa2e50385ea0bd)

GitOrigin-RevId: d399d09949844a989b130aba119af4ca5118e8b1
2025-01-20 23:33:35 +00:00
Aleksandr Sorotskii
42af44caf9 basic support for uv env & package manager; PY-75983
(cherry picked from commit 2597e4de17e167d8a0b0038190b5127a9dc4b155)

GitOrigin-RevId: 025955aea8f118a26e5ea24ca5b740fdd6c6bc7a
2025-01-19 21:30:04 +00:00
Aleksandr Sorotskii
f5e820f848 disable python debugger single port by default; PY-78168
(cherry picked from commit e73f477e2424c4c103bfaa676cdf94098170d4b5)

IJ-MR-151881

GitOrigin-RevId: 7a665d852d77554e00a51cce697940ebd5da538b
2024-12-20 14:42:55 +00:00
Egor Eliseev
f910392d5d PY-77160 Poetry/Pipenv modules refactoring
Split pipenv into separate files.
Rewrite functions/methods using coroutines.
Add `internal` or `@Internal`.

Merge-request: IJ-MR-148379
Merged-by: Egor Eliseev <Egor.Eliseev@jetbrains.com>

(cherry picked from commit b398d04bfa358ce97bf1d30d59b2113548e7983c)


Merge-request: IJ-MR-151355
Merged-by: Egor Eliseev <Egor.Eliseev@jetbrains.com>

GitOrigin-RevId: 2cd929fad7649fd6302100b8af5ff7969de8ec3e
2024-12-18 14:01:31 +00:00
Ilya.Kazakevich
5666495862 PY-77813: Report new project type broken in NPW.
FUS statistics consists of two parts:
1. Interpreter (i.e "venv" or "conda")
2. Project generator type ("Django" or "Flask")

`com.jetbrains.python.newProjectWizard.collector.PythonNewProjectWizardCollector.GENERATOR_FIELD` was a class without any limitation and `DirectoryProjectGenerator` instance was reported (i.e one for Django).

When migrated to NPW, we:
1. Dropped most old generator classes
2. Called this function providing `this::class` by accident, and it was `CoroutineScope`, so we finished with lots of `CoroutineScope` as generator type in FUS.

We must:
1. Provide old names for project types to preserve statistics.
2. Make it type-safe this time.

We also found that interpreter statistics is nullable for `PySdkCreator` which isn't true: SDK creation statistics is always not null.

So we:
* Introduce interface for project generators that reports "name for the statistics"
* Implement it both for DS and PyCharm by returning class name by default
* Overwrite it for several well-known generators to preserve statistics (use old named of now-deleted classes)
* Make interpreter statistics not null.


(cherry picked from commit bdfa73ba043d3584c6ba1871bca7a464a550bc21)

KT-CR-19191

GitOrigin-RevId: 53f874c18d67d33083cf8508a58be257b5e89ab7
2024-12-04 01:39:37 +00:00
Timur Malanin
329fa5cf88 PY-66252 Introduce a new registry key "disable.python.cache.update" to conditionally disable automatic updating of PyPI package cache and ranking on project startup.
Delete unnecessary checks of project-level python.

(cherry picked from commit 7b38138885ac7036895ff6c4dcb9f86358d1ecd5)

IJ-MR-148661

GitOrigin-RevId: 7bb045be17944f51224fd774b3db67f21a510a51
2024-11-25 21:59:15 +00:00
Aleksei Kniazev
00cf06cd4a [python] limit custom response to python job survey to 25 symbols (PY-74269)
(cherry picked from commit 020574e608d450ebb44fe89b8484e6ebab65e258)

IJ-CR-149662

GitOrigin-RevId: 1f83e0ee622609d07ed360a46b8b31e7f7c1ac54
2024-11-19 13:47:41 +00:00
Aleksei Kniazev
f0b1bdbb11 [python] added internal actions to test python surveys (PY-74269, PY-74269)
(cherry picked from commit a6c55625c47592e7c8b6572e887cc50410585451)

IJ-CR-149662

GitOrigin-RevId: 9ae176dc14cefeca56cfa1cb9ab107c3600100b6
2024-11-19 13:47:41 +00:00
Aleksandr Sorotskii
5f4980f553 bump reconnect params for debugger; PY-76400
(cherry picked from commit 9e4ea9e5832773fc78132d0ab40c9a9b879e84d0)

IJ-MR-149055

GitOrigin-RevId: 9ab5e2dc15c3168548a4fc1c8ac7a651668255c4
2024-11-11 19:15:06 +00:00
Egor Eliseev
dbee69ed0b PY-59838 Refactor Poetry package management
Associate poetry files ("poetry.lock", "pyproject.toml") with the Python Packages toolwindow.
Separate UI error handling from package management logic.
Add tests to check the installation and removal of packages using poetry and "pyproject.toml" modification.

Merge-request: IJ-MR-146002
Merged-by: Egor Eliseev <Egor.Eliseev@jetbrains.com>

(cherry picked from commit 2ab0816f10c970f738d6d931dc123481030cad38)


Merge-request: IJ-MR-148435
Merged-by: Egor Eliseev <Egor.Eliseev@jetbrains.com>

GitOrigin-RevId: be957c5343b73264c78134f156ad0e4034b912f9
2024-11-11 15:50:51 +00:00
Aleksei Kniazev
9c3fc02262 [python] registered custom validation rule in plugin.xml (PY-74269, PY-74269)
(cherry picked from commit c67055425d685fa45993be6bd33a5bebaa2e23cc)

IJ-MR-148062

GitOrigin-RevId: 6eac829771fc44e61ddac10c6006b48f87d4de25
2024-11-04 12:18:50 +00:00
Aleksei Kniazev
3d4d8fb8e1 [python] in-product survey about user's job for pycharm (PY-74269)
(cherry picked from commit 5ce25d3c418b54649e6a52a892bc84b837251e76)

IJ-MR-148062

GitOrigin-RevId: 878f980a2487aeb772e600721808261a688b18c4
2024-11-04 12:18:50 +00:00
Aleksandr Sorotskii
1087c97645 Make debugger connection params customizable via registry; PY-76400
Merge-request: IJ-MR-148080
Merged-by: Aleksandr Sorotskii <aleksandr.sorotskii@jetbrains.com>

(cherry picked from commit 1ce2a48aebf3336199b12a79879f61af9e2bac7e)

IJ-MR-148080

GitOrigin-RevId: b443e0289420e4f208bc6d80c2c8f2e82a515a60
2024-10-30 15:46:30 +00:00
Nikita.Lyubimov
8bab85c941 [RIDER] Convert InvertBooleanDelegate to LanguageExtension and make it visible only in supported languages (fix RIDER-117948)
(cherry picked from commit 3a255ec3c42321ec72f4431dea87ae42c1676146)

IJ-CR-145564

GitOrigin-RevId: 13bc1936ceacb3d82585a34c9b0553b13b368259
2024-09-26 15:59:17 +00:00
Andrey Lisin
4843e1d6e4 PY-73432 Introduce checkbox option for enabling debugger server mode
GitOrigin-RevId: 7a9bc66ab59b2a209c15d3313256f2ebf61e2193
2024-09-26 13:47:19 +00:00
Ilya.Kazakevich
3689a45984 Python NPW and Add SDK refactoring:
In SDK:
* `v1`: legacy API that should be dropped (but still used by Python Plugin and DS)
* `v2`: slightly better API used both for new project and interpreter settings. Supports DSL UI validation. Must be adopted by DS and Python Plugin somehow.

In NPW:
* `newProject`, `newProject/steps` (aka `v1`) deprecated, used only by DS and Python Plugin.
* `newProjectWizard` (aka PyV3): the right new API to use. Sooner or later will be adopted by DS and Python Plugin

GitOrigin-RevId: c3d49ce95079dc5ba589955381ddfe42326295fd
2024-09-23 21:14:22 +00:00
Ilya.Kazakevich
2eb4f94a5d Python: Remove unused symbols and WSL VFS listener (should be done at the platform level)
GitOrigin-RevId: 0859fb9636cb7ee1959153d0297500a7a755b095
2024-09-19 19:08:18 +00:00
Egor Eliseev
bffe31025a Poetry: Cleanup
Add general service for running coroutines in com.jetbrains.python.sdk.
Delete PoetryConfigLoader.kt and PoetryConfigService.kt.


Merge-request: IJ-MR-145094
Merged-by: Egor Eliseev <Egor.Eliseev@jetbrains.com>

GitOrigin-RevId: 474bbee10812bbe4ce5fd2db96602f12e9fa023b
2024-09-19 13:44:34 +00:00
Ilya.Kazakevich
218af635f1 Python: remove pre-targets API
Targets are enabled by default for more than a year

GitOrigin-RevId: ab0469410b4a699ce516c2054e38b63753c726fb
2024-09-12 21:24:42 +00:00
Ilya.Kazakevich
0f684b9c76 Python NPW: Remove a registry key for old NPW as we always use new now
GitOrigin-RevId: 3ea60922999fc330b9db0c5d18f9891b34246808
2024-09-12 07:24:18 +00:00
Egor Eliseev
a54292035d PY-65295 Poetry installation
Try to install Poetry and Pipenv if they are not found


Merge-request: IJ-MR-141839
Merged-by: Egor Eliseev <Egor.Eliseev@jetbrains.com>

GitOrigin-RevId: 535426090df23b358ba61a9e21c2f0954c201945
2024-09-10 10:40:05 +00:00
Daniil Kalinin
ccefd0e23f PY-71002 PEP-696: Suppress pep8 inspection for type parameters for
It cannot handle whitespaces around `=` in new-style type parameter declarations correctly

GitOrigin-RevId: c1d09acd54a329fbe4ff9d4ac8bd95a928440caf
2024-09-07 11:11:13 +00:00
Roman Shevchenko
a5666abead [project] pruning FileChooserDescriptor overrides (IJPL-150176 prerequisite)
`BrowseFolderRunnable` and `*WithBrowseButton` family: getting rid of separate "title" and "description" parameters in favor of the chooser descriptor object, to avoid cloning the latter down the road.

GitOrigin-RevId: 33ec5968a1db953c60848974135055c288accf85
2024-09-06 11:41:43 +00:00
Egor Eliseev
c23cd17165 PY-74168 Poetry: Check a python version from "pyproject.toml" and from Base interpreter
Implement version tracking for Python specified in pyproject.toml files.
Validate base interpreters using a Python version from pyproject.toml.


Merge-request: IJ-MR-142231
Merged-by: Egor Eliseev <Egor.Eliseev@jetbrains.com>

GitOrigin-RevId: ddd685240b6d58ef8d2e6c5668c89c96d8992d27
2024-09-05 13:15:45 +00:00
Nikita.Ashihmin
a968c7d095 PY-58972 Packages(fix): The attached project stays in the list on the "Python packages" tool window after its dettaching
GitOrigin-RevId: d7231e09a6d1a981536a68e8289a6b731549be92
2024-09-03 01:54:49 +00:00
Nikita.Ashihmin
fcfbe773b9 PY-49854 Packaging(fix): hide add package under gear
GitOrigin-RevId: 7e32a2db8dd987086b2bb2bce695271c94ca6f7a
2024-09-02 12:09:21 +00:00
Andrey Lisin
d1c7e0917a PY-73432 Minor: better name for registry key
GitOrigin-RevId: cec63f671f0635ba39d62126f21e023c0cf7fe73
2024-08-28 16:05:01 +00:00
Nikita.Ashihmin
1daa02b9f8 PY-74389 Packages(fix): FUS for "install all" quickfix action
GitOrigin-RevId: 9bbbb829833996c6d848a2b00136f177caa26771
2024-08-26 12:09:11 +00:00
Nikita.Ashihmin
e66c52bd22 PY-49929 Packages(fix): Allow selecting multiple packages simultaneously for a quick uninstall \ upgrade
GitOrigin-RevId: df8b02713955006061411b92cb89f40dc25046be
2024-08-24 18:21:16 +00:00
Nikita.Ashihmin
39ac2bc2ae PY-49271 Packages(feat): Provide an ability to pass arbitrary options to pip install
GitOrigin-RevId: 29a1f81fd5cb17923385b478c19864957c87cebf
2024-08-24 13:43:56 +00:00
Nikita.Ashihmin
b155ed154a PY-72994 Packages(refactor): Refactor left panel
GitOrigin-RevId: 31fc0199fcb928193ac19e3ff36e625fc5739b77
2024-08-24 13:43:56 +00:00
Nikita.Ashihmin
9fde169b6a PY-72994 Packages(refactor, feat): Update package actions
GitOrigin-RevId: 12d6e92f838717817b6b3a69ae7b844ba1724be3
2024-08-24 13:43:55 +00:00
Nikita.Ashihmin
134376878d PY-72994 Packages(refactor, feat): Rename Delete package andd Update package
GitOrigin-RevId: 56ddaade343cb5eeb3240fd1090f68b72e42ed86
2024-08-24 13:43:55 +00:00
Andrey Lisin
84a016fd62 PY-73432 Run Python debugger in server mode by default
GitOrigin-RevId: 3cdce22120868761d823402bd6bcf660224591b8
2024-08-23 12:18:41 +00:00
Vladimir Krivosheev
3b3ae1c0b5 IJPL-159596 disable sorting - we must produce distribution order entries in a stable manner without sorting
GitOrigin-RevId: 1bf3a1f18ba5b2d6d5bc4f9c44f8208f86c8baa2
2024-08-22 10:33:53 +00:00
Ilya.Kazakevich
42e49fcfc3 delete deprecated unused modules
GitOrigin-RevId: f656cf9b1e1aef85f9999cbf7fdaa8effda7652c
2024-08-20 21:19:35 +00:00
Gleb Marin
dc3c5730ea JBAI-5408 Release ML Imports Ranking in 2024.3
[ml tools] Fix build issue

[ml tools] Fix build issue

[ml tools] Fix build issue

[ml tools] Replace task object with service

[ml tools] Fix rebase issues

Add session duration metric

[ml imports ranking] Log fully only during EAP

[ml imports ranking] Set up FUS logs

[ml tools] Add dependency on ml api library


Merge-request: IJ-MR-142857
Merged-by: Gleb Marin <Gleb.Marin@jetbrains.com>

GitOrigin-RevId: 69be00b4b8f38ec71208c3b17cd6566a34508859
2024-08-20 06:16:36 +00:00
Ilya.Kazakevich
d74ffab3ba Python, DS: Use the new interpreter configuration UI to unify it between DS and PyCharm.
GitOrigin-RevId: 9faec46e4265e4a085c8f6acabee78551360c6a4
2024-08-14 17:47:00 +00:00
Mikhail Golubev
dc5c78e7f9 PY-73780 [fus] Collect Python version enabled for the compatibility inspection
GitOrigin-RevId: 8882995fa43bce79ec85fd3d8bbf4312b5d05076
2024-08-13 11:42:18 +00:00
Daniil Kalinin
abb3db3cbb PY-73906 Implement a new PyCharm Pro editor advertising notification using a plugin suggestion mechanism
GitOrigin-RevId: 1bbdad77006dfb4fe383ff21790f6aa55bdfb9bc
2024-08-08 09:20:09 +00:00
Nikita Katkov
aacd74b83b [json] IJPL-159354 Add explicit dependencies on JSON plugin in PyCharm Community
GitOrigin-RevId: 02afec0731cc1c71b812a44023b01d92bd091503
2024-08-06 21:52:25 +00:00
Yuriy Artamonov
40ee9543ab [icons] Eliminate CrossModuleIcons.json
All icons reside in the corresponding modules now

GitOrigin-RevId: c5fe0b11a37256d1cae4d2067f17c6802a7721b8
2024-08-03 10:12:40 +00:00
Andrey Lisin
664c8ef4e8 PY-73432 Introduce registry key to enable single port communication between PyCharm and debugger
GitOrigin-RevId: a3a5199b1f343d1c3423c433fa636a6d1a657b4f
2024-07-31 19:41:40 +00:00
Andrey Lisin
638dce38d7 PY-71930 Restore reStructuredText plugin
This commit partially reverts changes from 4da3e7da. While the consolidation of reStructuredText support into a single module is retained, it needs to be available as a plugin since some IDEs do not include it by default but can still benefit from its capabilities.


Merge-request: IJ-MR-139650
Merged-by: Andrey Lisin <andrey.lisin@jetbrains.com>

GitOrigin-RevId: bc5cde2970a0760e32ceaee61ceef8427e8f8fe5
2024-07-31 12:47:03 +00:00
Egor Eliseev
994775243f PY-71926 Refine test detection criteria
Add a new setting Python Integrated Tools: Detect tests in Jupyter Notebooks.
Exclude Jupyter Notebook files from the scope for test detection by default.
Add tests


Merge-request: IJ-MR-134248
Merged-by: Egor Eliseev <Egor.Eliseev@jetbrains.com>

GitOrigin-RevId: 0bee082bde4fa608cb1907b8fbd64b97bb9755a0
2024-07-26 17:24:30 +00:00
Vladimir Krivosheev
398ebce1d5 split content report
GitOrigin-RevId: ef449bdf4c5480a6ee3ce43b4af118c2c6e31219
2024-07-25 19:20:06 +00:00
Aleksei Kniazev
7e95d1c688 [python] initial step of python interpreter creation unification (PY-73396)
- refactored NPW to use target-specific model
- creating interpreter through widget reuses the same UI (can be turned off by python.unified.interpreter.configuration)
- interpreter discovery and virtualenv creation using Targets API
- no more PyDetectedSdk in dialog


(cherry picked from commit 581b2d40254d26f02eb3aa61bc2e842854b87a3e)

IJ-MR-140986

GitOrigin-RevId: be29188304882ef5f0fb88bb60c538714a2d8746
2024-07-25 18:01:45 +00:00
Yann Cébron
6e1285e760 plugin descriptors: remove obsolete suppression comments for 'PluginXmlValidity' inspection
GitOrigin-RevId: 25a17cf82be4c35d4e12472e392aea15b55ea105
2024-07-16 18:55:00 +00:00
Vladimir Koshelev
2ca8342b13 [python] restore pep8 information level after plugin split PY-73129
GitOrigin-RevId: 53fb0cf4c7efe139694d34f1707cdb8305881e03
2024-07-02 18:12:23 +00:00
Mikhail Golubev
52850e21d8 PY-62208 Include importable names in basic completion results
Previously, such names were visible only on so-called "extended" completion,
activated when the hotkey for the basic completion was hit twice. The main reason
was that collecting such variants from indexes was a slow process, and we
didn't want to harm the responsiveness of completion for basic names.
Now it becomes possible thanks to a number of performance optimizations:

* Instead of using three separate indexes for classes, functions and variables,
we use one -- PyExportedModuleAttributeIndex. By definition, it includes only top-level
"importable" names, so we additionally save time by not filtering out irrelevant
entries. Also, it doesn't contain private definitions starting with an underscore.
It might bother some users, but given that the previous completion was used
extremely rarely, and the new one is going to be visible everywhere, it seems
that pruning unlikely entries as much as possible is a fare tradeoff. In the future,
we might enable them back on the "extended" completion if there is a demand.
Also, this index binds its keys to the project (`traceKeyHashToVirtualFileMapping`),
further eliminating useless index lookups.

* Thanks to the recent fixes in the platform (IJPL-265), it's now possible to
simultaneously iterate over all keys in an index and request values for a given key
without deadlocks, which is much faster than eagerly fetching all keys first.

* While scanning through all matching entries from indexes, we terminate
the lookup if the number of items exceeds the size of the lookup list.
We can further reduce this number by adjusting the "ide.completion.variant.limit"
registry value.

* Calculating expensive "canonical" import paths (e.g. "pkg.private.Name" is importable as
"pkg.Name") is offloaded to a background thread thanks to the `withExpensiveRenderer` API.
We still calculate these paths synchronously, though, for names whose raw qualified names
contain components starting with an underscore to decide whether these private names are
publicly re-exported and, hence, should be displayed.

The rest of the work has been put into reducing the number of entries on the list, e.g.

* The prefix under caret is now matched from the beginning of a name, e.g. `Bar<caret>`
matches `BarBaz`, but not `FooBar`.
* We don't suggest imported names clashing with those already available in scope.
* Some kinds of definitions are not suggested in specific contexts, e.g.
functions and variables are not suggested inside patterns and type hints.
* Nothing is suggested at the top-level of a class body, where dangling
reference expressions or calls are not normally expected.

Additionally, we don't suggest names from .pyi stubs at the moment, because
it pollutes the suggestion list with entries coming from the stubs for
third-party packages in Typeshed. We should probably enable them back once
we are able to properly disable Typeshed entries for not installed packages.

Some legacy forms of completion are left in the extended mode. In particular,
qualified names of classes are offered inside string literals only in this mode.
Also, module and package names are suggested only in the extended mode, because
top-level packages and modules are already suggested for the basic completion
by PyModuleNameCompletionContributor.

A few tests in PyClassNameCompletionTest were updated or removed entirely because
* we no longer suggest private names
* we no longer suggest names from private modules not re-exported in a public module
* we no longer suggest names clashing with those already available in scope
* prefix matching policy was changed to start at the beginning of an identifier

The whole feature can be disabled with the option "Suggest importable classes,
functions and variables in basic completion" in settings.

GitOrigin-RevId: 0787d42ce337b73b01a60f0bb7aa434fee43e659
2024-07-02 14:08:48 +00:00