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
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
`getComponent` accepts `projectPathField`.
We use `ProjectPathProvider` to update project name from this field.
V2 panels are also affected: they now share logic (`ProjectPathFlows`) with project name component.
See `com.jetbrains.python.newProjectWizard.projectPath`
GitOrigin-RevId: f7b306fbbd9777925274513effd56009a0614f9a
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
Make Module.isPipenv/isPoetry only readable.
Create SdkAdditionalData when creating new sdk.
What made it possible to delete the dangerous function PySdkExt#setCorrectTypeSdk.
Merge-request: IJ-MR-145160
Merged-by: Egor Eliseev <Egor.Eliseev@jetbrains.com>
GitOrigin-RevId: 657092ed87f9948ada5aa2ffacfea0653a482ac7
All generators share the same logic, only providing `newProjectName`.
Python PyV3 generators use generator name by default.
GitOrigin-RevId: ffcb56a1bd2beaad1c7693550036aa091fa05a2b
This package (aka PyV3) fixes several issues, including
1. Lots of `DirectoryProjectGenerator` misuses: We now create UI and settings with `ProjectGeneratorPeer`: no more manuals casts in callback
2. Decouples project generation from UI: Settings aren't aware of UI but generate a project instead. Settings are mapped to the UI using Kotlin DSL UI
3. Kotlin DSL UI panel enables validation
4. `PySdkCreator` (an interface implemented by all "v2" SDK panels) now accepts `Module`, so we can provide it Poetry
The whole machinery of `PythonGenerateProjectCallback` (a pack of manual casts only mother could love) is completely deprecated and will be removed soon.
Lots of small changes towards `suspend` functions, Kotlin DSL UI and `Flow` decrease the technical debt.
Merge-request: IJ-MR-144503
Merged-by: Ilya Kazakevich <ilya.kazakevich@jetbrains.com>
GitOrigin-RevId: 21963e843b0ae67c71a6fc5ea1229cb0f57915a9
`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
All implementations use `AbstractNewProjectStep` and any other action wouldn't really work.
We deprecate old method and force users to use new (the one that returns `AbstractNewProjectStep`).
Some methods are finalized because overwriting them might break the contract
Merge-request: IJ-MR-142822
Merged-by: Ilya Kazakevich <ilya.kazakevich@jetbrains.com>
GitOrigin-RevId: aafa6fb336f78391077773ac6d202d35c15a8c8d
`PythonSdkUtil` duplicates VER logic. One Jython-specific thing was also removed as we do not need Jython anymore
GitOrigin-RevId: 658fc42b485ac074a6d89fce3c7408e51cdc8f95
Interpreter creation logic might work against a project or a module. In the latter case a project is a module field.
See `ModuleOrProject` for description.
We also added logic to the `PythonAddLocalInterpreterPresenter.basePathForEnv`: it now uses module root if possible.
Merge-request: IJ-MR-141583
Merged-by: Ilya Kazakevich <ilya.kazakevich@jetbrains.com>
GitOrigin-RevId: 0ef23feb6a2407331c48b9b69caabefc8625a455
Splitting a huge file `poetry.kt` into several
Merge-request: IJ-MR-139484
Merged-by: Egor Eliseev <Egor.Eliseev@jetbrains.com>
GitOrigin-RevId: ea51232c4795538400f3cbbe159850e1c4252ac5
Lots of code returns `null` without any reason. This ill pattern covers errors effectively making it impossible to find the root cause of any problem.
We replace `null` with `Result` to log and report errors.
Merge-request: IJ-MR-139850
Merged-by: Ilya Kazakevich <ilya.kazakevich@jetbrains.com>
GitOrigin-RevId: 7cbb173f672a44a98f24e89e247428ab6e8ca01d
Errors have to be processed by caller, not by logging nor swing messages in a function itself.
GitOrigin-RevId: b617810835f41c6874c776a2a5762d7402123336
1. Delete `intellij.python.community.impl.xml` (move content to `PythonCore` plugin). It is necessary to fix incorrect dependencies: `PythonCore`, `Pythonid` include the same module.
2. Fixed dependencies: if some plugin/module needs Python core functionality, then it should depend on `PythonCore`.
Co-authored-by: Vladimir Koshelev <Vladimir.Koshelev@jetbrains.com>
Merge-request: IJ-MR-136158
Merged-by: Egor Eliseev <Egor.Eliseev@jetbrains.com>
GitOrigin-RevId: ce9ed4c17f601ee1ca2b6cf608f4e30fdac1d879