Commit Graph

6504 Commits

Author SHA1 Message Date
Ilya.Kazakevich
84f000f4a9 PyCharm: remove convert-to-conda test because this code was already removed.
All "vanilla" flavours were converted to conda long ago.

GitOrigin-RevId: 1c87c04a3def2d1c3c6d330b6d4be2c429c78854
2024-08-01 20:14:02 +00:00
Ilya.Kazakevich
8b8d3ec168 PyCharm conda test: compare paths, not strings as slashes might be changed in a workspace model
GitOrigin-RevId: 72e2cc58b0f7a416889967543caef96047ad676f
2024-08-01 20:14:02 +00:00
Vladimir Koshelev
313a8e3ba1 [pycharm] add a test for PY-73958
GitOrigin-RevId: 99ec4e104dd6e392e46dd47e7626089d56cfdddd
2024-08-01 12:25:31 +00:00
Andrey Lisin
638dce38d7 PY-71930 Restore reStructuredText plugin
This commit partially reverts changes from 4da3e7da. While the consolidation of reStructuredText support into a single module is retained, it needs to be available as a plugin since some IDEs do not include it by default but can still benefit from its capabilities.


Merge-request: IJ-MR-139650
Merged-by: Andrey Lisin <andrey.lisin@jetbrains.com>

GitOrigin-RevId: bc5cde2970a0760e32ceaee61ceef8427e8f8fe5
2024-07-31 12:47:03 +00:00
Ilya.Kazakevich
e75a7f2f83 Python tests: migrate tox 37->39 (37 is outdated)
GitOrigin-RevId: 8592221541a2a7512d559184bd352dabef5b657c
2024-07-31 10:18:57 +00:00
Ilya.Kazakevich
ccd804fe9c Python tests: migrate tox 37->39 (37 is outdated)
GitOrigin-RevId: 1d8588f3785940c1cbe4036c8a475853f19a79c5
2024-07-31 08:20:14 +00:00
Petr
93b9066edf PY-34617 Support version check
GitOrigin-RevId: 3318ff79cdcc5ba0ce5e4feb65abad5ad0f4acfa
2024-07-28 00:24:15 +00:00
Egor Eliseev
994775243f PY-71926 Refine test detection criteria
Add a new setting Python Integrated Tools: Detect tests in Jupyter Notebooks.
Exclude Jupyter Notebook files from the scope for test detection by default.
Add tests


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

GitOrigin-RevId: 0bee082bde4fa608cb1907b8fbd64b97bb9755a0
2024-07-26 17:24:30 +00:00
Ilya.Kazakevich
154a516ad3 PyCharm: Support conda in JUnit5 tests.
Mark test with `PyEnvTestWithConda` or use `testFixture`

GitOrigin-RevId: 3171d8a4de18ca29a1c624dcffa53921965eed25
2024-07-26 04:03:03 +00:00
Petr
5470f70382 PY-73886 PyArgumentListInspection causes file parsing
GitOrigin-RevId: 8fa6b52a2ac5d28e7148c3e10445ee61fef6c89b
2024-07-25 01:35:16 +00:00
Mikhail Golubev
f392777e01 PY-44858 Create regular packages in refactorings initiated from top-level files in source/content roots
Otherwise, if someone wants to move a definition/extract a superclass from there to
a brand-new package, e.g. from main.py to pkg/mod.py, a namespace "pkg" package will
be created.

Restore the original behavior of PyExtractSuperclassTest.testMultifileNew: the origin
file was inside a regular project root without __init__.py alongside.

GitOrigin-RevId: 750414b18582740076c14bfcfd07fa38992b4428
2024-07-24 16:18:40 +00:00
Mikhail Golubev
1c026ac470 PY-44858 Make multifile scenarios comparing directory content in PyExtractSuperclassTests more uniform
Now they all just compare the resulting test project content with an explicit "after" directory
instead of checking individual files in the test code.

GitOrigin-RevId: cff00d0a6b8ea4547b719997716e95a3f7c62cc9
2024-07-24 16:18:40 +00:00
maxle
90bbc21f3f PY-44858 Move and other refactorings don't introduce __init__.py inside namespace packages
Namely, Move Module Members, Extract Superclass and Make Local Function Top-Level were
all affected by this.
Now we check if the refactoring origin is inside a namespace package to decide whether
__init__.py should be generated for target directories.

Co-authored-by: Kamalia <alishevakamalia@gmail.com>
Co-authored-by: Maksim.Levitskii <maksim.levitskii@jetbrains.com>

GitOrigin-RevId: b0b3420c5ec8d1f7d3000d8834211631690a0c42
2024-07-24 16:18:40 +00:00
Ilya.Kazakevich
9d7bc20e6b PyCharm: change WARN to INFO for spammy messages to decrease noise level
GitOrigin-RevId: 6d4ccc81b3ff8b17d75c6ab3d580afaa616d7c48
2024-07-24 05:38:47 +00:00
Ilya.Kazakevich
06d28837eb Pycharm: Only use Py3 Conda in JUnit5 tests.
No need to test against Py2 in 2024, and conda is a different beast and should be tested separatelly, so we use tags to filter "wrong" pythons. See `api.kt`

GitOrigin-RevId: 2f47f5aca3c8cd9d12684e425796aedaee5d239f
2024-07-23 21:34:16 +00:00
Ilya.Kazakevich
2579567d1c Pycharm: Create fixture for SDK on JUnit5
GitOrigin-RevId: 7bba4bb3070c255d11c117b89021475c5f20103a
2024-07-23 18:57:29 +00:00
Nikita Kudrin
cdf91bf213 [benchmarks] Renaming PerformanceTest* => Benchmark*
GitOrigin-RevId: 9963b84d51e1062acc262a8d3d3de1409a708e3b
2024-07-23 18:20:01 +00:00
Egor.Eliseev
0be08ded36 [python] Rewrite PythonHelpersLocator
1. `PythonHelpersLocator` is an API to get helpers. It is aware of PyCharm Community helpers but also aware of some EP that provides additional helper paths.
2. EP implementations for PyCharm Prof and Jupyter that provide additional (prof) helpers.
It will help avoid problems with which Locator to use from Professional, Community or Jupiter plugins.


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

GitOrigin-RevId: c7c34f323247002699866f12f6ff5a08cf6a18ff
2024-07-23 12:04:22 +00:00
Andrey Vokin
e6c66dfd5e PY-74012 Deprecation decorator stub resolves during indexing
Avoid using resolve when calculating deprecation messages

GitOrigin-RevId: 813849bdaeb3819b445db600fc0efbcb014ed5c9
2024-07-19 19:18:54 +00:00
Vladimir Koshelev
6a08992395 [pycharm] PY-71726 add initial support for TypeIs
GitOrigin-RevId: ae3d5d7c88450bf2851fa1dabbf264f7206d347a
2024-07-19 12:45:50 +00:00
Vladimir Koshelev
86421462bb [pycharm] fix overloads processing performance tests
GitOrigin-RevId: a7d8d1cf3044cd6ebe22b343c18733667dcb75dd
2024-07-19 12:45:50 +00:00
Vladimir Koshelev
a40425e28a [pycharm] prevent propagation of PyNarrowedType
GitOrigin-RevId: fdfd8e7563f36768b050efbf5ed8f259db994afd
2024-07-19 12:45:50 +00:00
chbndrhnns
c274285cae PY-66043: Resolve module references in PYTEST_PLUGINS
close #2814


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

GitOrigin-RevId: 4a7d46178ceedc283345980f118fbe607d84e685
2024-07-17 15:38:34 +00:00
Daniil Kalinin
e9a6246df3 PY-72185 Implement incremental parsing for PSI leaves for Python
Merge-request: IJ-MR-138193
Merged-by: Daniil Kalinin <Daniil.Kalinin@jetbrains.com>

GitOrigin-RevId: 7d004677a5b7a4637ea956f13ed85abc0d88604e
2024-07-17 12:15:36 +00:00
Ilya.Kazakevich
fa524aa80a Python JUnit5 tests: move all tests to junit5Tests because TestApplication doesn't support TestSuite (yet).
See `package-info.java` for the layour info.

GitOrigin-RevId: b1e00b8aec41042282405b5ee2e96fb8b09017a4
2024-07-15 21:33:23 +00:00
Vladimir Koshelev
82e8947e95 [pycharm] move type guards from control flow to PyDefUse stage
GitOrigin-RevId: e66971e619978ad179bb49a15820a7482b27df7c
2024-07-15 18:43:02 +00:00
Bart van Helvert
40585d1a25 [mod-command] Change modal progress bar to NBRA when computing chooser presentation
#IJPL-158175

GitOrigin-RevId: 0681313cfeeb3df0c6dbb2bf5194e392c96fa714
2024-07-15 02:34:03 +00:00
Ilya Muradyan
0f2ceb1d0a PY-64586, PY-73739, PY-73825: Move jupyter support for python to the Python plugin and DataSpell plugin instead of creating dedicated plugin
GitOrigin-RevId: 7d7ef5dc7285bfdc797e1d763254f854ab66b78c
2024-07-12 21:36:25 +00:00
Ilya.Kazakevich
c3f31ae2df Add test that creates python SDK
GitOrigin-RevId: c2638e97ce4d9177c2209dd3bd468093ba48b0c2
2024-07-12 19:18:13 +00:00
Ilya.Kazakevich
4e9344ce5d JUnit5 extension for Python env tests.
We now have machinery to find python environments created by
a Gradle script.

This patch adds JUnit5 extension along with an annotation to use it.

See `com.jetbrains.python.junit5.env.showCase`

GitOrigin-RevId: 287608104ec3f2c43c44906f15a06aa86a6f1bd4
2024-07-12 19:18:13 +00:00
Vladimir Koshelev
d649ae4e61 [pycharm] add un-reachability support to PyUnboundLocalVariableInspection
GitOrigin-RevId: ea1125977ea8b4de370973d606cc5ba7b258dd82
2024-07-10 14:22:00 +00:00
Vladimir Koshelev
2625d2472b [pycharm] remove NoReturn logic from control flow builder
GitOrigin-RevId: 85ba28fd8b86fe0b6337703798a0b869bb793e88
2024-07-10 14:22:00 +00:00
Petr
a6fc2c09c6 PY-53693 PyCharm adds _: KW_ONLY to dataclass' init signature
GitOrigin-RevId: 471e10b4e12a36a640da2f3006719372797b5cf1
2024-07-08 17:53:13 +00:00
Daniil Kalinin
06d8a78b34 PY-33425 fix pep8 warnings were still shown after suppressing with # noinspection PyPep8
GitOrigin-RevId: 738ab906f4026f8f64a3b1f7185ba8a5add9fe40
2024-07-05 13:26:02 +00:00
Mikhail Golubev
eb63148798 PY-73246 Don't insert square brackets after classes not having free type parameters
Even if they transitively extend typing.Generic, such as the builtin str.

GitOrigin-RevId: 9389ef5846e21ba5e0fed8b835beb2d458e42f13
2024-07-02 14:08:48 +00:00
Mikhail Golubev
1a3e6c2a64 PY-73246 Automatically insert square brackets on completion of parameterized types
GitOrigin-RevId: 5e81bc984fa3c7b4f83c564c85d872c5a49cf391
2024-07-02 14:08:48 +00:00
Mikhail Golubev
52850e21d8 PY-62208 Include importable names in basic completion results
Previously, such names were visible only on so-called "extended" completion,
activated when the hotkey for the basic completion was hit twice. The main reason
was that collecting such variants from indexes was a slow process, and we
didn't want to harm the responsiveness of completion for basic names.
Now it becomes possible thanks to a number of performance optimizations:

* Instead of using three separate indexes for classes, functions and variables,
we use one -- PyExportedModuleAttributeIndex. By definition, it includes only top-level
"importable" names, so we additionally save time by not filtering out irrelevant
entries. Also, it doesn't contain private definitions starting with an underscore.
It might bother some users, but given that the previous completion was used
extremely rarely, and the new one is going to be visible everywhere, it seems
that pruning unlikely entries as much as possible is a fare tradeoff. In the future,
we might enable them back on the "extended" completion if there is a demand.
Also, this index binds its keys to the project (`traceKeyHashToVirtualFileMapping`),
further eliminating useless index lookups.

* Thanks to the recent fixes in the platform (IJPL-265), it's now possible to
simultaneously iterate over all keys in an index and request values for a given key
without deadlocks, which is much faster than eagerly fetching all keys first.

* While scanning through all matching entries from indexes, we terminate
the lookup if the number of items exceeds the size of the lookup list.
We can further reduce this number by adjusting the "ide.completion.variant.limit"
registry value.

* Calculating expensive "canonical" import paths (e.g. "pkg.private.Name" is importable as
"pkg.Name") is offloaded to a background thread thanks to the `withExpensiveRenderer` API.
We still calculate these paths synchronously, though, for names whose raw qualified names
contain components starting with an underscore to decide whether these private names are
publicly re-exported and, hence, should be displayed.

The rest of the work has been put into reducing the number of entries on the list, e.g.

* The prefix under caret is now matched from the beginning of a name, e.g. `Bar<caret>`
matches `BarBaz`, but not `FooBar`.
* We don't suggest imported names clashing with those already available in scope.
* Some kinds of definitions are not suggested in specific contexts, e.g.
functions and variables are not suggested inside patterns and type hints.
* Nothing is suggested at the top-level of a class body, where dangling
reference expressions or calls are not normally expected.

Additionally, we don't suggest names from .pyi stubs at the moment, because
it pollutes the suggestion list with entries coming from the stubs for
third-party packages in Typeshed. We should probably enable them back once
we are able to properly disable Typeshed entries for not installed packages.

Some legacy forms of completion are left in the extended mode. In particular,
qualified names of classes are offered inside string literals only in this mode.
Also, module and package names are suggested only in the extended mode, because
top-level packages and modules are already suggested for the basic completion
by PyModuleNameCompletionContributor.

A few tests in PyClassNameCompletionTest were updated or removed entirely because
* we no longer suggest private names
* we no longer suggest names from private modules not re-exported in a public module
* we no longer suggest names clashing with those already available in scope
* prefix matching policy was changed to start at the beginning of an identifier

The whole feature can be disabled with the option "Suggest importable classes,
functions and variables in basic completion" in settings.

GitOrigin-RevId: 0787d42ce337b73b01a60f0bb7aa434fee43e659
2024-07-02 14:08:48 +00:00
Daniil Kalinin
ab346dc761 PY-58497 add test on expand/collapse behaviour of Parameter Info window in Python
GitOrigin-RevId: e94b034d97fec61966e76dd6c2d6aef2b1eec393
2024-07-02 09:57:32 +00:00
Daniil Kalinin
29c93a526c PY-58497 Adapt PyParameterInfoTest and PythonConsoleTest to the new Parameter Info implementation
GitOrigin-RevId: 24cdf19e88d98e93cd8c0814b4d040ec88405623
2024-07-02 09:57:32 +00:00
Daniil Kalinin
d47bd34358 PY-58497 Refactor parameter info logic for Python
Show type hints only for the highlighted parameter

GitOrigin-RevId: f55d8ecc27dcbca5e6c24c5ca347ea3995e69ca8
2024-07-02 09:57:32 +00:00
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