Commit Graph

30118 Commits

Author SHA1 Message Date
Aleksandr Sorotskii
c45fbf5a97 fixup npe on additional data; #PY-76613 Fixed
(cherry picked from commit d287d9e07fe024e73551c3ff6e358be291cdc1fe)

IJ-MR-148504

GitOrigin-RevId: 79708c40ff115d77e253fb0095e3b1fa5bbc1d82
2024-11-26 17:12:55 +00:00
Mikhail Golubev
19a768b4d7 PY-77490 Evaluate language level only once per CFG traversal during name resolution
(cherry picked from commit 6c2a3d6eec7def72340feed8ae0ae2d6b54af6ff)

IJ-CR-149696

GitOrigin-RevId: 14edaf0fa2c49d69aa8d96883dc8b02dec7197e3
2024-11-25 22:38:29 +00:00
Mikhail Golubev
9d2070052f PY-77490 Inline private PyDefUseUtil.getLatestDefs to have access to the reference anchor element
(cherry picked from commit 0eecf0ffb305ab17d5758f20b44c4f2791ab0b02)

IJ-CR-149696

GitOrigin-RevId: 8efb9c569ea8c4c00226d3b4307ff5602f782098
2024-11-25 22:38:29 +00:00
Mikhail Golubev
b853978e3e PY-77490 Make sure PyDefUseUtil.getLatestDefs always accepts a non-null anchor
(cherry picked from commit e0ed8cedaffa90c259f4fd0cf8758e42face847b)

IJ-CR-149696

GitOrigin-RevId: 7a90e82dc6bc86fa5d5eae98951e90d13b445a15
2024-11-25 22:38:29 +00:00
Mikhail Golubev
bb5e98a07d PY-77490 Infer nullability annotations in PyDefUseUtil
(cherry picked from commit f993806b3d199160b8a18117fc6b473e52db13bb)

IJ-CR-149696

GitOrigin-RevId: 773c097981921257681a67c58fd6ba2190a3a9c2
2024-11-25 22:38:29 +00:00
Mikhail Golubev
535af53f05 PY-77168 Allow flow-sensitive resolve from unmatched version checks to reachable outer blocks
Also, don't query LanguageLevel for each element of each instruction,
only once per scope traversal.

This doesn't fix the problem with unreachable definition *inside* blocks under
unmatched version checks, i.e.

if sys.version_info < (3, 8):
    Alias = int
    expr: Alias # unresolved

but it's a more difficult problem how to handle those consistently with the idea
of unreachable version checks under the *current* interpreter version, and hopefully
it occurs rarer than, say, unresolved top-level imports of common names from typing.

(cherry picked from commit 55fd4597c6d0860d290caba15fbf4d313e985a86)

IJ-CR-149696

GitOrigin-RevId: 357ada7e10618aef75c470e6cd878f7672109e83
2024-11-25 22:38:29 +00:00
Petr
22cae80f9d PY-76076 Use proper python version for pyi files to evaluate version guards (PyDefUseUtil).
(cherry picked from commit cc6529de62f7c687c606697b9207170b7903f96d)

IJ-MR-147937

GitOrigin-RevId: 32b1f2d47fecc5592e5b93265c195ca3051497b9
2024-11-25 22:38:29 +00:00
Mikhail Golubev
3fdadc1b6b PY-40458 Use overridden method's return type for overrides only if both are async or synchronous
Because async generator methods in ABC and protocols are supposed to be declared as
plain "def" methods so as not to confuse type checkers with their AsyncIterable
return type annotations, it's better to disable such type-hint re-use if methods
async-ness don't match and not wrap anything in typing.Coroutine implicitly.

See also https://mypy.readthedocs.io/en/stable/more_types.html#asynchronous-iterators

(cherry picked from commit 6342f15a7786ec0d02ee1ab2b18fd40fd1ca1430)

IJ-CR-149694

GitOrigin-RevId: 3e19f190d9334e6c8648462ebb5b61abe931b0e6
2024-11-25 22:38:29 +00:00
Mikhail Golubev
fae8df34f4 PY-36416 Don't wrap return types of overridden async methods in Coroutine twice
(cherry picked from commit 48d01bedeb62d1a232704e58a3f39e3a7d543d2d)

IJ-CR-149694

GitOrigin-RevId: e431744a18f2b9d2976de7ee12888961e22f2298
2024-11-25 22:38:29 +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
Ilya.Kazakevich
4a8afad761 PY-77434, PY-76185: Allow spaces in project path.
We now allow spaces in project path (`validatePath`) but convert them to underlines for `projectName` (both changes are in `ProjectPathFlows`).

(cherry picked from commit cc875f7b4e6d2354fba79387a0fc9161a6d267e1)

GitOrigin-RevId: 620e5bca8a406c9588f3e4f54260e5e3162bf686
2024-11-25 19:22:57 +00:00
Mikhail Golubev
1e741360c8 [python] PY-75983 Fix "when branch is never reachable" after removing PipBasedPackageManager
(cherry picked from commit 64fdf617bc5bd2addc7b7e21ade59b92febbdfbe)

IJ-CR-150140

GitOrigin-RevId: 339ed7723bd80e5dfae657ca1d0a7421b86f011b
2024-11-25 15:49:55 +00:00
Ilya.Kazakevich
149ca9aa4c Python: Do not break interpreter widget if certain python is broken.
`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
2024-11-24 19:09:46 +00:00
Ilya.Kazakevich
bd53a4dbeb Python: fix EE: VirtualenvKt.createVirtualenv
https://diogen.labs.jb.gg/pycharm/Plugins/PythonCore/EE$3a-VirtualenvKt$2ecreateVirtualenv/index.html

Error should be displayed to user, and never hit the exception analyzer.

(cherry picked from commit 5be176b640396086b672fb658b1383bdbdb281db)

GitOrigin-RevId: ea3b36d15ab170a09920aa57112c98573cee8be9
2024-11-21 17:35:47 +00:00
Hlib.Saliuk
2dc7844cab RELEASE-24: PyCharm 2024.3.1 RC correct splashes
(cherry picked from commit b17d01fbb8ab6b76563ce05947a5fdbd3237164f)

IJ-MR-149862

GitOrigin-RevId: c1937de59da5ce01ca48b96423b03540c239dcf3
2024-11-21 15:29:26 +00:00
Mikhail Golubev
2864833fca PY-76642 Add correct imports when generating type hints containing TypedDict
(cherry picked from commit 5c7761bea54741d68a7137788a46785db61f4247)

IJ-CR-149697

GitOrigin-RevId: 9eafefe6cef2bd599e6b84cf7d199f72c675b14f
2024-11-21 15:09:57 +00:00
Mikhail Golubev
1d8c4eebd6 PY-46546 For Python 3.9+, on "Add type hint for ..." don't import obsolete generic aliases from typing
(cherry picked from commit 7bc7d79e4ad464b67792e19f1be6262946917619)

IJ-CR-149697

GitOrigin-RevId: 5ebc4ec0cf4e5aacffd3f3cd1f62bc5617ae8cf6
2024-11-21 15:09:57 +00:00
Ilya.Kazakevich
c477f20ab3 PY-77463: NPW: Disable "OK" until SDK is set.
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
2024-11-21 13:37:40 +00:00
ekaterina.itsenko
a537a9ddcf [pycharm] PY-77455 Tables(Jupyter, DataView): Add the correct separator
(cherry picked from commit 7d83ea766b39cc05cb2811aa3a2dd390aec9516b)

IJ-MR-149724

GitOrigin-RevId: 14878906578828af11b06661729b9ea2f78d0db2
2024-11-19 23:34:53 +00:00
Mikhail Golubev
3d7e118c36 PY-77060 Remove spaces after * and ** in new-style PEP 695 type parameters
(cherry picked from commit cd38f49d0f28894e4f33dbd2fa331eaf895fd70d)

IJ-CR-148110

GitOrigin-RevId: 99164b1b95b89d7c4b729308c02a8d2800c2f20c
2024-11-19 17:59:42 +00:00
Mikhail Golubev
99a6645e5d PY-36889 Type check assignments to class/instance attributes outside of class bodies
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
2024-11-19 17:25:06 +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
Aleksei Kniazev
0956043be6 [python] removed web survey logging to FUS (PY-74270)
(cherry picked from commit 4820822bb8d7f78597e3fb091587f47dd6acd2d3)

IJ-CR-149662

GitOrigin-RevId: e38330e680b5901128e6c8bbf32769c109321d95
2024-11-19 13:47:41 +00:00
Daniil Kalinin
28719826e7 PY-76640 change wording for promotion message
(cherry picked from commit 5d1b976da6c4e10dbb35afca12a386be956abb5f)

IJ-CR-149632

GitOrigin-RevId: 2d8d7e8cc80c134c050b038a28dd12b50b78bdff
2024-11-19 13:03:04 +00:00
Daniil Kalinin
06eb0577b2 PY-76640 remove opencv from the promotion list
(cherry picked from commit 6d6a13f9210527e8d9b2b33b750adfb5df4f076c)

IJ-CR-149632

GitOrigin-RevId: 63f4a5fb0f4784c11fb1b719e41ddeefa0b757c8
2024-11-19 13:03:04 +00:00
Irina Fediaeva
5e6cc9697d EA-926314: Fix IllegalArgumentException
(cherry picked from commit 99659628ac1514c83a1ac4820ef53558b10d6526)

IJ-CR-149566

GitOrigin-RevId: 94bd1112772f6d479c299456f691825a026410bb
2024-11-18 18:59:30 +00:00
Natalia Murycheva
2a97339f9c [PyCharm Tables] PY-77129 fixed tables python tests
* fixed 3 configurations when we don't install pandas
* fixed tests where the changing tests was missed after implementation changes
* changed python 3.7 to python 3.12

Merge-request: IJ-MR-149361
Merged-by: Natalia Murycheva <natalia.murycheva@jetbrains.com>
(cherry picked from commit f154e99b8986a3f476bd7424d34e0b894991fb33)

GitOrigin-RevId: 9f5b92d8cb3937b59c491018bc1cb3d9b5ecf539
2024-11-18 15:26:45 +00:00
Natalia.Murycheva
b20124dddb [PyCharm Tables] PY-75807 fixed saving formatting after switching tables
(cherry picked from commit 9137764d13fedf6f566624c1f20b03280d78299b)

GitOrigin-RevId: 9d8526f3e4a3c08f2333b400f3bbd37911d84495
2024-11-18 15:26:45 +00:00
Natalia.Murycheva
0e434e4c4a [PyCharm Tables] PY-75807 Added slicing panel
(cherry picked from commit 8fcf2f8aede0860442d43090430081e6925ea8f0)

GitOrigin-RevId: c081c276d1bf7fe441f90d87b0ba4f343166a85b
2024-11-18 15:26:44 +00:00
Natalia.Murycheva
053b4c8407 [PyCharm Tables] PY-75807 Added an action and a popup for "Table Formatting"
(cherry picked from commit 96f3f349314bcfbdaa614b0e0d761e838c24b2a0)

GitOrigin-RevId: 90f42bab8579317cde8f7c803c1c2ed28fe3229e
2024-11-18 15:26:44 +00:00
ekaterina.itsenko
34c9b87f23 [pycharm] PY-76724 PY-77040 PY-77042 PY-76653 PY-76738 Tables(Jupyter, SciView): Change f-strings to format (review)
(cherry picked from commit f5edd0ca937f62be30b4a530bb6ba630bf6d331e)

GitOrigin-RevId: d834e493970d4e70095b453bd88332024dc7ecf2
2024-11-18 15:26:44 +00:00
ekaterina.itsenko
85f156ca46 [pycharm] PY-76724 PY-77040 PY-77042 PY-76653 PY-76738 Tables(Jupyter, SciView): Minor fixes (review)
(cherry picked from commit e485f4320b9f63dd13caea2caf964bf142cb006d)

GitOrigin-RevId: 517724fd78494ac2788e81835fee876f8f89a590
2024-11-18 15:26:44 +00:00
ekaterina.itsenko
3bb307acc4 [pycharm] PY-76738 Tables(Jupyter, SciView): Make bfloat16 work
(cherry picked from commit d14497ca56e6a7c8b041a66c02507d5157a6a722)

GitOrigin-RevId: 5be35a951cb4d93e78f1b167f352510fde8faae3
2024-11-18 15:26:44 +00:00
ekaterina.itsenko
54c780cfcc [pycharm] PY-77040 PY-77042 PY-76653 Tables(Jupyter, SciView): Write custom polars csv converter, change the separator
(cherry picked from commit ded9655bec56e1f08769b37358f957774b2ae28a)

GitOrigin-RevId: 13babc2cb5c69cec7857358fa66ba1c523701687
2024-11-18 15:26:44 +00:00
Vladimir Koshelev
c0b3f1bdab [pycharm] remove what's new from 243
GitOrigin-RevId: d99daca2141ca04a4be4a537ea2954246ef39c8c
2024-11-18 14:08:23 +00:00
Andrey Vokin
5b0a0b90ee PY-51687 Ctrl-Click on TypedDict usage jumps to builtins.py instead of the TypedDict declaration in the use code
(cherry picked from commit 72d68f8b3099563f77eae1bfd9ef28b8f479a7cf)

IJ-CR-148264

GitOrigin-RevId: 95c8e88ac6e3aef6a8364c2a841a1a8bce2f4d3d
2024-11-12 21:16:33 +00:00
Pavel Karateev
2625838bc7 PY-66315 PYDEVD_USE_CYTHON=YES causes ImportError with Python <=3.11
+ Tests
+ Simplified logic for custom `pytest` markers


(cherry picked from commit 45d18ed5c5fa985d15d1d4854b8822d2812dbe85)

IJ-MR-149139

GitOrigin-RevId: 107e9b3524621757937a72ee2ed186c5e31ac05d
2024-11-12 17:08:09 +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
Andrei Iurko
efbebbef0b [qodana] QD-9891 Add reviewed inspections categories and fix json schema validation
GitOrigin-RevId: 7ca2b2fde31a47b41b1940badee13d931bd91102
2024-11-06 14:28:05 +00:00
Ilya.Kazakevich
98ea3d54fe PY-75909: Expand project view right after new project creation.
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
2024-11-06 13:47:08 +00:00
Mikhail Golubev
da2936d4a4 PY-42137 Report incorrect arguments if no overload matches
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
2024-11-06 11:22:48 +00:00
Mikhail Golubev
09fa8a0611 [python] Introduce PyArgumentsMapping.isComplete
(cherry picked from commit 64dca74e18a2ae8c4a64f6730093e59dbef6b671)

IJ-CR-146869

GitOrigin-RevId: 42cc87410c38c09a65b38d2ca9389474f17ae8b6
2024-11-06 11:22:48 +00:00
Hlib.Saliuk
9730a95071 PY-77184: PyCharm 2024.3 RC
(cherry picked from commit 010ef5c924fb63c9496529606a7b2f1c282ed332)

IJ-MR-148606

GitOrigin-RevId: 82f73909caba05b73cd7e68c66e11755f0337295
2024-11-05 22:12:52 +00:00
Aleksandr Sorotskii
094694d4ce Filter out installed packages from the repository packages list; #PY-75726 Fixed
(cherry picked from commit 2597ec8095672a8e08bd0101042392f7ad6174af)

IJ-MR-148587

GitOrigin-RevId: 4f3168bf3cf5ff208e3b01f57cc330c24919e369
2024-11-05 22:07:46 +00:00
Aleksandr Sorotskii
1c20ef9d09 LAME rethrow exception upon failure to show dialog; #PY-77200 Fixed
(cherry picked from commit 06df040104a66809754be69581328397ea8ee23e)

IJ-MR-148554

GitOrigin-RevId: 07a3da77d4daad821ce80a2a3c8552daa976aefb
2024-11-05 21:16:58 +00:00
Egor Eliseev
4016ee39b1 PY-76806 Missing Docker container settings in Run/Debug configurations
Add test


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

(cherry picked from commit 3b4ae8c55909518b01312cf5ece964b44a2b6110)

IJ-MR-147678

GitOrigin-RevId: 40c75203a5246704c32f06542fbb6418b902dbe9
2024-11-05 15:32:56 +00:00
Aleksandr Sorotskii
4a5ddd21ce Do not force latest version, so compatible version will be automatically selected; PY-75799
(cherry picked from commit 51e5a551b39cf40eee91bc825b9bb691ddc8694d)

IJ-MR-148499

GitOrigin-RevId: 4ab11281a775b23b59838fe9d632828832b045ac
2024-11-05 11:36:35 +00:00
Egor Eliseev
5cf9b397f6 [python] Deprecate PySdkExt#createSdkByGenerateTask
Merge-request: IJ-MR-148426
Merged-by: Egor Eliseev <Egor.Eliseev@jetbrains.com>

(cherry picked from commit 05e11dfa15073309f2aa62c608c466c978987a16)

IJ-MR-148426

GitOrigin-RevId: 43993b4e3a7294d0e246a31f4a51a8022064202c
2024-11-04 18:34:17 +00:00