`versionString` might be `null` if python in severe broken.
Such pythons shouldn't be here, and we will fix it as soon as we introduce PythonInterpreterService
(cherry picked from commit d4658e07833d6f886991e794f90e5a16f28e50c3)
IJ-CR-150093
GitOrigin-RevId: e0fe53bdacbd014afa67115c9c9414a0cba9ba59
Assume we have the following sequence of events:
1. SDK list is empty
2. `setItems` gets called
3. SDK list set its status to "busy"
4. It gets filled with interpreters and first one is chosen
5. "Busy" flag is removed
For validation, we used to check "Busy" flag only: when it was "busy" we disabled "OK" button.
But before step 3 it isn't busy nor it has interpreter set. Clicking "OK" at this moment might lead to NPE (see the issue).
We now check if value is set fore validation.
(cherry picked from commit 99554914cb7dc67158828559ba2e6da81fdfe350)
IJ-CR-149868
GitOrigin-RevId: d50ffa6025238d515fc387c562f15f370ba1278c
Previously, PyTypingTypeProvider.getReferenceType returned a type from a class attribute
type hint only for assignment to instance attribute located inside a class definition.
In other words, here we inferred the expected type from the annotation
and reported incompatible types in assignment:
```python
class C:
attr: int
def m(self):
self.attr = "foo"
```
but in the following we didn't:
```python
class C:
attr: int
inst = C()
inst.attr = "foo"
```
Now we try to resolve any qualified target expression to a class
or instance attribute and then infer the type from the corresponding
annotation.
(cherry picked from commit 086dbb678a8cd89cfe332bf801631568fb6c3a4d)
IJ-MR-147382
GitOrigin-RevId: 4e3f71baa598d4caf684d0aeab23d1a9a688b94d
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
Platform expands project view automatically once `generateProject` returns but only if it isn't empty. As we generate things in background (see `.launch`) nothing is expanded.
So we expand it explicitly 2 times: when SDK is generated and when project is generated. At least one of these actions must create files which is required to expand the tree.
This code can't be tested because there is no project view tree in a headless mode.
(cherry picked from commit 2390d09619639e8ff8d8906a4e0a284cf24da5ba)
KT-MR-18605
GitOrigin-RevId: 115034e348c029ea751072caacf4220d121bc220
Previously, we reported call arguments only if either all callee
candidates have unmatched arguments or all call candidates have
unmatched parameters. When there was a mix of the two, we reported
nothing.
(cherry picked from commit 97b42faf10de74ee7cd10f934d9eb94e1c8bbb34)
IJ-CR-146869
GitOrigin-RevId: 8babfe6a8ad0152f985655eff27df4df68936594
There was a filter to include `python3` only to exclude python2.
While `python3` is usually a symlink to the good version of python3, there might be more than one file i.e `python3.11`, `python3.12` etc.
We now use regex to find all python3
(cherry picked from commit 024dd2d20ed728e5d4f4fef2c2b1dbaf3c6dcc97)
KT-CR-18710
GitOrigin-RevId: 26d813c98e389fa83e6ddc5c2fcd60b91fe5dac8
The window is small: no need to have `c:/users/John.Doe` or `/Users/John.Doe` there: `~` is enough.
(cherry picked from commit 810abc8a3bb008477eef0045c24c37f5faac1e33)
KT-CR-18709
GitOrigin-RevId: 7924068fc534c676b1d1d625c8294740c65c8c9e
Base Pythons are system-wide pythons, not venvs.
`PythonSdkFlavor.isPlatformIndependent` is `false` for base pythons.
Venvs can only be created on top of base pythons and not on top of other venvs.
We detect all pythons (even venvs in `~/.virtualenvs` e.t.c.) because we might need them in "Select Existing Interpreter" window, but since for "Create New Venv" we can only use base pythons, we use flavor to filter.
(cherry picked from commit 7b4719b821243a4d97304cfa1d106439b11f63b1)
KT-MR-18675
GitOrigin-RevId: e001e8f593b7a964067cbd04fcc3fd22ea8ec4a2
Reword the inspection text
Co-authored-by: Mikhail Golubev <mikhail.golubev@jetbrains.com>
(cherry picked from commit cab3cb1bbb1316462ee3fd37e735765b31b8d5e8)
GitOrigin-RevId: e3288e503d714a1f76bd1a2e6a0553770e1cbad5
* Remove unnecessary descriptor type inference from `PyTargetExpressionImpl.getType`
* Refactor overload resolution for synthetic calls, minor refactorings in PyDescriptorTypeUtil
* Add additional test for __set__
* Do not substitute missing argument types with implicit `Any` in PySyntheticCallHelper
* Always take the first overload for `__set__` if more than one is present
(cherry picked from commit 9d1f9d37f3ea23ce6145f82fc8f62212f744e858)
GitOrigin-RevId: 372dc0e8ccc32095aecf3f611645adc06c2873e9