Commit Graph

30081 Commits

Author SHA1 Message Date
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
Aleksei Kniazev
9c3fc02262 [python] registered custom validation rule in plugin.xml (PY-74269, PY-74269)
(cherry picked from commit c67055425d685fa45993be6bd33a5bebaa2e23cc)

IJ-MR-148062

GitOrigin-RevId: 6eac829771fc44e61ddac10c6006b48f87d4de25
2024-11-04 12:18:50 +00:00
Aleksei Kniazev
3d4d8fb8e1 [python] in-product survey about user's job for pycharm (PY-74269)
(cherry picked from commit 5ce25d3c418b54649e6a52a892bc84b837251e76)

IJ-MR-148062

GitOrigin-RevId: 878f980a2487aeb772e600721808261a688b18c4
2024-11-04 12:18:50 +00:00
Aleksandr Sorotskii
208aff9f2d Use the selected version of package while installing it; PY-75782
(cherry picked from commit 398a7e28271b137b5e7ff34eb5278aec7b130b65)

IJ-MR-148351

GitOrigin-RevId: 63be69571fd57f28d4528cff409f137d254ec31a
2024-11-04 12:04:40 +00:00
Ilya.Kazakevich
8a7073429b PY-76417: Show all python3 pythons on Unix.
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
2024-10-30 15:58:09 +00:00
Aleksandr Sorotskii
1087c97645 Make debugger connection params customizable via registry; PY-76400
Merge-request: IJ-MR-148080
Merged-by: Aleksandr Sorotskii <aleksandr.sorotskii@jetbrains.com>

(cherry picked from commit 1ce2a48aebf3336199b12a79879f61af9e2bac7e)

IJ-MR-148080

GitOrigin-RevId: b443e0289420e4f208bc6d80c2c8f2e82a515a60
2024-10-30 15:46:30 +00:00
Ilya.Kazakevich
5e4006f0da PY-74420: NPW, V2: replace home path in sdk path to ~ to get rid of long lines.
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
2024-10-30 15:35:37 +00:00
Egor Eliseev
e973c44d27 PY-70777 Remove useless performance tests for reprlib
Merge-request: IJ-MR-148054
Merged-by: Egor Eliseev <Egor.Eliseev@jetbrains.com>

(cherry picked from commit 333eef5915eba27961dd58c571f72d026cc0e438)

IJ-MR-148054

GitOrigin-RevId: b5534dc682861817911fa3a29a15dda1c6ecd632
2024-10-30 12:36:42 +00:00
Ilya.Kazakevich
81cdb86823 PY-76416: Filter out venvs from base pythons in SDK creation dialog.
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
2024-10-30 02:04:05 +00:00
Daniil Kalinin
ea62ea04bc IJ-MR-146029 PY-76149 simplify the check for expected type from __set__ and assigned value
Reword the inspection text
Co-authored-by: Mikhail Golubev <mikhail.golubev@jetbrains.com>

(cherry picked from commit cab3cb1bbb1316462ee3fd37e735765b31b8d5e8)

GitOrigin-RevId: e3288e503d714a1f76bd1a2e6a0553770e1cbad5
2024-10-28 20:14:19 +00:00
Daniil Kalinin
0f40a088df IJ-MR-146029 PY-76149 code review changes and improvements
* 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
2024-10-28 20:14:19 +00:00
Daniil Kalinin
0cb148129f [python] dataclass_transform: use the annotated class as a resolve anchor for resolving the field specifiers
(cherry picked from commit f15a07836e7aeac7c46b489b4742e8248a0e6ef4)

GitOrigin-RevId: edf8399741cc5d62ba2fb04f9314eb620f83abae
2024-10-28 20:14:19 +00:00
Daniil Kalinin
24d6509dcd [python] loosen the restrictions on dataclass_transform qualified names
(cherry picked from commit b3e20087b64b159382bc24992efa12b5833d4018)

GitOrigin-RevId: 9f74c1d281fa68d937ad925a865feec29175fe93
2024-10-28 20:14:19 +00:00
Daniil Kalinin
7d891602cf [python] rename __get__ in PyNames.java from GET to DUNDER_GET to avoid confusion
(cherry picked from commit 23dd9bc6cb72630e3bee02a2fb160ff38be17d9a)

GitOrigin-RevId: 94e20ece2828c01019c20ae02663e9bad89a8ff7
2024-10-28 20:14:19 +00:00
Daniil Kalinin
c653a43cab PY-76149 Support descriptor types as annotations for dataclass fields
(cherry picked from commit 78a127e1a0083ece810ad996124ad6ea65887da2)

GitOrigin-RevId: 0c33fe51f5f13116f773577056317c537cbc83ef
2024-10-28 20:14:19 +00:00
Daniil Kalinin
4ad6f08f45 PY-76399 Support __set__ descriptor
Add API for inferring the expected type of `__set__` from `value` parameter
Add corresponding logic to PyTypeCheckerInspection to check if assigned value matches the expected descriptor type
Add tests on it

(cherry picked from commit b14ab7b2e40e225b508875a778ceae8986cbb291)

GitOrigin-RevId: 2b15b2b4527a95e5912897ba256dcc73d71c3dcd
2024-10-28 20:14:19 +00:00
Konstantin Hudyakov
e21d283581 IJOB-26 Do now show Run and Debug lessons in Aqua
These lessons expect that `Current File` run configuration is available, but it is not enabled in Aqua.


(cherry picked from commit 0412925c501f3234444702c5f6657078e83d5f30)

IJ-CR-147744

GitOrigin-RevId: 67df76f1c9a5e71eaac90465944e7b894a47fd67
2024-10-28 16:50:17 +00:00
Natalia.Murycheva
f9d6899d51 [PyCharm Tables] PY-76729 tf.EagerTensor and tf.ResourceVariable cannot be sorted in Data View #PY-76729 Fixed
* In case of sorted table, we get a dict for numpy and numpy_based tables. After that, we should extract a specific type of table and define the right python_code_provider. For tf.EagerTensor and tf.ResourceVariable tables the wrong python_code_provider was selected

(cherry picked from commit 62596418a8ac942136379f814bfdac57b60b697a)


(cherry picked from commit 8c9d39f2e82a64d3794fd84d50c255f15becb8b9)

IJ-CR-147319

GitOrigin-RevId: 939dbaa2d97812cd8a040d0fc22fc33cbed800ad
2024-10-28 15:15:12 +00:00
Natalia.Murycheva
c347819edc [PyCharm Tables] PY-76723 Fixed Multiple problems in CSV serialization #PY-76723 Fixed
* see the YT issue for more details

(cherry picked from commit 676a021e221c430c6fd3b600640d7aec1503239e)


(cherry picked from commit 5c8a478a2cc3edb148b684b48dfaf85f9d50627f)

IJ-CR-147319

GitOrigin-RevId: 3d5caa7d348861bc904335db3ff0b1edef2a17b1
2024-10-28 15:15:12 +00:00
Natalia.Murycheva
d3c97e24b0 [PyCharm Tables] PY-72208 fixed table info extracting when pandas is not installed for torch, tensorflow
(cherry picked from commit 80074e8429a4c881d79f5679962f4711db8561c1)


(cherry picked from commit 2829893866821fbbb2c0229abce67caa3a5e6993)

IJ-CR-147319

GitOrigin-RevId: 905af935c1d4c0dedc32a744040f4de97cc870dc
2024-10-28 15:15:12 +00:00
Natalia.Murycheva
48cd6487ae [PyCharm Tables] PY-76675 Fixed rendering Python None values in the csv case for pandas, polars frameworks
(cherry picked from commit f823121ce4adc23d6e9b8e03b87b8b19a789a46b)


(cherry picked from commit 93d7530c7ce0ba60fee5d1d0e909a39ce3b9dc65)

IJ-CR-147319

GitOrigin-RevId: d6dd4a5f63f172685df3e1a1c0d3d6cbcb063071
2024-10-28 15:15:11 +00:00
Bogdan Kirilenko
a5608efc3a [PyCharm] PY-76699 python.huggingFace module uses PythonPackageManagementListener instead of BulkFileListener to check whether any relevant HF library is installed
(cherry picked from commit 3d91d2d1444dd8d682d866fd79a24a6851c6214b)


(cherry picked from commit 3343a64ec240926532e793e16ace55be6bfe4010)

IJ-CR-147319

GitOrigin-RevId: 304e4d25c5a2ee57333c4dccf641126ab55a0554
2024-10-28 15:15:11 +00:00
Natalia.Murycheva
df0ad5da47 [PyCharm Tables] PY-72208 fixed the missed parameter during refactoring
(cherry picked from commit 67f798c44f0ce5cc3effdc452750ffee9d18bc5f)


(cherry picked from commit 6cb9a806ad46f4e855c9fa3caa14ec1eee9f91a8)

IJ-CR-147319

GitOrigin-RevId: 507e62dcf37fa46e5dfb2cb4f0249cec0a2cb054
2024-10-28 15:15:11 +00:00
Natalia.Murycheva
d61525e4a1 [PyCharm Tables] PY-75937 reduce the amount of extracted data that is not used in parsing
(cherry picked from commit 4ffc7411ebfab7d7544a616d04ad44025a5d7d02)


(cherry picked from commit 0960a4c22129641fb5ba2195b05c6a2e5c45926a)

IJ-CR-147319

GitOrigin-RevId: 37c0d6641191b48230ad03d000e2ee55e76c8443
2024-10-28 15:15:11 +00:00
Ilia Zakoulov
a7b3aaec00 PY-76629: Do not resolve bundled stubs when the package is not installed
The implementation is very similar to the PyTypeShed,
it should be merged into more general solution.

GitOrigin-RevId: 1449a774e93206349f17f264c27e2a7877d79b19
2024-10-28 14:57:57 +00:00
Ilia Zakoulov
948779f507 PY-76629: PY-76714: Handle empty string of bundled stubs path
findPathStringInHelpers might return an empty string,
that will be equal to the home path,
that will lead to indexing of the home directory.

GitOrigin-RevId: e800896a4c0631844a7b7a3a79334c3853a30c32
2024-10-28 14:57:57 +00:00
Ilia Zakoulov
ab53444089 PY-76629: Get rid of Django skeleton tests
GitOrigin-RevId: e96b82a3bcba484a5321c54cd15ff755dd7e276d
2024-10-28 14:57:57 +00:00
Ilia Zakoulov
6439b63a2d PY-76629: Get rid of django skeletons
GitOrigin-RevId: 3554062045a5226a95720ae3577af2313a8ce5ff
2024-10-28 14:57:57 +00:00
Ilia Zakoulov
91f27d8587 PY-76629: Suppress PyProtectedMemberInspection if a member is defined in .pyi
Protected member should not be highlighted as a warning if it resolves to .pyi file.
We assume that everything in .pyi file is a public API.

GitOrigin-RevId: c8275f3e48e3cd69b1676de9b78606f28ea224c8
2024-10-28 14:57:57 +00:00
Mikhail Golubev
d69f93c593 PY-76629: Fix DjangoViewNameCompletionTest.testViewNameCompletionInMethods
There were two underlying problems in Kotlin code:
```
run { DjangoFQNamesProvider.ACCEPTS_VIEW_NAME.isNameMatches(this) } != null
```
returned true regardless of the result of `isNameMatches(this)` call.
As a result, we used to suggest Django view names for *all* functions called
"reverse", "redirect" or "reverse_lazy".

Secondly, in FQNamesProviderExtKt.isNameMatches:
```
return getQualifiedNames().any {
  return it.firstComponent == elementQualifiedName.firstComponent &&
         it.lastComponent == elementQualifiedName.lastComponent
}
```
always returned the result of comparison with the first qualified name, ignoring the rest
due to non-local return from the inline `any`.

Finally, DjangoUrlViewProvider.isReverseFunction expected a PyFunctionType as the type
of reverse/redirect/reverse_lazy, but since these functions have overloads in .pyi
stubs we started to infer a union type of PyFunctionTypes for them, breaking the reference
provider. In general, it's better to perform a name resolution instead of type inference
to detect a fully qualified name for a reference.

GitOrigin-RevId: 69949b1b0e65f00557536cf16127279a83ea4f9d
2024-10-28 14:57:56 +00:00
Mikhail Golubev
20b2e20d26 PY-76629 PY-39761 Don't type check __class_getitem__ arguments inside type hints
GitOrigin-RevId: 060a2952d49777bff9853a2d5bc4d257271e559e
2024-10-28 14:57:56 +00:00
Aleksei Kniazev
732cd5275a PY-76629: [python] moved bundled django-stubs to helpers-pro package
GitOrigin-RevId: 24543c7c6249bd7ae8eac0cb6140754b5126858c
2024-10-28 14:57:56 +00:00
Aleksei Kniazev
f985a175df PY-76629: [python] bundle django-stubs, add them to the interpreter path and turn off stub suppressor
GitOrigin-RevId: 044f50f973193d54ea361d3c9b2d64ee3b83974a
2024-10-28 14:57:56 +00:00
Petr
1732354c38 PY-76506 Indexing process should not rely on non-indexed file data in PyCharm 2024.2
(cherry picked from commit 690d2c0c9b044c4132d607e81e770939a3be2315)

GitOrigin-RevId: a524db73b9bd2bdf914e6302460d2a64ab339356
2024-10-28 12:17:15 +00:00
Artem Ivanov
0668846014 PY-74176 Tweak activation of magic literals so they don't interfere with renaming symbols
(cherry picked from commit 69327fbc6680be176286f8fc3dc2aa89140d6c7d)

IJ-MR-146071

GitOrigin-RevId: 37da3ea34c760c7d61384d96616d746a0b731636
2024-10-25 20:18:37 +00:00
Artem Ivanov
2103981df4 PY-74176 Allow PyTargetExpression along with PyReferenceExpression to hold Constance references
(cherry picked from commit 1b4a1c2c24f0aedbb6782aedfca02e119aabcd59)

IJ-MR-146071

GitOrigin-RevId: c1efa76084136c80242935e1f848a2a064075632
2024-10-25 20:18:37 +00:00
Egor Eliseev
23a2bfac5c PY-65295 Poetry installation
Fix poetry executable detection for the "Add new local interpreter" panel.
There was a problem in `ModalityState`, which prevented updating `state.poetryExecutable` from EDT.


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

(cherry picked from commit 43a807c20f8572bcf570121792269d6ee0c67acd)

IJ-MR-147485

GitOrigin-RevId: fab1de5a2a55e62ff66790defb033b7745259dc5
2024-10-25 13:14:58 +00:00
Egor Eliseev
f9f0322222 PY-76806 Missing Docker container settings in Run/Debug configurations
Deleted two redundant Docker run configuration editor extensions.
Return a Docker run configuration editor extension for Targets API.


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

(cherry picked from commit ec02eedb05f006eaf53e711cda34b0403a7b010b)

IJ-MR-147585

GitOrigin-RevId: f4f44d5e8a7204503e1b6ace7c86996e4fc0c02d
2024-10-25 13:13:51 +00:00