Commit Graph

91 Commits

Author SHA1 Message Date
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
Egor Eliseev
f79c7ad550 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>

GitOrigin-RevId: b398d04bfa358ce97bf1d30d59b2113548e7983c
2024-11-07 16:15:06 +00:00
Aleksei Kniazev
4b69a481f9 [python] registered custom validation rule in plugin.xml (PY-74269, PY-74269)
(cherry picked from commit c67055425d685fa45993be6bd33a5bebaa2e23cc)

IJ-MR-148062

GitOrigin-RevId: 1dcc89d0ed4c8032a9d6e13de765966d91d138d3
2024-10-31 17:23:14 +00:00
Aleksei Kniazev
88df1335c4 [python] in-product survey about user's job for pycharm (PY-74269)
(cherry picked from commit 5ce25d3c418b54649e6a52a892bc84b837251e76)

IJ-MR-148062

GitOrigin-RevId: 0f3602d64459a2632bff07243e7e166ec59e9665
2024-10-31 17:23:14 +00:00
Pavel Karateev
6a267e7939 PCQA-153 Update Python plugin URL
GitOrigin-RevId: e04c607a392f5a58ab231d87de8a85bd6a5f49df
2024-10-30 16:34:15 +00:00
Aleksandr Sorotskii
060221361f Make debugger connection params customizable via registry; PY-76400
Merge-request: IJ-MR-148080
Merged-by: Aleksandr Sorotskii <aleksandr.sorotskii@jetbrains.com>

GitOrigin-RevId: 1ce2a48aebf3336199b12a79879f61af9e2bac7e
2024-10-30 13:16:12 +00:00
Egor Eliseev
9d4bab9c2e 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>

GitOrigin-RevId: 2ab0816f10c970f738d6d931dc123481030cad38
2024-10-30 00:59: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
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
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