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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
- 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