Commit Graph

6464 Commits

Author SHA1 Message Date
Aleksandr Sorotskii
56cc278737 PY-73001: improve toml stats, add one more test
GitOrigin-RevId: 177c87c825c8b0da937c23c5b0a9c299ab0fdda5
2024-06-26 18:58:58 +00:00
Aleksandr Sorotskii
b71858d628 PY-73001 Log popular tools and build system requirements mentioned in pyproject.toml
GitOrigin-RevId: 8a54afcc73246ff4d2667229345aa1778dc6a2af
2024-06-25 19:53:37 +00:00
Andrey Lisin
7de4a58087 PY-60597 Move test data for PyCharm Professional debugger feature tests to professional test data path
GitOrigin-RevId: 04d6c9229c93cd7fd81474c48fc42df1d71bc83b
2024-06-20 18:27:43 +00:00
Egor.Eliseev
0c73c9eff9 PY-72274 separating content for python core/pro plugins
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
2024-06-19 21:39:24 +00:00
Andrey.Matveev
2854de57c0 PY-62301 Not highlight Self in __new__ method
GitOrigin-RevId: 099d4ca6f34b30e757ad030f418c9db827a71abe
2024-06-19 15:03:24 +00:00
Andrey Vokin
170506beaa PY-73102 Presence of @warnings.deprecated or @typing_extensions.deprecated decorator suppressed errors about incorrect call arguments
GitOrigin-RevId: d1a5a4ce224fe92af9f0df376b63b8cb38ca3990
2024-06-17 22:26:51 +00:00
Andrey Vokin
f2a322c6d9 PY-73107 Usages of @warnings.deprecated inside .pyi stubs are ignored
GitOrigin-RevId: 7682eff8c8ca8ae8241ddee3191add34ab2ac22e
2024-06-17 22:26:51 +00:00
Petr
ee91d6a211 PY-72661 Literal completion inside nested parenthesis
GitOrigin-RevId: 14f18efcbaa520ac36ddd4892b774ed60a01cfdc
2024-06-17 20:36:23 +00:00
Andrey Vokin
673383c3da PY-61651 Deprecation highlighting with PEP 702 @deprecated decorator
GitOrigin-RevId: 426e7001d20849d7029fea55431d3e2cfae3eb11
2024-06-10 15:58:53 +00:00
Andrey Lisin
c2a7096de3 Cleanup: replace getTags() method with @EnvTestTagsRequired annotation
GitOrigin-RevId: 60aa962e74b98616275aac268604d9c18a38cd0d
2024-06-04 17:05:36 +00:00
Andrey Lisin
02b978c825 PY-61217 Put subprocess tests together to follow logical order
GitOrigin-RevId: a94104fd67b7c24d25845eab3277262251c5f92b
2024-06-04 17:05:29 +00:00
Andrey Lisin
4959962158 PY-61217 Run subprocess debugging tests on all CPython versions since they now pass on CPython 3.11 and 3.12
GitOrigin-RevId: 074f70e260d302b119c4e64952b5a56c5e0ad661
2024-06-04 17:05:23 +00:00
Daniil Kalinin
1cfcce3b7a PY-54356 fix "Callable | None" raises the warning "Cannot find reference '|' in 'Callable'"
Previously, there was no chance to resolve `__or__` member for class references like `Callable`, `Generic` as its type is PyCustomType that always returns `null` from getMetaClassType(). Now in operator references we at least resolve such references in types which PyCustomTypes mimic to

GitOrigin-RevId: ff05ae62e4c1a17026310a3407f40597154bc946
2024-06-03 17:32:16 +00:00
Maxim.Kolmakov
71168cb8a9 IJ-CR-135039 Replace usages of PlatformTestUtil.newPerformanceTest with PerformanceTestUtil.newPerformanceTest
GitOrigin-RevId: 4edcfadc23f7305d68b8c08cd6ae634ee4869a2e
2024-06-03 10:14:22 +00:00
Mikhail Golubev
d99a86efeb PY-35190 Fix resolving the register method of ABCMeta
The root cause was introduced in PY-23540 (see cb598c94c5).
Namely, abs.ABCMeta was explicitly filtered out from the list of metaclasses in
`PyClassImpl.getMostDerivedClassType` because for some reason in Typeshed stubs for
Python 2 `basestring`, and hence `str`, uses `ABCMeta` as its metaclass,
which is not true at runtime. It caused a metaclass conflict when inheriting `str`
with another user-defined metaclass (`ABCMeta` and a user metaclass didn't extend
each other), so we didn't detect any metaclass in a class as a result.

I've updated Typeshed stubs for Python 2 manually to process ABCMeta normally.
We don't update these stubs anyway, so these changes won't be lost on a future
Typeshed sync.

GitOrigin-RevId: 680e9fa890d00ea63987f3cf73e636e430685f34
2024-05-28 08:41:05 +00:00
Mikhail Golubev
93ac5fe566 PY-70528 Add support for typing_extensions.TypeVarTuple and Unpack
I've add-hoc updated typing_extensions.pyi in the bundled Typeshed to
recognize Unpack there.

GitOrigin-RevId: 953402e42984712a630c1772cf2f2cd4cbacdccf
2024-05-28 01:10:05 +00:00
lada.gagina
6b88970036 [python] packaging toolwindow: filter search results regardless of dash/underscore (PY-70173)
Treat underscore and dash when searching packages equally for pip-based tools, while keeping strict search for conda

GitOrigin-RevId: 176720ac5c51bd6e9486cd7df3744230aa32a37b
2024-05-20 15:56:16 +00:00
Mikhail Mazurkevich
f35c735b19 [workspace model] Remove workspace.model.global.sdk.bridge registry key
GitOrigin-RevId: c98c2af849d2feb52a3a305c426341ab816f0fc8
2024-05-16 11:20:28 +00:00
Petr
abfb927619 [python] PyAssignmentStatementImpl.getTargetsToValuesMapping() Unpack nested tuples as specified in javadoc
GitOrigin-RevId: e0d4c13cadfa11d85ba3ddeba17e3c4cdda0a46d
2024-05-15 00:01:20 +00:00
Petr
b9d89b367a [python] PyAssignmentStatementImpl.getTargetsToValuesMapping() Handle nested parenthesis
GitOrigin-RevId: 6431171bee6624e0256d08fd5e1eddfb82132ccb
2024-05-15 00:01:20 +00:00
Petr
c015ff5cbf PY-55044 TypedDict **kwargs typing
GitOrigin-RevId: 5dff382b321ac166ed4b8cf90e431ea719995608
2024-05-14 23:49:38 +00:00
Petr
aefaeaa52a PY-54151 TypedDict completion at callee does not work for methods
GitOrigin-RevId: 5a037490d8c24ccdd354e8396540a21294148a7e
2024-05-14 22:52:52 +00:00
Petr
7965dde4a4 PY-56004 Completion for expected literal types in assignments
GitOrigin-RevId: 06cacc62e068d902b174e5208837959cbd92ed88
2024-05-13 14:59:57 +00:00
Nikita.Ashihmin
7032ef2e1c [pycharm] PY-72340 Jupyter(feat): Support "File <file>:<line>" format for highlight of stacktraces, resolve path with ~
GitOrigin-RevId: 8ba99b238db19eaf1cf714df2ac388a649a61d88
2024-05-10 00:39:38 +00:00
Daniil Kalinin
19a4b1d01c PY-64326 tests for incremental parsing of PyStatementList
GitOrigin-RevId: 83e5343e9a164d92f8a5acf43b9ef0790e4a5ce3
2024-05-07 17:30:41 +00:00
Petr
b90f8fe4c3 PY-42307 Always suggest InstallAndImportPackageQuickFix
GitOrigin-RevId: d55f2df38ba80b4936a9ceb6adf3f4b304786bef
2024-05-07 14:27:33 +00:00
Ilia Zakoulov
4e968c51e6 PY-72457: Refactor PyEnvTestSettings to automatically detect local interpeters folder
Move code from constructor to `fromEnvVariables` to enhance readibility
and be able to use other functions.

GitOrigin-RevId: 921fb0265feb3dc59f42cbf29bffdc77f5313607
2024-05-07 12:18:53 +00:00
Vladimir Koshelev
8754f98cbe PY-72443 fix module => package mapping for some of the popular ml libs
GitOrigin-RevId: 962d57b87333c8c196dbd52bcfd4b5a41ba7317b
2024-05-06 15:20:45 +00:00
Nikolay Chashnikov
e9671e99c7 cleanup: move TestEnv out from com.jetbrains package
It would be better not to place any classes in such a generic package. And it also causes red code due to IDEA-352819, so this needs to be fixed to allow enabling "Good code is red" inspection in "Zero Tolerance" checks.

GitOrigin-RevId: d0edae5ceda7e95fe3b2b9726e5c3996ded149ca
2024-05-02 08:45:06 +00:00
Nikolay Chashnikov
b4df0488a0 cleanup: don't use private class in signature of CustomFoldingSurroundDescriptor.getAllSurrounders
This is needed to work around for IDEA-352818 to allow enabling "Good code is red" inspection in "Zero Tolerance" checks.

GitOrigin-RevId: a058e15624e39c3faa649df20bd4f7c20be5faaf
2024-05-02 08:45:01 +00:00
Andrey Lisin
705043e00a PY-72239 Reenable Python 3.11 and 3.12 for stepping tests where they were previously disabled
GitOrigin-RevId: 644639857cb6be26ddac76615f68c0718f05be58
2024-05-01 13:59:37 +00:00
Andrey Vokin
60aa7ae2d3 PY-71972 "Go to declaration or Usages" doesn't work for instance fields from the constructor.
TextOffset is used to retrieve target element here: TargetElementUtilBase#getNamedElement.

GitOrigin-RevId: 5c9d721e6870079e4bf86ab7e5c8efb0be5810b0
2024-04-30 16:17:53 +00:00
Petr
11549ca709 PY-42664 fixed dictionary type inference
GitOrigin-RevId: 3fd967d00a6212769001166975167f022288f787
2024-04-26 20:12:18 +00:00
Mikhail Golubev
b9d7fee816 PY-64304 EA-247016 Don't report illegal "await" expressions used as assignment targets during parsing
Instead, parse them as usual and later report in the dedicated AssignTargetAnnotator
and TypeAnnotationTargetAnnotator. This way, a PsiError element appearing in the PSI
tree of a type declaration statement doesn't cause PyAstTypeDeclarationStatement.getTarget
nullability contract violation.

GitOrigin-RevId: a3e90088cfac7938c398d4d293a72dbd127a2cd0
2024-04-24 09:03:53 +00:00
Andrey Lisin
0f6a0f2964 PY-72148 Fix string representation in debugger variable view
GitOrigin-RevId: 61b98f4a25fee1738ca0950a8f93af55ac44ff3b
2024-04-23 18:47:03 +00:00
Petr
e01b0b6beb PY-40480 Completion for argument passed to parameter hinted as Literal
GitOrigin-RevId: 462b03dc35eef70bc873b568cae239d40f1d4974
2024-04-18 20:55:14 +00:00
Mikhail Golubev
5bf2f99b65 PY-29489 Support unpacking non-generic iterable types, e.g. str or range
Use getIterationType for that, already implemented for inferring types
of for loop targets.

GitOrigin-RevId: daac45b4118629676eb37897cd08d5f8e193bf76
2024-04-17 11:41:23 +00:00
Mikhail Golubev
b70b23ca27 PY-29489 Support unpacking to targets in square brackets
GitOrigin-RevId: 470b0bd74bf3dc2ed5c8b6902df264624b50628d
2024-04-17 11:41:20 +00:00
Mikhail Golubev
8c0b817248 PY-29489 Infer types for generic iterable unpacking in assignments
GitOrigin-RevId: ac4454eae1eba2ec4c3eb71377253b1f97685561
2024-04-17 11:41:16 +00:00
Tagir Valeev
696dfffffc [java-refactoring] IDEA-92605 Detect conflicts for rename local variable
GitOrigin-RevId: 75ad577ef79dac053c689d9eb6d20dec3af222c7
2024-04-17 09:32:44 +00:00
Egor.Eliseev
9bf5511829 PY-35986 Allow a user to run doctests with pytest
Fix rerunning failed tests for all Doctest.
Do 'Doctest via pytest' option be available not only if a file/fun/class starts with `test_`.


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

GitOrigin-RevId: c1e1fda5f66d1e213f34a057175d8e8986a46647
2024-04-13 17:27:10 +00:00
Egor.Eliseev
362973dc82 PY-30598 3 or more dots at the beginning of print do not work
Remove unnecessary prompts processing


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

GitOrigin-RevId: 945f4a8edf3b54f66584af0d8f527f19a5d0178f
2024-04-09 16:34:26 +00:00
Petr
86489b5701 [python] Better code readability (PyIntentionTest)
GitOrigin-RevId: 4dd6e390f282dc67c41dec414231bd0e44d80696
2024-04-05 17:51:16 +00:00
Egor.Eliseev
f48b41f61f PY-35986 Allow a user to run doctests with pytest
Run Doctest via pytest configuration if `pytest` is installed and selected in settings


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

GitOrigin-RevId: 4c97411c3da69249e6b9ad886bcbd9a206db744b
2024-04-05 10:15:58 +00:00
Petr
0b75360e40 [python] Improve test coverage of ImportToImportFromIntention
GitOrigin-RevId: 5c98b2124a35b66132b007c2c60236df90b5adff
2024-04-03 21:12:18 +00:00
Petr
4e2f6f2685 PY-28076 Type of assignment target in parentheses is not inferred
GitOrigin-RevId: 457adb65fea311a169ae8fd4ca78a6915518b378
2024-04-02 19:04:20 +00:00
Mikhail Golubev
5b9b9f8fb8 [python] Improve test coverage of ImportToImportFromIntention
GitOrigin-RevId: 59b2ebdfe4a8c9bbaf264f0db8b45a5af2b4533a
2024-04-02 18:57:35 +00:00
Mikhail Golubev
5f95cf372e [python] Make PyIntentionTest.doMultiFileTest not copy the target file twice to the test root
Previously, a multi-file test copied a target entry file both as myTestName.py
and intentions/MyTestName/myTestName.py. As a result, it was impossible to
use relative imports in this file because it resided at a different
level than the rest of the files from the test resource directory.

GitOrigin-RevId: 8d19e038357fc641e8b5ecf5a1d64f0e4dc87d11
2024-04-02 18:57:35 +00:00
Petr
cdfef53944 PY-52760 Type checker fails at tuple unpacking into a dictionary
GitOrigin-RevId: dbf1181099501764ac9b0d42813b37b48882379c
2024-04-02 15:05:56 +00:00
Mikhail Golubev
cef42660a3 PY-17627 PY-17733 Resolve class attributes defined in @classmethods
The logic is similar to that for instance attributes. Top-level class
attributes and methods defined in the class body get the precedence,
followed by class attributes defined with assignments in @classmethods
unless the latter would resolve to the same assignments as in

cls.attr = cls.attr + 1

finally, we scan through all other class methods resolving the name
to the first definition inside one of them.

So far, I intentionally didn't expose such attributes in findClassAttribute()
or getClassAttributes() because users of these methods assume that
this API considers only attributes defined immediately in the class body.
Adding extra definitions from class methods might break these usages.

I had to update the inspection about typing.Final, because it relied
on the fact that resolve() on assignment targets on class objects can
lead only to those top-level class attributes, where type hints are normally
located, but now it can lead to assignments to a qualified attribute inside
a containing class method.

GitOrigin-RevId: 0ca5bdaa4efca127ac187e822a49df6795e1028a
2024-03-28 12:17:37 +00:00