Commit Graph

27948 Commits

Author SHA1 Message Date
Mikhail Golubev
a9a8ab00ef PY-60738 Resolve to the bundled Typeshed and python-skeletons, ignore their copies
This is a followup for DS-4508. The issue was caused by the fact
that intellij.python.helpers content is copied using NIO, and to make
it visible for VFS we need to perform refresh of the latter.
Without it, PyTypeShed.directory property cannot find the Typeshed
root and is initialized to null. Then, PythonSdkUpdater.buildSdkPaths
is unable to locate SDK-specific Typeshed roots and set the corresponding
interpreter paths on SDK update. The problem is that VFS refresh requires
a write action and PyTypeShed.directory is accessed under a read action
(e.g. via PyTypeShed.INSTANCE.isInside in PythonLanguageLevelPusher), so
performing an explicit refresh would cause a deadlock (not to mention
that copying files under a read action is generally concerning).

The easiest way to address that is just to resolve to these stubs directly
inside the distribution, as before, not triggering copying them. Such stub
files are not executable by the interpreter and, thus, don't cause the problems
with .pyc files corrupting the IDE installation, so it's safe to leave them
there.

For the time being, Typeshed and python-skeletons are still copied together
with executable helpers, though, but these copies are effectively ignored by
code analysis, It's only not to break the implicit contract of
PythonHelpersLocator.getHelpersRoot, from which it's expected that the entire
content of intellij.python.helpers would reside in the returned directory.
A proper solution would be to move all type hinting stubs from
intellij.python.helpers to a dedicated module, excluded from copying,
but it needs to be further discussed and is risky right before the release.

GitOrigin-RevId: 2470cc110faa8286c44be2102aacc48893ea7ea9
2023-06-30 01:18:56 +00:00
Mikhail Golubev
64899bcc8c PY-46445 Don't insert "import pkg as pkg" on "Install and import package 'pkg'"
GitOrigin-RevId: fc71ad0d7a5e343924850e748570da66792319de
2023-06-30 00:49:45 +00:00
Aydar Mukhametzyanov
061f966ff0 Rid of unnecessary duplicating unscale methods in UnscaledGaps
GitOrigin-RevId: b904abb8205fc95d548946a77835e987fd24f7e8
2023-06-29 21:43:07 +00:00
Natalia.Murycheva
b12b3d7490 DS-5241 Wrapped collecting statistics with runCatching to avoid breaking tables showing.
Added more types in tests. Added check that we exclude only complex types

Merge-request: IJ-MR-109541
Merged-by: Natalia Murycheva <natalia.murycheva@jetbrains.com>

GitOrigin-RevId: 9620771c0619b67c3498a7687584ee907df882f6
2023-06-27 17:50:53 +00:00
Natalia.Murycheva
f88d466ccb DS-5197 Fixed tooltip for data frames with many columns.
Improved data handling to prevent loss of information caused by automatic folding when processing large data frames. 
Added new tests for get_column_describe and get_value_counts methods. 
Exclude complex data types from statistics in a tooltip

Wrapped parsing statistics with runCatching to avoid any exceptions. These additional calculations and probable exceptions can prevent tables from showing.


Merge-request: IJ-MR-108989
Merged-by: Natalia Murycheva <natalia.murycheva@jetbrains.com>

GitOrigin-RevId: fb41c530e3eac79be42338dafc02da047826de71
2023-06-27 10:51:53 +00:00
Daniil Kalinin
7c69977dec Black exception hotfix
GitOrigin-RevId: bdf873a7c02b2b26717c3c6c27124a65279651d3
2023-06-27 00:17:09 +00:00
Daniil Kalinin
d1af21db42 Enable Black formatter integration by default
GitOrigin-RevId: b58439a60427e409c825be47c8427ff3ca10697f
2023-06-25 17:34:59 +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
437cca5fd6 link/add-conda-to-py-tests
Add conda to Dockerfile for PyEnvTests

Tests in ``com.jetbrains.env.python.conda`` require conda to run. Lets run them at Linux env tests at least

Move conda tests to env, to run em on TC as PyEnvTest config

Merge-request: IJ-MR-109305
Merged-by: Ilya Kazakevich <ilya.kazakevich@jetbrains.com>

GitOrigin-RevId: e3640a71ef334033eb5dd4c008fec91b5c73de33
2023-06-23 23:17:43 +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
Vladimir Lagunov
b87277a346 DS-5220 PythonExecution.buildTargetedCommandLine can work without sdk
The function is still convenient and useful even without SDK.

GitOrigin-RevId: 74ec152fa833eb64a5fd25a59f447c05d990d8a8
2023-06-23 17:26:03 +00:00
Vladimir Lagunov
4803866291 DS-5220 Ability to remove an argument in PythonExecution.parameters
The most expected way would be changing the type of parameters:
```kotlin
val parameters: MutableList<TargetEnvironmentFunction<String>> = mutableListOf()
```

However, such change would break a plugin, which seems to be quite popular, despite the fact that it uses @Experimental API.

See also a similar change fcefe89536d4c310503d4b6666aec7ab76df5132

GitOrigin-RevId: 2bc7096ff54ab5e8cdf64779f2438a1ea89f86d3
2023-06-23 17:26:01 +00:00
Vladimir Lagunov
b62554fb01 DS-5220 PySdkComboBox extends ComboBox<Sdk?>
Despite former absence of the nullability parameter, every combo box may have `null` as the selected item.

This commit brings no changes in logic, but allows to use nullable properties from UI DSL with PySkkComboBox.

GitOrigin-RevId: d635beb217ed07e5f0ba61714e29a64d0b217f49
2023-06-23 17:26:00 +00:00
Andrey Lisin
2bb3ba471c Cleanup: remove unused imports
GitOrigin-RevId: fc896e54981c98f4eaa5dd7a774cf113edad4351
2023-06-23 12:46:46 +00:00
Ivan Donchevskii
f79af9986a [pycharm] Move CompileQrcDialog.form string to QtBundle
It was left in PyBundle but should now be in QtBundle to work correctly.

GitOrigin-RevId: 3fadd0bcd8d7e3f207d771a468ba1fdab11743ae
2023-06-23 11:39:29 +00:00
Daniil Kalinin
2654749a76 PY-58887 add explanatory commentary about pyproject.toml for Black cli options text field
GitOrigin-RevId: d014f05bcb20933335b905da3462f954c8bec8fb
2023-06-23 10:48:36 +00:00
Andrey Lisin
49a4c3a7f4 Bump Python 3.12 version for PyCharm test and debugger binaries build environments
GitOrigin-RevId: 999d484026c6e045623a65c0747c0559849ba4f7
2023-06-23 10:21:50 +00:00
Daniil Kalinin
601f74f216 Improve user-visible text for Python inlay parameter hints
Merge-request: IJ-MR-109113
Merged-by: Daniil Kalinin <Daniil.Kalinin@jetbrains.com>

GitOrigin-RevId: 8e34eeb47e4c664e8adf46d7093fafc606d486e0
2023-06-22 16:59:25 +00:00
Ilya.Kazakevich
2df4c7d880 PY-60180: No python 3.11 in dropdown for conda
GitOrigin-RevId: e411e5abb8e3e8498ef2a89ae108bf29f85ed685
2023-06-22 12:57:24 +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
158bce8d40 Conda: add `runCatching` which was removed accidentally by prev. commit by external user
GitOrigin-RevId: 9ab5c2122f893e3c6c5b2d9b14ac1f4deec5c5f1
2023-06-22 12:57:18 +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
1396516d3f PY-58857 Fix PyPandasSeriesToListInspection to treat LiteralString types the same as str types
GitOrigin-RevId: f56b5e6f4d9186d157746c735958aebf04c902b1
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
Mikhail Golubev
27b0c0b1c6 PY-60959 Restart code analysis after an SDK update even if introspection has failed
The reasoning is that if an interpreter can't be successfully updated, it's better
to fail fast, clearly indicating the current state of resolve, rather that confuse
a user by invisible errors. It might go the other way around, e.g. the update has
been mostly completed before an error occurred, but we still show unresolved references
in the editor, even though all the remote sources and skeletons are already available
for code insight.

In this particular case, a runtime SftpChannelException, caused by an attempt to copy
a file with an illegal name, made highlighting go stale and still report unresolved
imports until the IDE was restarted.

GitOrigin-RevId: dd4258650602b66d9e897c4a5f11e92076d1285a
2023-06-21 12:22:49 +00:00
Mikhail Golubev
e068d21ee6 [python] Specify Python 2-compatible virtualenv for tox to test Python helpers
GitOrigin-RevId: f6badc7658a3ed5c769572c24b691b49389ecaca
2023-06-21 12:22:49 +00:00
Mikhail Golubev
62f9016792 PY-60959 During skeleton generation skip module attributes with illegal names
Otherwise, we end up generating syntactically invalid skeletons or, if
a large module gets transformed into a package where each class stub is
declared in its own file with the same name, some of the class names might
be illegal even for the target file system.

In this particular issue, the "shyft" package declared a class named
"ComputeNodeInfoVectorA strongly typed list of ComputeNodeInfo as returned
from the dstm server\012", which couldn't be copied to a Windows host from
a Linux remote.

GitOrigin-RevId: f9fc4626b67f5992a4781dd7b84acf8cef476e98
2023-06-21 12:22:48 +00:00
Vladimir Lagunov
a277ed82d3 PY-60971 Create new API in PythonHelpersLocator that alerts about I/O
The deprecated `PythonHelpersLocator.getHelperPath` used to be cheap and had no I/O, but since bd5183320a43878de861fd11ae1f9bf79710290a it may start to copy many files to another directory. It becomes dangerous to call it from EDT.

GitOrigin-RevId: 98a913e68671b38299791fde7f267a396bd4faa0
2023-06-21 10:35:21 +00:00
Vladimir Lagunov
c67b9317a0 PY-60971 Don't cache Python helpers in system path for snapshot builds
GitOrigin-RevId: d1413d1224c727d67904ebe3abbd67ebdac21a5d
2023-06-21 10:35:21 +00:00
Vladimir Lagunov
4fba990118 PY-60971 Copy Python helpers within progress indicator
Previously, methods PythonHelpersLocator.getHelpersRoot and PythonHelpersLocator.getHelpersProRoot were trivial and had no I/O inside. The things changed in bd5183320a43878de861fd11ae1f9bf79710290a, and it became dangerous to call potentially long operations within locks.

The helpers are used by Code Inside inspections, so it's impossible to move all executions of these functions out of read locks. So, the functions now checks the global progress indicator in order to hold read actions as little as possible.

Also, a logging message is added when calling these functions from EDT. It's not a hard assertion: code that used to work keeps working, but errors about threading are reported now.

GitOrigin-RevId: ae39a6ba6e91a01d2410ede859a0accfb312d758
2023-06-21 10:35:21 +00:00
Vladimir Lagunov
cc0a4820ca PY-60971 Reduce size of copied Python helpers
Previously, PyCharm copied the parent of the helpers' directory. It contained python.jar which has size about 60 MiB and which is not used as a helper.

GitOrigin-RevId: d9cec6ddb93a36dc349af511fbb96221cdb5d951
2023-06-21 10:35:21 +00:00
Vladimir Lagunov
9560dba2ec PY-60971 Copy Python helpers not on every start
Python helpers take more than 50 MiB, and copying it lazily on every startup can bring unnecessary performance problems on slow machines.

There's a better approach: copying the helpers into idea.system.path once per installation.

GitOrigin-RevId: 33bcf4eb61463d03480c985014d9e503f94638db
2023-06-21 10:35:20 +00:00
Ivan.Povetkin
5bba90e935 IJI-1079: Running copySkeletons in the corresponded step
Merge-request: IJ-MR-108698
Merged-by: Ivan Povetkin <Ivan.Povetkin@jetbrains.com>

GitOrigin-RevId: 6d73cbc01980bac86a92f9f735baaace240847b5
2023-06-20 19:51:26 +00:00
Andrey.Matveev
070220ef3d [llm-pycharm] Impl isNameAlreadyUsed for python
GitOrigin-RevId: 280d59e11b6dcddccf1e806d5153a38ae1572e36
2023-06-20 10:44:50 +00:00
Mikhail Golubev
4f19c9154d PY-60592 Don't build skeletons for extra modules that are not under their parent binary's FQN
Otherwise, we end up generating hundreds of duplicate skeletons for non-physical
(lacking __file__) sys.modules entries that are either
- some internal modules shared by multiple unrelated binaries, like _cython_runtime,
and not intended to be imported by their users
- added by this binary's dependencies, such as torch._C imported by extension modules
of many packages depending on PyTorch
- synthetic entities added by pure Python modules (typing.io, typing.re, six.moves)

GitOrigin-RevId: 575f96b1d5f72c5159eac8a6a368806f34d9734e
2023-06-20 10:21:55 +00:00
Mikhail Mazurkevich
61d59980f2 Revert "[Workspace Model] Migrate VersionedStorageChange to sequence instead of the list"
This reverts commit 0f6cdb7a.

GitOrigin-RevId: cfdc2a5bd56d291bf7f99256e9bcf279b1251c8c
2023-06-20 09:50:03 +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
Aleksei Kniazev
2180aa6230 [python] support python dependencies in pyproject.toml (PY-59844)
- completion for package names in `dependencies` and `install-requires`
- completion for build-backends
- if a package is not installed, provide a quickfix to install it / run `pip install -e .`

GitOrigin-RevId: cad88e4058a45f6db717b8da8fd7f6c456008998
2023-06-20 04:18:25 +00:00
TeamCity
463abfa4aa product version minor updated to 3 for PyCharm
GitOrigin-RevId: 7c2be90d88119ec5a1e75c37fc8c1f7d68b0ef56
2023-06-20 03:38:49 +00:00
Aleksei Kniazev
8efb6eb802 [python] replace SemVer with PyPackageVersion for python packages (PY-48046)
GitOrigin-RevId: fbad3ebdc68904d825ab112b97d3627dd7e448a5
2023-06-19 12:58:39 +00:00
Aleksei Kniazev
7340844d7e [python] added links to update packages to the latest version from Python Packages toolwindow (PY-48046)
GitOrigin-RevId: 2e09b8d9ba125014573f94a260de29e95b1bc497
2023-06-19 12:58:39 +00:00
Aleksei Kniazev
56b01e89b1 [python] added link to install python package directly from package table (PY-49130)
GitOrigin-RevId: bcbb3b3fc7c485ea999fd326576f78cd26c3938c
2023-06-19 12:58:39 +00:00
Alex Plate
15d01811d0 [Workspace Model] [IDEA-320676] Move several WorkspaceListener to the new module
GitOrigin-RevId: 11b538f3488b1fa1fd5501bc228c0516c4e384d3
2023-06-19 09:35:24 +00:00
Alex Plate
0ea27da5c6 [Workspace Model] [IDEA-320676] Move all packages from workspaceModel to workspace folder
GitOrigin-RevId: b70062397efd6347c34431c24aacd2ec2e216897
2023-06-19 09:35:12 +00:00
Alex Plate
acde44da72 [Workspace Model] [IDEA-320676] Rename jps module of workspace model
GitOrigin-RevId: 146fda1ce8b8e436eb48070e8cf96f2c654ea6a2
2023-06-19 09:35:11 +00:00
Alex Plate
e18c7d8a5f [Workspace Model] Move sources of the storage under workspace package
GitOrigin-RevId: 013ce64337fe7b3637d731c1093a2337bbe71f22
2023-06-19 09:35:08 +00:00
Alex Plate
bfd595ae86 [Workspace Model] [IDEA-320676] Rename package of jps model (ModuleEntity and other related entities)
GitOrigin-RevId: 102135a4f66c4a12c9b1f95035b1607cb933825d
2023-06-19 09:35:04 +00:00
Alex Plate
ae72bfb1d9 [Workspace Model] [IDEA-320676] Move ModuleEntity and friends to other module without changing the package
GitOrigin-RevId: 2f92e16012b84d5c4505c55a887df3623b460a0b
2023-06-19 09:35:02 +00:00