Commit Graph

30185 Commits

Author SHA1 Message Date
Aleksandr Sorotskii
2873bad618 fix notification for installing packages via quickfix; #PY-72070 Fixed
(cherry picked from commit bee8b1c0431c186658c11b2f0fb33f4c26f95fee)

GitOrigin-RevId: 14417efa3be6f4785fbdf1b05505c7efd09f3a20
2025-01-20 23:33:35 +00:00
Timur Malanin
c57369d4d2 PY-72070 Add a registry key for new logic
(cherry picked from commit e4ba7ef985a72006008ba4e377aa2e50385ea0bd)

GitOrigin-RevId: d399d09949844a989b130aba119af4ca5118e8b1
2025-01-20 23:33:35 +00:00
Timur Malanin
8567a5261d PY-72070 Introduce a CompositePythonPackageManager that combines functionality from several package managers. This change also refactors the CondaPackageManager to get rid of type check of package specifications.
(cherry picked from commit 2b41be8d768d820769a749339fac64d03925b575)

GitOrigin-RevId: 6ac187b64eb2e516e228dcfda492f2f3d7f73f49
2025-01-20 23:33:35 +00:00
Andrey Vokin
655d3cec0d PY-78371 PyCharm does not mark imports in try/except blocks as unused
Update test data.
1. Unresolved imports are not removed with optimize imports
2. Unresolved imports are not marked as unused


(cherry picked from commit 2c32c368ae0907fb75ea76fc9749e903c160667c)

IJ-CR-153189

GitOrigin-RevId: 153d42e7f61f8357eeb74f022e31bbe406e83c02
2025-01-20 15:08:33 +00:00
Andrey Vokin
db6d06207c PY-77891 "Unused import" inspection is inconsistent in nightly
The logic for disabling the unused warning on unresolved imports was dependent on the visit order. Moving sustracting unresolved imports to the end of computation fixes the problem.


(cherry picked from commit adeb85e59c17261a5bf9f64dfb4a7836a2403f43)

IJ-CR-153189

GitOrigin-RevId: fac4173a0fac5b29be9301f9d5f04fed08cceff1
2025-01-20 15:08:33 +00:00
Aleksandr Sorotskii
517fd8ef36 fixup 243 merge; poetry test, uv icon, jackson lib
GitOrigin-RevId: 0e322cbfb242ae2dfa4ec77ed7d9b5c9300d2565
2025-01-19 21:30:05 +00:00
Pavel Karateev
7aa65206f7 PY-77656 Use correct uv icon
(cherry picked from commit 36aefbfa67c896df11b9a5954f119a2246dd2372)

IJ-MR-150144

(cherry picked from commit 23fec17ac9a60b7ba1aa28fad7de1650030c64f6)

GitOrigin-RevId: 92a6f48239a0ce834564b3ec54d99e24675d68f6
2025-01-19 21:30:05 +00:00
Dima Golovkov
e305b9d6c2 Add UV icon for UX-3312
(cherry picked from commit 8cb51234a2a5b1c5757cf4dc2a04a769d510b675)

GitOrigin-RevId: 289cc40c9aa52bc3a666fff986178078630bbd6b
2025-01-19 21:30:05 +00:00
Aleksandr Sorotskii
c94f1328da cleanup sdk provider; PY-75983
(cherry picked from commit 64835c70c5b57c35005f3f6d30cf0dc269b6a6cf)

GitOrigin-RevId: a2c6be9170353db1879becf9157867d6efad400d
2025-01-19 21:30:05 +00:00
Timur Malanin
c39507ddb0 PY-72070 Introduced PythonPackagesInstallerAsync for performing package installations asynchronously using coroutines. Updated the existing PyPackageManagerUI to utilize this new asynchronous method.
(cherry picked from commit 80c4c17b9ad7a209be747b10dc5bdbd94cff6b9b)

GitOrigin-RevId: e7a89997e694e792794fe604e7c4270be9517b24
2025-01-19 21:30:05 +00:00
Aleksandr Sorotskii
42c78668df fix duplicate cmdline args in error info
GitOrigin-RevId: f4fcdb2c9419f7edc755eb42e9253f8e62bbc610
2025-01-19 21:30:05 +00:00
Aleksandr Sorotskii
3f017485ef extract common code for listing installed/outdated packages for poetry; #PY-78077 Fixed
GitOrigin-RevId: ba1410bab2aeb4b69e6a9b134fd81331b7de3b06
2025-01-19 21:30:05 +00:00
Aleksandr Sorotskii
b21ed9e4e9 more consistent naming for uv; PY-75983
(cherry picked from commit 111a9ffb7b7107d3fbdfe01df649a38be2b5b821)

GitOrigin-RevId: 2b99c7457d94437d5c4c117b74031c30c5c84ff1
2025-01-19 21:30:05 +00:00
Aleksandr Sorotskii
400fb17865 fix poetry package manager running poetry update upon reloading the package list; #PY-78077 Fixed
(cherry picked from commit b0f73f88f39a62b4351fb6189fe5d9afb79ef6d3)

GitOrigin-RevId: 8e78ddecb0298826c8bc8dcf55e5b105954bd269
2025-01-19 21:30:05 +00:00
Aleksandr Sorotskii
170ad83859 reload vfs upon packaging operations to show any possible changes to project files; #PY-78157 fixed
(cherry picked from commit d7d41aa8cccec13c74736fbee036a9fcd78edeae)

GitOrigin-RevId: 72592940511dd4b3b18a6d44e27e4121bb74a204
2025-01-19 21:30:05 +00:00
Aleksandr Sorotskii
2df265c932 work around suspend/legacy api and threading isssues; #PY-77996 fixed
Merge-request: IJ-MR-151488
Merged-by: Ilya Kazakevich <ilya.kazakevich@jetbrains.com>
(cherry picked from commit db9e012e187c62fbc53ddfa0c31603eb834058f9)

GitOrigin-RevId: 543d11a54e7106bd7f057e930d3796cc76d64617
2025-01-19 21:30:05 +00:00
Aleksandr Sorotskii
1d3e312dd5 fix running blocking on EDT; #PY-77850 fixed
(cherry picked from commit f06465ebffcadc50c564cb815973813d3643673b)

GitOrigin-RevId: 10ded6d4328c5645622a1cd06320279979c2c34d
2025-01-19 21:30:05 +00:00
Aleksandr Sorotskii
6727b2c5cf tweak initializing uv env; PY-75983; #PY-77715 Fixed
(cherry picked from commit e4c5af263e33b445bbdc4b1de7ed8aacea98b101)

GitOrigin-RevId: 897dd009b192fa2adb00d2ed07767bad17f42cda
2025-01-19 21:30:05 +00:00
Aleksandr Sorotskii
2769b5d234 fix uv detection for win and when creating cli; PY-75983
(cherry picked from commit f54ee351bfdceb6597a74d1fb128e000051984ba)

GitOrigin-RevId: 3200c0ae179a2e4e15a9ff9691421803cd09e1af
2025-01-19 21:30:04 +00:00
Aleksandr Sorotskii
77157d6fe2 support uv interpreter project configuration upon opening for the first time; PY-75983
(cherry picked from commit 44f133462ae29d6865a3ed5918a556d7d0a2cac7)

GitOrigin-RevId: d87fc8ae6076fb4fc3c20e8effaf5818c2f8ba20
2025-01-19 21:30:04 +00:00
Aleksandr Sorotskii
dc79f6b09c remove code duplication for poetry; PY-75983
(cherry picked from commit 3498c4b1da0f2f791940bd8f476e24701edd199c)

GitOrigin-RevId: 30e7d12a822031722d20373bef86d20d1d2ed95d
2025-01-19 21:30:04 +00:00
Aleksandr Sorotskii
42af44caf9 basic support for uv env & package manager; PY-75983
(cherry picked from commit 2597e4de17e167d8a0b0038190b5127a9dc4b155)

GitOrigin-RevId: 025955aea8f118a26e5ea24ca5b740fdd6c6bc7a
2025-01-19 21:30:04 +00:00
Aleksandr Sorotskii
c8b62d5056 remove redundant pip based python package manager; PY-75983
(cherry picked from commit a1d3cb3a5f31763f38c6c5c2d7c7f855d83e1f0a)

GitOrigin-RevId: c0ce987c8f9bdf3856cd69febe8a19a8af69491e
2025-01-19 21:30:04 +00:00
Egor Eliseev
b0995cd9a1 PY-72345 Pycharm 2024.1 Broken debug on Python 3.12-3.13
Add a processing function for new breakpoints.


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

(cherry picked from commit 63ebb4c7c620cf7cc3f56924619fc5adc09e25dd)

IJ-MR-152628

GitOrigin-RevId: 1f26240498360aff61ff27878118b0eb841ec082
2025-01-16 16:20:50 +00:00
Egor Eliseev
55ce70bcba PY-78449 Debugger completely broken in PY-251.15449
Regenerate Cython files for Windows
Regenerate Cython files for MacOS


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

(cherry picked from commit c506acd0c0f35c542b52fb7c41075f552a5258b3)

IJ-MR-152850

GitOrigin-RevId: ac83063ed1280659f4e759d88be3ed89798f30b6
2025-01-16 15:51:30 +00:00
Vitaly Legchilkin
e2d66c37e4 [python] PyPI API constraints implementation (PY-78109)
* All URLs which respond with an HTML5 page MUST end with a / and the repository SHOULD redirect the URLs without a / to add a / to the end.

* Repositories MAY redirect unnormalized URLs to the canonical normalized URL (e.g. /Foobar/ may redirect to /foobar/), however clients MUST NOT rely on this redirection and MUST request the normalized URL.

https://packaging.python.org/en/latest/specifications/simple-repository-api/#base-html-api


(cherry picked from commit c90a3779344521428b03fd361b6e8daa349138c3)

IJ-MR-152631

GitOrigin-RevId: ef2dff1ccc18b8a200e69e1ab9843717d29d5fd3
2025-01-13 12:13:12 +00:00
Andrey Vokin
915ccaa68e IJOB-583 PyCharm onboarding lesson broken (at step 16)
After PY-55548 no need to change type hint `object` to `float`


(cherry picked from commit d9ba34fb955df644b7892b070dc1f5523db7fce9)

IJ-CR-152255

GitOrigin-RevId: ae0f12168de11265c14432709abb074d35530ccc
2025-01-09 13:30:27 +00:00
Dmitriy.Panov
82fa4ae1e2 IJPL-172978 different UUIDs for IDE binaries on macOS
(cherry picked from commit e56374d6355c41d66e41e2de4c2ca14431464537)

IJ-CR-151551

GitOrigin-RevId: a18ab4cd13c6476dfff57f6cb62722f72c5dcb68
2025-01-03 15:51:13 +00:00
Alex Plate
2ab18edac8 [Python Onboarding] There is no need to require a module to open the interpreter settings
Also, silently returning from the function will leave the link non-working, what is confusing for the user


(cherry picked from commit 7b0384c5810ab38268420f172c7e3ddbef0d7b15)

IJ-CR-151630

GitOrigin-RevId: 15bdac04edde15e1b181e18d9006485c141b6308
2024-12-27 15:06:26 +00:00
Mikhail Golubev
1be05f5d9e PY-78189 Flip expected and actual types in warnings about __set__ argument
(cherry picked from commit 65f8c92b852539908c71715756ec407781a9fb6b)

IJ-CR-152050

GitOrigin-RevId: 2672bc7f5d39dd2bec1a9b2c2d322dffb3d66062
2024-12-20 14:45:15 +00:00
Aleksandr Sorotskii
4ed6a858d4 Automatically switch client/server mode in debugger tests; PY-78168
(cherry picked from commit 3714877098305edcc4eae4f9761ab176c0112355)

IJ-MR-151881

GitOrigin-RevId: e6c06cfd22fa03964b8373ecd738fec26c7d785f
2024-12-20 14:42:55 +00:00
Aleksandr Sorotskii
f5e820f848 disable python debugger single port by default; PY-78168
(cherry picked from commit e73f477e2424c4c103bfaa676cdf94098170d4b5)

IJ-MR-151881

GitOrigin-RevId: 7a665d852d77554e00a51cce697940ebd5da538b
2024-12-20 14:42:55 +00:00
Natalia.Murycheva
050782b5ea PyCharm Tables] PY-33448 PyCharm freezes with large objects in SciView #PY-33448 Fixed
* Fixed also the Python Console case: transposed 1-Dim table there as well

(cherry picked from commit a6c783dc38aa3c5050a836c36d8a76e8b3cbda19)

GitOrigin-RevId: b7fe92925fe8702ffd80e56a4fe0c313c6411372
2024-12-19 15:17:52 +00:00
Natalia.Murycheva
53d3243005 [PyCharm Tables] PY-33448 PyCharm freezes with large objects in SciView #PY-33448 Fixed
* Transposed 1-D numpy array on the Python side of the Debugger
* Applied setMaxItemsForSizeCalculation method to the myRowHeader table to minimize calculations for getRowHeight

(cherry picked from commit f88fa625f2d8673cba2c9819f2907462b3f2301d)

GitOrigin-RevId: de6f919f18caec6624b1696790a88e10659e96f0
2024-12-19 15:17:52 +00:00
Natalia.Murycheva
c68e31976c [PyCharm Tables] PY-77591 Added "is None"/"is not None" conditions to tables' filters #PY-77591 Fixed
(cherry picked from commit ad48262cab5d46f06b1ee7f72c764ee899f0c926)

GitOrigin-RevId: 75313468a9f205fce99fae1215399d32131626a5
2024-12-19 15:17:52 +00:00
Ilya.Kazakevich
785ae87864 PyCharm: Skip files in PYCHARM_PYTHONS dir in tests.
We might have scripts there (on Windows) like `fix_path.cmd`, we need to exclude them


(cherry picked from commit e09ceac554f456a3d8a931e0dfe26872908c303c)

IJ-CR-151567


(cherry picked from commit 8a8d68e41a6bd607622f3b6afa76e5dc878f4236)

IJ-CR-151953

GitOrigin-RevId: 9a463cdc1e0c348c2ffa27f26e64781f5014bd97
2024-12-19 15:16:27 +00:00
ekaterina.itsenko
c404d3fdbc [pycharm] PY-76963 Tables(Jupyter, DataView): deal with NaN's
(cherry picked from commit db266d1e3d57ab2808d04da0ec020c698a687d98)

IJ-MR-151825

GitOrigin-RevId: fa805e62023b27fde32a82f3b2563278f5060e85
2024-12-18 16:36:33 +00:00
ekaterina.itsenko
e11ed05c0b [pycharm] PY-77107 Tables(Jupyter, DataView): fix display issues
(cherry picked from commit b6eb5b7e6b62a9c850a7f7512702ce5c87685cb4)

IJ-MR-151825

GitOrigin-RevId: 4716c26e57ff3163dbd4046b653c6e0350a70554
2024-12-18 16:36:33 +00:00
Egor Eliseev
cc30351cde PY-77788 Fix Requires Thread annotations
Merge-request: IJ-MR-150426
Merged-by: Egor Eliseev <Egor.Eliseev@jetbrains.com>

(cherry picked from commit 58bc50470e72e24d85869fb43a2556b6ecc01c61)

IJ-MR-150426

GitOrigin-RevId: 0bb2402914a3fbb9dcda6a868ce87fdbca31af03
2024-12-18 16:04:53 +00:00
Egor Eliseev
cf06be9b95 PY-52265 Poetry in-project environment
Add the new setting: create poetry env in the project.


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

(cherry picked from commit ed85efe339518cdf6949752be286172113931c22)

IJ-MR-149143

GitOrigin-RevId: 3a682aac846e4a80e8310a3dcc0a5f1c988d28e2
2024-12-18 15:50:26 +00:00
Egor Eliseev
f910392d5d 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>

(cherry picked from commit b398d04bfa358ce97bf1d30d59b2113548e7983c)


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

GitOrigin-RevId: 2cd929fad7649fd6302100b8af5ff7969de8ec3e
2024-12-18 14:01:31 +00:00
Aleksandr.Govenko
51fe58feb5 PY-20710 Fix NPE in PyTargetExpressionImpl
Merge-request: IJ-MR-150854
Merged-by: Aleksandr Govenko <aleksandr.govenko@jetbrains.com>

(cherry picked from commit ae24337d4cf3e2f8aa3219681bb36abce17cd212)

IJ-MR-150854

GitOrigin-RevId: f42a45ee8af4e48ab83442960e1c9cbe3e15f361
2024-12-18 02:37:10 +00:00
Aleksandr.Govenko
70fe60b4c8 PY-20710 Support 'Generator' typing class
Check YieldType of yield expressions in PyTypeCheckerInspection
Check that (Async)Generator is used in (async) function
Check that in 'yield from' sync Generator is used
Convert PyMakeFunctionReturnTypeQuickFix into PsiUpdateModCommandAction
Infer Generator type for lambdas
When getting function type from annotation, do not convert Generator to AsyncGenerator
Introduce GeneratorTypeDescriptor to simplify working with generator annotations


Merge-request: IJ-MR-146521
Merged-by: Aleksandr Govenko <aleksandr.govenko@jetbrains.com>

(cherry picked from commit b3b8182168c5224f0e03f54d443171ccf6ca7b89)

IJ-MR-146521

GitOrigin-RevId: a95670d7e2787015bcf162637ea6d7bfb47a312a
2024-12-17 20:59:50 +00:00
Tatiana Ber
362a0344a7 PY-77814 Update text in messages
GitOrigin-RevId: f04fcb10130b6fe79516d36b0b16c3f38dcc2462
2024-12-17 19:40:40 +00:00
Aleksandr.Govenko
4dd41ee9f5 PY-20611 Missing warning about functions implicitly returning None when return type is not Optional
Updated PyFunction to account for implicit 'return None' statements when inferring return statement types.

It affected return type inference of PyFunction.

Fixed a failing test related to formatted strings.

Added a quick fix to make all return statements explicit.

Updated the CFG to include PyPassStatements, enabling detection of exit points in empty functions.

Simplified PyMakeFunctionReturnTypeQuickFix to independently infer function types and handle required imports. Currently, it does not support specifying custom suggested types.



Merge-request: IJ-MR-148719
Merged-by: Aleksandr Govenko <aleksandr.govenko@jetbrains.com>

(cherry picked from commit 9f58961f9eb70e4f9dbba7359f5aafdfd392b7e2)

IJ-MR-148719

GitOrigin-RevId: 68ef5c4a1cc0fcaffd750cc0713250a106136643
2024-12-17 18:16:40 +00:00
Aleksandr.Govenko
bdbe78b63a PY-60714 PyCharm does not understand async iterators
__anext__ method is required to return Awaitable. When getting iterated type, unwrap that awaitable


Merge-request: IJ-MR-150432
Merged-by: Aleksandr Govenko <aleksandr.govenko@jetbrains.com>

(cherry picked from commit 97a070ead70c0ec0f2da08000517c592c5805965)

IJ-MR-150432

GitOrigin-RevId: 21dc20b164e6095e56707ea50bc93bf67564e88e
2024-12-17 15:42:06 +00:00
Mikhail Golubev
31678081b3 PY-77167 Simplify resolve logic for overloads, get rid of RatedResolveResult#RATE_LIFTED_PY_FILE_OVERLOAD
If there is an overload not followed by an implementation, which is
already an error, always resolve to the first overload, regardless
of whether it's a .py file, or a .pyi stub. It allows us to eliminate
the special RatedResolveResult#RATE_LIFTED_PY_FILE_OVERLOAD rate in .py
files, because we no longer need to duplicate the last, closest reachable
overload (normally an implementation should be reachable) with a higher
priority, and then filter it out during overload resolution.

Meanwhile, this filtering out didn't work right before
because some type inference logic, e.g., PyCallExpressionHelper.getCalleeType
used in PyReferenceExpressionImpl.getCallableType bypassed it. It should have
been done at the level of
PyCallExpressionHelper.forEveryScopeTakeOverloadsOtherwiseImplementations.


(cherry picked from commit 99a624ab85957d7a2d3c2c0ced596e472f9d615b)

IJ-MR-148398

GitOrigin-RevId: c2cdfe8c8b046118f4e6f7269dbf7848dd746e08
2024-12-17 15:33:39 +00:00
Mikhail Golubev
714c16f197 [python] Simplify PyResolveUtil#resolveQualifiedNameInScope
(cherry picked from commit 6b95f07ddffbbd246e5c3a852de42c0cc19098ce)

IJ-CR-151380

GitOrigin-RevId: 24a9cb2f52bdc9ace2e2d21ac0d0f2e002451dae
2024-12-17 14:53:28 +00:00
Mikhail Golubev
66f10b6356 [python] Make PyResolveUtil.resolveQualifiedNameInScope automatically traverse scopes
(cherry picked from commit 6013fdabf6967a193a60849ec0e81e153380b4b7)

IJ-CR-151380

GitOrigin-RevId: 7f238ba2bee90f15dbe9c76cbf4e089a48f52870
2024-12-17 14:53:28 +00:00
Mikhail Golubev
651f6c3310 [python] Add a clarifying comment in PyDataclassInspection
(cherry picked from commit 1f109781ad81e2b5db578a384ee5dba6b1cbbccf)

IJ-CR-151380

GitOrigin-RevId: 45a480dba35bf14df8afcd3c69707603ff5c8f19
2024-12-17 14:53:28 +00:00