Commit Graph

6239 Commits

Author SHA1 Message Date
Andrei.Kuznetsov
ddb58bd9e5 IJPL-158: Migrate (trivial) "community" tests to runInDumbMode/computeInDumbMode/runInDumbModeSynchronously
This commit removes usages of deprecated `DumbServiceImpl.setDumbMode` and replaces them with modern API.

GitOrigin-RevId: d3fa0e8eec04d7b10a0b98ff46c2f4bb5a8197b9
2023-08-21 21:51:19 +00:00
Egor.Eliseev
85f315a921 PY-61231 DeprecationWarning pkg resources is deprecated as an API
Use `importlib.metadata` for the new Python versions (>= 3.10).
Ignore `DeprecationWarning` for old versions of Python.


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

GitOrigin-RevId: a639ae84016a85d508484e31e48913543d4e51f1
2023-08-21 09:55:07 +00:00
Egor.Eliseev
130740bbf0 PY-61613 Turn on static code completion for Python Console by default
Change setting CheckBox to ComboBox

IJ-CR-110807

GitOrigin-RevId: 911407a78a5f444a81315dbca3e92d916b4abf30
2023-08-18 14:08:46 +00:00
Egor.Eliseev
c368c2f4f1 PY-48235 Add quoting policy for PyXCopyValueAction
IJ-CR-110671

GitOrigin-RevId: 768a88b91943de9dcab5c5023073c82c5f8c93d7
2023-08-18 12:11:01 +00:00
Egor Eliseev
edd05b77c0 PY-37668 Copy full value from Variable view
IJ-CR-110411

GitOrigin-RevId: f2daf5ff2aea1c94acf2e796db02efd121655a99
2023-08-17 17:02:52 +00:00
Mikhail Golubev
63d24cbb9d PY-34493 Enable back copying annotations from third-party .py files on Override/Implement
Since disabling turned out to be controversial. Even in the ticket some users were
against this decision claiming that it heavily annotated code bases it might be necessary
to retain all annotations from inherited method signatures. We need to think of a better
solution for controlling this behavior on case-to-case basis.

GitOrigin-RevId: c68763f0cad23de8975085e9bc8a6fd99013de3b
2023-08-09 20:53:35 +00:00
Mikhail Golubev
c7bba04743 PY-45588 Generalize PyOverrideImplementUtil.addImports to cover parameter defaults
GitOrigin-RevId: 828305e2a7449704c08503d8d68394d28ce98c83
2023-08-09 20:53:35 +00:00
Mikhail Golubev
a7a54e1152 PY-34493 Don't copy annotations from .pyi stubs and libraries on Override/Implement
GitOrigin-RevId: 7e40d4a520d46ad65a31ee5898af89ad870dc6c3
2023-08-09 20:53:35 +00:00
Mikhail Golubev
fbfaf24bc3 [python] Make PyOverrideTest work with the latest Python 3 by default
GitOrigin-RevId: fd44fa8ca8a0f3eed2b710a65225979569023d3f
2023-08-09 20:53:35 +00:00
Mikhail Golubev
250ee7e314 [python] Unify the test logic in PyOverrideTest
GitOrigin-RevId: 3e0d896c8e904996828364e1d29e1c39472f7e79
2023-08-09 20:53:35 +00:00
Mikhail Golubev
88da33b182 [python] Define a test data root for PyOverrideTest
GitOrigin-RevId: 0f77722768215515c5fd2b6c3fbd5c025bb902ba
2023-08-09 20:53:34 +00:00
Mikhail Golubev
69219902f3 [python] Reformat PyOverrideTest
GitOrigin-RevId: 7af5086bc76ca3dce99546d4e487b934849c9fe8
2023-08-09 20:53:34 +00:00
Ilya.Kazakevich
7bf11d3b6f Disable python2 for jupyter tests: jupyter can't be installed on py2
```
ERROR: No matching distribution found for comm>=0.1.3 (from ipywidgets->jupyter)
```

There is no 2.7 in the latest analysis

GitOrigin-RevId: 170b98f048b88a62d2695d375b780ee707e79330
2023-08-04 23:46:44 +00:00
Ilya.Kazakevich
2bb2ea60fc Various validation refactorings
`readableFs` is redundant and unstable. Remove it: we will migrate to ijent anyway.
All validations are in `PathValidator.kt` now. They are used by `ManualPathEntryDialog` and sdk validation.
Lots of thread annotations added to prevent calling validation code from EDT.

In general, this change makes path validation ready for ijent: validation based on nio with slow IO access.

Validation is removed from old, non-target classes

(cherry picked from commit 185b4f7fe8cbd5d7a37dad609c8a4cb8163d6eed)

IJ-MR-112281

GitOrigin-RevId: 12c4a4f3d459d0523ef6694a9e4bb2db7a1582b7
2023-08-04 13:42:38 +00:00
Vladimir Koshelev
7aeb74fe0a [PY-49040] add support for TypeGuards
Merge-request: IJ-MR-109904
Merged-by: Vladimir Koshelev <Vladimir.Koshelev@jetbrains.com>

GitOrigin-RevId: 8441ce35b2fc97fb0cdaf747feff2cf9ba3347ea
2023-08-02 22:27:54 +00:00
Sergey Karpov
c0842a6fde [pycharm] Squashed commits. PY-52478 Improve the names of quick fixes for "Unresolved references" and "Non-optimal list declaration"
(cherry picked from commit bce089714657aef8634ffb9c58da57fdb576b297)

IJ-CR-112218

GitOrigin-RevId: 8857c2951e44a1e9d0b54af1eb7c584f64fbc40d
2023-07-31 16:31:00 +00:00
Ilya.Kazakevich
edb8edf72c increase timeout
GitOrigin-RevId: cce7baeaeac8f43dcdd5ebf377a7ae96d6796b6e
2023-07-27 19:51:59 +00:00
Ilya.Kazakevich
de70549f24 Fix PySDKRule for tests: path should point to python binary
GitOrigin-RevId: 6d35027a039ebeb603e254d88cd5e826b406266b
2023-07-27 19:45:35 +00:00
Ilya.Kazakevich
bc39172e97 Synchronize access to console in tests
GitOrigin-RevId: 81b588591e858fb9e2dd30c1681d6664bbd1b254
2023-07-26 21:35:54 +00:00
Ilya.Kazakevich
66baa2f76a [python tests] experiments: pregenerate pyc, get rid of useless sleep
GitOrigin-RevId: ff9a258059aba45c28c62b2d370464e2bb500599
2023-07-25 23:12:31 +00:00
Egor.Eliseev
7dafb6bea5 PY-61304 Add searching in import elements in "conftest.py" file
In addition to searching for fixtures as functions in the "conftest.py" file, add also searching in import elements.


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

GitOrigin-RevId: fe2832b23db8b5fda461b1e07a129975b2dd57bf
2023-07-25 06:23:01 +00:00
andrey.matveev
213b82bde3 PY-54905 PY-54620 PY-61740 Fix goto declaration and implementation resolved pyi not py
PyDefinitionsSearch.java: replace psi element on original element if it is from pyi and then search for overrides, inheritors etc.

PyiUtil.java: recursively get original element while it is in stub (see the comment) and tests testGoToImplementationNameReExportedThroughAssignmentInPyiStub, testGoToImplementationNameReExportedThroughAssignmentInPyiStubTwice

PyUtil.java: make different methods turnDirIntoInitPy, turnDirIntoInitPyi instead of only turnDirIntoInit to handle cases when the same directory contains __init__.pyi and __init__.py files (PY-54620)

GitOrigin-RevId: 8f0d8a8133548e1a9f52f93b42aa9cae2302e8d7
2023-07-24 14:30:11 +00:00
andrey.matveev
272da294c3 PY-9045 Fix false positive cannot perform refactoring when execution flow is interrupted
Delete targets condition in createCodeFragment and filter duplicates

GitOrigin-RevId: 474f3634a06c9cff25bafc94e1651d4fe61fb2a0
2023-07-24 09:26:14 +00:00
Mikhail Golubev
07cdec4e06 PY-53599 Enable PyTensorFlowTest env test on TC
GitOrigin-RevId: 45b60ff82ee8f1f9ddad9bd9b7246e65914cf392
2023-07-20 19:36:11 +00:00
Mikhail Golubev
9b4bd066fa PY-53599 Simpler env smoke test for Tensorflow module structure
Namely, test only against the latest version of the library. Check completion
only for a few common submodules of tensorflow. Check resolve for all of them
in one inspection pass, instead of resolving each separately. Generate expected
test data dynamically through module introspection.

GitOrigin-RevId: df5c4c4f765116bc7329454d5cc0b2aa1a6a86b5
2023-07-20 19:36:11 +00:00
Egor.Eliseev
ebf5d71eef PY-35529 Use repr by default in Variables View
1. If `__repr__` is overridden - use `reprlib` or `repr()`
2. If `__str__` is overridden - use `str()`
3. Use `reprlib` or `repr()` otherwise

IJ-CR-110917

GitOrigin-RevId: dff583d556600a8c77024a4d1bd86034f24f9bf9
2023-07-18 08:33:05 +00:00
Ilya.Kazakevich
2326177bc4 Test timeout increased: slow agents
GitOrigin-RevId: 74d9c96801e763fac0afd77f0fe50d3f1c498181
2023-07-17 19:40:23 +00:00
Ilya.Kazakevich
04b6cbc043 Add python sdk rule to be used by package manager test
GitOrigin-RevId: 09ca999dc3e149b4c36c42e5475b4a6abc04b118
2023-07-16 21:56:04 +00:00
Mikhail Golubev
1a854fceb8 PY-55246 Enable back .pyi stubs bundled with numpy
We turned them off as part of PY-48166. Now these stubs are much more complete
and fix a number of problems with the code insight for the library (PY-35164,
PY-37461, PY-50394, PY-59347, PY-60224), most of which are caused by the lack
of information in skeletons automatically generated for its binary modules or
incorrect type information being extracted from docstrings.

I leave the possibility to disable the stubs for the time being and will remove
the registry option once it become clear that they don't cause serious problems.

GitOrigin-RevId: 0df09ddb8ca40f88b908e19c0f49f5b005abaa58
2023-07-14 14:00:34 +00:00
Semyon Kolton
56cb49bc82 CPP-20234 Remove accidental commit
GitOrigin-RevId: 8e4e3b8a08fefc1eddb3638aa4ba267626a146a8
2023-07-14 10:33:45 +00:00
Semyon Kolton
41aca6e6bb CPP-20234 Add a simple test
GitOrigin-RevId: 3304649bda678aa8c3e78760f365c7409ad79847
2023-07-13 15:59:58 +00:00
Egor.Eliseev
182d723e4e PY-61495 Fix PythonUnitTestingTest.testNonAsciiMessage
Add temporary code so that the tests are green until the bug is fixed in CPython


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

GitOrigin-RevId: 563660c4e2046d303a219765cd5f113608597149
2023-07-11 21:52:14 +00:00
Ilya.Kazakevich
114bc76994 Escape TC messages in tests.
TeamCity parses output and gets wild.

GitOrigin-RevId: f51c0c469438384c5810289babacc9a57e9d4c5d
2023-07-10 16:55:42 +00:00
Daniil Kalinin
2983980cbd PY-17193, PY-10709 enable Use parentheses instead of backslashes for breaking lines option by default
Change tests according to the new default value

GitOrigin-RevId: 79a09911127532fadcc4a4d37a454887d46effa9
2023-07-07 13:26:55 +00:00
Egor.Eliseev
ee913de2ce PY-61446 Fix PythonUnitTestingTest.testSkipInSetup
Add correct exit code handling for Python 3.12 if all tests were skipped.

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

GitOrigin-RevId: b08650425daba631bc488a9175752b21d51e6f98
2023-07-06 22:49:18 +00:00
Daniil Kalinin
afc89c5da2 PY-33261 Treat literal collections as literal argumets
GitOrigin-RevId: 9812e73bebcb7d089e8c7ed62a081a1219c55957
2023-07-05 19:08:15 +00:00
Ilya.Kazakevich
cd24dc9783 Increment timeout a little due to slow tests
GitOrigin-RevId: 66d619e8881d7f3b6a3d64fd781986c8d06b9556
2023-07-04 23:27:39 +00:00
Vladimir Koshelev
989f378988 PY-27708 support type inference of elements for set and dict type comprehensions
Merge-request: IJ-MR-109862
Merged-by: Vladimir Koshelev <Vladimir.Koshelev@jetbrains.com>

GitOrigin-RevId: 5be72a4bafbbe7dc942a8bb9afeaded45d0ec896
2023-07-04 23:18:10 +00:00
Tagir Valeev
00adcdf120 [model-branch] Remove ModelBranch tests
IDEA-309887 Drop ModelBranch-es from IntelliJ repo

GitOrigin-RevId: 362b2433ce92b95788d626c444b23e4efbf3e6c7
2023-07-04 08:28:43 +00:00
Vladislav Rassokhin
07011f5e32 [test framework] Drop TestRecorder and RecordExecution, not used for years
GitOrigin-RevId: e9e00ed70e0224c8db202b822a8e666e8aca8708
2023-07-03 18:31:01 +00:00
Ilya.Kazakevich
83c7af4abc Fix possible race condition in test.
`onTextAvailable` could be called from 2 threads: stderr and stdout, hence `stdAll` must be thread-safe

GitOrigin-RevId: fadf694621d15521221cadfef1d8c6f423a8608a
2023-07-01 14:43:08 +00:00
Ilya.Kazakevich
dda66f93b4 increase test timeout a little due to failures
GitOrigin-RevId: d5a12ca26ee74e8a163b37a2f1a80f2c7c41d140
2023-06-25 13:51:28 +00:00
Ilya.Kazakevich
6e182d2b9c Move conda tests to env, to run em on TC as PyEnvTest config
GitOrigin-RevId: 3cb7ef4d01c273dca381635be016cef16323358e
2023-06-23 21:56:34 +00:00
Ilya.Kazakevich
1b2f34b27b Conda test: increase timeout a little
Test is tool slow

GitOrigin-RevId: 3a1414aa6dc3a08ff42d5c36ae58b1eaf53a8394
2023-06-22 12:57:21 +00:00
Ilya.Kazakevich
9fe3d09e39 Fix conda test: unnamed envs can't be removed by name, use `-p` instead
GitOrigin-RevId: cccb99f79c0d0ffaac12be97ce3dc3542a6b70e8
2023-06-22 12:57:15 +00:00
Mikhail Golubev
58b27cca39 PY-61091 Select the most specific overload for binary operators
The rules for operators methods are the same as for regular
methods, exercised by other type checkers, i.e. it's assumed
that more specific overloads are defined earlier than less
specific. See e921654e47fe1fc5da047950b70775e342996757 for more
details.

Selecting compatible operator signatures also includes matching
"self" parameter against its expected type, which is necessary
for supporting typing.LiteralString, where some overloads of
"str" methods are made available only for literal strings.
Doing so, however, revealed a few issues with how we track
the direction of operator application, i.e. which operator
methods should be considered "reflected" and have swapped
receiver and argument. We rely on a method's name to decide
but the name is lost when a "reflected" method is defined through
an attribute assignment (PY-61093), and __eq__/__neq__ methods
are bidirectional so their names are not enough (PY-61090).

In PyUnresolvedReferencesInspectionTest.testStubAssignment we
matched C1.__mul__ and in PyTypeTest.testOperatorReturnsAny we
matched int.__eq__, despite the receiver and the argument being swapped,
because both of the methods are declared to accept Any value.
With more precise signature matching both of the tests now fail due to
the aforementioned issues. On the other hand, both of the cases seem rare,
so I disabled them for a while until there is a proper solution.

GitOrigin-RevId: 449a584ca258fe9210f5f2bda453caf9ab4faf7b
2023-06-21 16:32:22 +00:00
Lada Gagina
454b1287ae PY-58857 Infer typing.LiteralString for string literals
GitOrigin-RevId: 27507deabd61faedf7937415016f0f8334e5a418
2023-06-21 16:32:22 +00:00
Daniil Kalinin
157b23ce53 PY-33261 Inlay parameter hints for Python method and function calls
Merge-request: IJ-MR-108471
Merged-by: Daniil Kalinin <Daniil.Kalinin@jetbrains.com>

GitOrigin-RevId: 1d9451020a755c0aaf57c12b16829f8b31291e5d
2023-06-20 05:27:45 +00:00
Daniil Kalinin
eb2a834e65 PY-30190 Report unresolved class attributes in decorated classes
Previously, unresolved class attributes were not reported for the decorated classes because of potential dynamical attributes (see PY-7173). This commit enables this warning again because false-negative unresolved reference warning is much more common and distracting than the case with dynamic attributes

Merge-request: IJ-MR-105254
Merged-by: Daniil Kalinin <Daniil.Kalinin@jetbrains.com>

GitOrigin-RevId: 67d1ab3fe1d5a140836d49f8ef6a65cf01873456
2023-06-20 04:39:38 +00:00
Daniil Kalinin
62df4deaf4 PY-30757 Black formatter integration support for PyCharm
Merge-request: IJ-MR-107500
Merged-by: Daniil Kalinin <Daniil.Kalinin@jetbrains.com>

GitOrigin-RevId: f0e622057a9533d89d2d47b032b5388f8c991821
2023-06-18 23:11:33 +00:00