Do not iterate over all files in a directory. Because PythonSdkPathCache defined by SDK and SDK can be found by a directory
GitOrigin-RevId: 9575e24b9c38a3203f387e8aaea32ab28507be4c
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
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
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
See https://docs.python.org/3/reference/simple_stmts.html#the-raise-statement.
I decided not to update the inspection description, because BaseException is not
intended to be inherited by user classes.
The check for Exception was removed because Exception itself extends BaseException.
GitOrigin-RevId: 5782c9351aebb524c4d0fc0c9f3307d8db682efb
I've add-hoc updated typing_extensions.pyi in the bundled Typeshed to
recognize Unpack there.
GitOrigin-RevId: 953402e42984712a630c1772cf2f2cd4cbacdccf
Since pip [normalizes](https://github.com/pypa/packaging-problems/issues/230) underscores to dashes, PyCharm should treat them equally for requirements.txt entries
GitOrigin-RevId: 62149b9c64c67936f1405c7bf282a288e8d52764
These changes make PyStatementList elements (which are function and class bodies, cycle bodies, if-else branches, etc.) lazy-parseable which means they can now be reparsed without reparsing the whole file if changes are happened inside them accepted as safe
The main reason behind these changes is to improve performance
GitOrigin-RevId: 892acbe0c95fde6aec74b7595b0a58f902c426f5
Some remote interpreters have `sdk#homePath` starting with `ssh://`.
Code all over the monorepo assumes that `homePath` is a local file path and tries to convert it to `Path` throwing the exception effectively.
There is a `isCustomPythonSdkHomePath` which must be used to check string before trying to convert it into `Path`
The current situation (along with "solution") is a legacy from dark ages and will be rewritten to the workspace model soon
GitOrigin-RevId: 9adc02f312667571a65ff63d4e802aa7d6dbb518
In other words, in a statement like "await = 42" there are now both a warning about
the missing operand and a warning that an await expression cannot be used as
an assignment target. This behavior is consistent with other expressions where
additional parsing errors are not special-cased.
GitOrigin-RevId: 37a68eacc7ec042435c185f9ddd8bc2eea42b40f
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
Otherwise, incomplete stubs break our custom logic for resolving tensorflow
modules re-exported from its _api.v2 subpackage, such as tensorflow.audio,
tensorflow.image, tensorflow.random, etc.
We did the same for Numpy stubs in the past, enabling them back once they
became mature enough.
GitOrigin-RevId: b1e46067406a592761f56b7d296a287e5282b079
Use PyTypingTypeProvider.getAnnotationValue for that, similarly to already
re-used in other places PyTypingTypeProvider.getReturnTypeAnnotation.
Also, I've better separated handling of attributes explicitly annotated with Mapped
and just initialized with a mapped_column call. It will help to remove special
casing for Mapped once generic descriptors are fully supported in type inference
(PY-26184).
GitOrigin-RevId: eaeb66abd26b851507970b112360631704b41db3