Commit Graph

122 Commits

Author SHA1 Message Date
Nikolay Chashnikov
4158e45854 [plugin model] use 'public' visibility for content modules which have plugin aliases (IJPL-207059)
Such modules can be referenced not by a 'dependencies.module' tag, but via a 'depends' or 'dependencies.plugin' tag with the plugin alias, so they should be public. 'jetbrains' namespace is used for them.

GitOrigin-RevId: f3d0601685fe1d312a2508be08e97f8d985e7133
2025-09-30 16:18:22 +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
Ilia Zakoulov
20e64ad596 PY-82074: Introduce PyCharm non-modal welcome screen
GitOrigin-RevId: ce867e42111789fda03bae15665a6860a140e9b1
2025-09-15 16:35:39 +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
Ilya.Kazakevich
a0231c334a PY-77226: Introduce InterpreterService.
This service is aimed to substitute various SDK-management tools in PyCharm.

Begin with `InterpreterService()` function.

GitOrigin-RevId: 368d56c4a78812fe81de941e5e5ce61a56d385e6
2025-06-26 23:26:54 +00:00
Egor Eliseev
21ae30258c [python] Remove unuseful ktor dependencies in intellij.python.community.impl module
Merge-request: IJ-MR-166082
Merged-by: Egor Eliseev <Egor.Eliseev@jetbrains.com>

GitOrigin-RevId: 447218b7df368ac1c8da7ca3b2d096ccceb93f69
2025-06-19 14:30:30 +00:00
Ilya.Kazakevich
2e14347844 Python: extract python-specific extensions from exec service to simplify API and make it extendable for intepreters.
Use `ExecService` `api.kt` to exec any binary and extensions from `execService.python/api.kt` for python-specific things (i.e helpers)

GitOrigin-RevId: bb217798a9d1ee886c4b12220ec1f66a5ef08336
2025-06-07 22:05:56 +00:00
Ilya.Kazakevich
80f248d842 Python: Move helpers locator out of PSI module
GitOrigin-RevId: 55fb4b41c56fdd41b6d9523cd7a148c002ffb8be
2025-06-07 21:59:42 +00:00
Yuriy Artamonov
0967818c60 [python] IJPL-155949 Allow update for PyCharm bundled plugins
GitOrigin-RevId: 391fa1b9fea42adfe63380af2a148a8c3b08cd66
2025-05-26 19:39:03 +00:00
Vitaly Legchilkin
a697724acc [python] merge with latest changes (PY-79451)
GitOrigin-RevId: a50334e1c235d37ed64a61ae298dc25949014c89
2025-05-08 01:15:49 +00:00
Vitaly Legchilkin
91a13e2436 [python] implement python package manager actions (PY-79451)
* PythonPackageManagerJobService.kt added to manage tool jobs
* Base PythonPackageManagerAction.kt was added to cover all python package manager actions
* Implementations for Poetry / Hatch / uv
* Poetry pyproject.toml watcher was removed (replaced with poetry actions)

GitOrigin-RevId: 0bbc5a7802826674140ca1c80be27b6cd7d0f59e
2025-05-08 01:15:49 +00:00
Vladimir.Koshelev
67594cdaad [pycharm] finish community migration to v2
# Conflicts:
#	community/python/pluginCore/resources/META-INF/plugin.xml

GitOrigin-RevId: e4d6969fd15a3fddc4d6a03491fb9f9634285edf
2025-04-30 10:08:56 +00:00
Mikhail Golubev
a3d51f7191 PY-79488 Prototype UV project model support
GitOrigin-RevId: 9ef8405f2e617541771275f5dd79106a0063380c
2025-04-29 15:29:41 +00:00
Ilya.Kazakevich
74b4990d4f PY-80062: ignore Django facet (WIP)
GitOrigin-RevId: f0c4835dcf99f7c1f5a1ecec0402160020371c59
2025-04-08 22:10:13 +00:00
Aleksandr Sorotskii
53bc8ed84f fix displaying unavailable python run configurations from pro tier; start with django; PY-80062
Merge-request: IJ-MR-159510
Merged-by: Ilya Kazakevich <ilya.kazakevich@jetbrains.com>

GitOrigin-RevId: d9dfe8bdcb27a57c935bca570e96902687f58ba8
2025-04-07 22:13:54 +00:00
David Lysenko
a1b07bb061 [pycharm] PY-79448 Add a feature flag to prevent poetry lock from being run
GitOrigin-RevId: 94977a3fb4390c683211fe253885bb2cc8c1eb35
2025-04-07 14:57:15 +00:00
Yuriy Artamonov
1c524da10b [project] Mute more spelling problems for Java and Python plugins
GitOrigin-RevId: c75d3634ebb3d649fea82e78fddc9d3c186d7493
2025-04-06 17:55:11 +00:00
Nikita Katkov
1393d86af9 [json + remdev] IJPL-176240 Update all runtime plugin dependencies: now most of the plugins depend on the json.backend module as they expect corresponding functionality and API to be available (primarilly Json Schema-related features)
GitOrigin-RevId: 141b7732330eefa01fdada3413e434fe7d2d512b
2025-04-03 13:08:20 +00:00
Mikhail Golubev
9131e29041 PY-79488 Prototype multimodule Poetry project support
Whenever a pyproject.toml file is found in a new IJ project root
(without .idea) we register the corresponding root as managed by Poetry
in `.idea/poetry.xml` (so called "linking") and then read all
pyproject.toml in the project tree setting up the corresponding IJ
modules and dependencies between them (so called "syncing").
The changes are persisted in the workspace model cache, there are
no additional config files, besides `.idea/poetry.xml`.

If a new pyproject.xml module is added to the root of an existing
project, we ask user whether its project model should be applied.

When a pyproject.toml is then changed in the editor or externally,
we either automatically apply the changes (reloading) or ask
a user about it, depending on the settings in
"Settings | Build, Execution, Deployment | Build Tools".

If automatic linking and syncing doesn't work for some reason
(e.g. there is no top-level pyproject.toml as in grazie-ml),
there are manual actions "Link All Poetry Projects" and
"Sync All Poetry Projects".

GitOrigin-RevId: 77a480cdf56d45f22c943acbad3a7c20d5eb56a5
2025-03-28 14:50:08 +00:00
Ilya Kazakevich
92e25c9022 Python: Cache system pythons to speed up a function result.
1. Preload pythons from a project start activity
2. Cache them for some time (see `cache` variable)
3. Provide API to refresh


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

GitOrigin-RevId: 8b58ad3f35f144364d4103578d20a3cfc9b637f2
2025-03-27 14:31:48 +00:00
Vitaly Legchilkin
61ec26ac28 [python][hatch] create module structure only for pure python projects (PY-79939)
+ add work directory and hatch env name to hatch sdk data
+ support hatch run on cli level

GitOrigin-RevId: 4782bc52fcd23775b51903ae05f2575f574401cc
2025-03-25 19:45:38 +00:00
Aleksandr.Govenko
ab13d9dfd2 PY-45729 Intention to convert between single-line comma-separated things and multi-line representation
Merge-request: IJ-MR-155221
Merged-by: Aleksandr Govenko <aleksandr.govenko@jetbrains.com>

GitOrigin-RevId: 1da524fe3f995e28bf23843f02761065ae45f965
2025-03-25 13:43:44 +00:00
Vitaly Legchilkin
133bb61a1d [python] dependencies highlight and completion in pyproject.toml fix (PY-72985)
* use module sdk instead of project sdk in dependency completion
* remove dependency on the "requirements.txt" in the UnsatisfiedRequirementInspection (might be also pyproject.toml)
* move poetry-related things to own package

GitOrigin-RevId: 878ad4c419ed8025aa27bca2357ec7bed2e26f3c
2025-03-18 21:50:59 +00:00
Aleksandr Sorotskii
5cd9d71bee support for uv configuration in idea sdk management
GitOrigin-RevId: 17207321c24bf3746742648efac8163b39aa88ef
2025-03-13 11:41:43 +00:00
Vitaly Legchilkin
498de69f2a [python] Support Hatch SDK (PY-60410)
* add new / select existing for local sdks
* create a new project with hatch sdk
* open hatch-managed project

GitOrigin-RevId: 86e970a39bc44cec34be7c82717806fc4d0009c4
2025-03-12 20:49:14 +00:00
Natalia.Murycheva
e759b8e4d8 [PyCharm] PY-77597 Re-order the "New File or Directory" options #PY-77597 Fixed
* Move Python-specific file types up in the "NewGroup" actions group
* Rename several actions so that their naming is aligned with the corresponding actions' names in IntelliJ platform

GitOrigin-RevId: af828c30daa801c0ca52c1271be45279946e34f0
2025-03-04 17:00:31 +00:00
Vladimir.Koshelev
268bc9307f [python] move PyProjectScopeBuilder to pycharm community customization
GitOrigin-RevId: fb38f3038a19bd66302920ce435d03da891a5fb5
2025-02-17 16:28:02 +00:00
Aleksandr Sorotskii
42b6334183 pycharm uv support survey; #PY-78501 Fixed
GitOrigin-RevId: 314259d784d9cbf471a661ee51aa337d312fd613
2025-02-06 13:40:10 +00:00
Mikhail Golubev
fc8b4ca91a PY-54269 Set up cross-module dependencies using the existing "transferred roots" mechanism
Namely, whenever there is a `sys.path` entry or a user-added path pointing
to the root of another project module, instead of configuring a source root
for it, we now set up the corresponding module dependency and save it
as a "transferred root" in additional data alongside extra directories
configured as source roots.

This POC solution has a number of limitations:
- A module dependency is set up only if the corresponding module
has already been added to the project. Modules are added using
"Attach to project" as before.
- Since detecting modules is happening on the interpreter introspection
phase, if project A depends on project B, once the module B is actually
configured as an IJ module, one needs to restart SDK update for project
A's SDK to detect the dependency.
- Detecting module dependencies this way requires having a configured
project interpreter for each dependent module, which might not be
practical for large projects, such as grazie-ml.
- It doesn't play well with manual editing of module dependencies in
settings.

Overall, this workaround works well with an existing multi-module project,
where a new subproject with its own SDK and module dependencies needs to
be added as an IJ module. But ideally we need to rely on the actual
project configuration files, not on runtime values of `sys.path`, and
make the workflow of configuring all project modules at once simpler.

A registry key "python.detect.cross.module.dependencies", disabled by default,
activates the feature.

As part of the feature, I also disabled configuring source roots for
`sys.path` entries not belonging to the current module. It leads
to a confusing situation where multiple modules have a content root
(with a single source root) pointing to the same directory in another
module. In a multi-module setting, it can happen if several modules
depend on some subproject that has not yet been configured as an IJ
module.

GitOrigin-RevId: 47e832edeeea21f5206c981bd604a6012100e9da
2025-02-04 22:07:19 +00:00
Ilya.Kazakevich
6b6658fbc9 Python: make system python service available from community.
We make it a part of PythonCore module to use it from community

GitOrigin-RevId: ea6b00b6ac1a24478f9ff74cb34beffab0942089
2025-02-03 22:07:16 +00:00
Aleksandr Sorotskii
e0e9e611a6 support for listing uv provided pythons PY-77537
GitOrigin-RevId: 7003a66ba729d7565c1cf876198d85d45d025659
2025-02-03 17:10:53 +00:00
Ilya.Kazakevich
dafe83d2c7 Python: temporary hack: Move SPP to community to break cyclic dependency.
Will move it back soon.

GitOrigin-RevId: b2f032dbc9926b2e23c0438d2ce522985c7a6ad4
2025-01-30 17:45:52 +00:00
Aleksandr Sorotskii
e9f5ddd211 cleanup python package manager internal interface. squash redundant test python package manager implementations.
GitOrigin-RevId: e1f80d690a5c67868312e626e79d7fbd73e06808
2025-01-29 19:52:47 +00:00
Ilya.Kazakevich
1b8625925c Python: remove package attr from PythonCore and move its modules into right packages.
PythonCore consists of several v1 modules (they aren't v2 modules in its content, but bare v1 modules to be packed directly in it).

They used to have `com.jetbrains` package to match plugin's package.

I now removed plugin package and moved modules to the appropriate packages.

https://jetbrains.slack.com/archives/CMDBCUBGE/p1738073999835749?thread_ts=1738008244.276339&cid=CMDBCUBGE

GitOrigin-RevId: 5702998a23598d4aa363064025afad8951faf7f7
2025-01-29 02:56:22 +00:00
Timur Malanin
64a3b60587 PY-72070 Refactor and Simplify PyPackageRequirementsInspection Implementation. Refactored PyPackageRequirementsInspection and inner classes to Kotlin, leveraging PythonPackageManager for better abstraction and efficiency.
Introduced PackageManagerServiceInterface to standardize package management across services, replacing direct use of PyPackagingToolWindowService with PackageManagerHolder.

GitOrigin-RevId: ff93b45ed0603d4f26d9c698542653d4aa38842e
2025-01-22 00:47:37 +00:00
Yuriy Artamonov
ccd9905d21 [registry] IJPL-175398 Move python.* keys to Python plugin
GitOrigin-RevId: 11e0be8d1897ecf34dad0dac9245a8c0b7987bbf
2025-01-19 18:52:06 +00:00
Ilya.Kazakevich
882c455d4d Python: Introduce "Python Services."
See `README.txt`.
The "Python Services" is a new API for PyCharm execution subsystem.

The idea is to build the following mental model:
1. If you need an API -- there should be a service.
2. Each service has a showcase in "tests" root so you can see how it works in real life.
3. Code against interfaces.
4. Only link against those modules/services you really need.
5. No UI, no leaky abstractions in services.

This change introduces two services:
1. `SystemPythonService` to work with CPythons installed on OS.

GitOrigin-RevId: b07df246d1510a02c060fa7a929cf134879c7677
2025-01-11 16:43:37 +00:00
Gleb Marin
d80ad96aee [ml imports ranking] Update ML API version & add an actual ML model
Fix build issues

Fix build issues

Remove redundant extension point

Fix build issues

Fix rebase issues

import rank

# Conflicts:
#	.idea/libraries/jetbrains_ml_models_python_imports_ranking_model.xml
#	.idea/libraries/jetbrains_mlapi_ml_feature_api.xml
#	build/expected/ultimate-content-platform.yaml
#	community/.idea/libraries/jetbrains_mlapi_ml_building_blocks.xml
#	community/.idea/libraries/jetbrains_mlapi_ml_feature_api.xml
#	community/platform/ml-api/intellij.platform.ml.iml
#	community/platform/ml-impl/intellij.platform.ml.impl.iml
#	community/platform/ml-impl/src/com/intellij/platform/ml/impl/logs/fus/IntelliJFusEventRegister.kt
#	community/platform/ml-impl/src/com/intellij/platform/ml/impl/logs/fus/eventFields.kt
#	community/platform/ml-impl/src/com/intellij/platform/ml/impl/tools/logs/IntelliJFusEventRegister.kt
#	community/platform/ml-impl/src/com/intellij/platform/ml/impl/tools/logs/eventFields.kt
#	community/platform/ml-tools/src/com/intellij/platform/ml/tools/logs/fus/IntelliJFusEventRegister.kt
#	community/platform/ml-tools/src/com/intellij/platform/ml/tools/logs/fus/eventFields.kt
#	community/platform/platform-impl/codeinsight-inline/src/com/intellij/codeInsight/inline/completion/ml/TypingSpeedFeatureProvider.kt
#	community/python/intellij.python.ml.features/src/com/intellij/python/ml/features/imports/README.md
#	community/python/intellij.python.ml.features/src/com/intellij/python/ml/features/imports/mlModel.kt
#	community/python/pluginCore/plugin-content.yaml
#	community/python/src/com/jetbrains/python/codeInsight/imports/mlapi/mlAnalysis.kt
#	community/python/src/com/jetbrains/python/codeInsight/imports/mlapi/mlImplementation.kt
#	community/python/src/com/jetbrains/python/codeInsight/imports/mlapi/mlLogs.kt
#	community/python/src/com/jetbrains/python/codeInsight/imports/mlapi/mlTask.kt

Fix some tests

Refactor RelevanceEvaluationFeatures.kt to fix null handling

Improved the handling of `null` cases for `MODULE_SOURCE_TYPE` in `RelevanceEvaluationFeatures.kt`. This ensures more robust feature addition by checking conditions and setting the value accordingly when it's `null`. Minor formatting adjustments were also made.

Update ML model version in project configuration

Changed the Maven artifact ID from "lilac-coua" to "daffy-pony" for the python imports ranking ML model.

Fix some tests

Fix some tests

Fix some tests

Fix some tests

Fix some tests

Update Maven dependencies for JetBrains ML libraries

Update ML model version & fix missing read action

Update ML API version & update Imports Ranking implementation

Update mlapi version


Co-authored-by: Andrey Vokin <andrey.vokin@jetbrains.com>
Co-authored-by: Nikita Ermolenko <ermolenko.dev@gmail.com>

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

GitOrigin-RevId: 7aa520df915bb8a62263524868a17a984b619728
2025-01-08 12:52:17 +00:00
Aleksandr Sorotskii
a068324fbd disable python debugger single port by default; PY-78168
GitOrigin-RevId: e73f477e2424c4c103bfaa676cdf94098170d4b5
2024-12-20 12:39:22 +00:00
Andrey Vokin
44b9d24ae8 Revert "MLP-33 IJ Imports Ranking"
This reverts commit 47140fd0301283a10966e14c65df9a08d128ec39.

GitOrigin-RevId: 81fa4946bd76885bcc599dfae9bfb9feaa11fbb3
2024-12-09 21:19:47 +00:00
Andrey Vokin
d2b7ce6435 MLP-33 IJ Imports Ranking
Fix smoke tests

Update ML libraries

Remove kotlin std from classes of a library

Remove redundant extension point

import rank

PY-40997 Typing/Reformatting/Autocomplete lags when stubs for boto3 are installed

set test iteration count to 12


Co-authored-by: Gleb Marin <Gleb.Marin@jetbrains.com>

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

GitOrigin-RevId: 47140fd0301283a10966e14c65df9a08d128ec39
2024-12-07 16:07:16 +00:00
Ilya.Kazakevich
42cc1cf8af 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.

GitOrigin-RevId: 37eefb73361ff96dea88e4e2b4c6b291a91e13f0
2024-12-03 02:27:12 +00:00
Timur Malanin
221ea6284a PY-72070 Add a registry key for new logic
GitOrigin-RevId: e4ba7ef985a72006008ba4e377aa2e50385ea0bd
2024-11-29 15:41:13 +00:00
Ilya.Kazakevich
3a8eea0329 [Python]: Drop Jython
GitOrigin-RevId: d21b1c99e58aab59cdb474f893440e3fe61dc6df
2024-11-27 16:10:15 +00:00
Ilya.Kazakevich
1ef66e99af [Python]: Drop PyPy
GitOrigin-RevId: 41608a5a23f6aa5503fdeb8b37b637c7cb96896c
2024-11-27 16:10:15 +00:00
Aleksei Kniazev
521953a441 [python] limit custom response to python job survey to 25 symbols (PY-74269)
GitOrigin-RevId: 020574e608d450ebb44fe89b8484e6ebab65e258
2024-11-19 11:56:29 +00:00
Aleksei Kniazev
a0018de22f [python] added internal actions to test python surveys (PY-74269, PY-74269)
GitOrigin-RevId: a6c55625c47592e7c8b6572e887cc50410585451
2024-11-19 11:56:29 +00:00
Aleksandr Sorotskii
9b76b13e69 basic support for uv env & package manager; PY-75983
GitOrigin-RevId: 2597e4de17e167d8a0b0038190b5127a9dc4b155
2024-11-15 17:27:12 +00:00
Aleksandr Sorotskii
03c4f60e7a bump reconnect params for debugger; PY-76400
GitOrigin-RevId: 9e4ea9e5832773fc78132d0ab40c9a9b879e84d0
2024-11-11 14:52:09 +00:00
Timur Malanin
4c41d0ed3b 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.

GitOrigin-RevId: 7b38138885ac7036895ff6c4dcb9f86358d1ecd5
2024-11-07 23:40:34 +00:00