Commit Graph

1964 Commits

Author SHA1 Message Date
Aleksandr.Govenko
9263d8e6f2 PY-79910 Variable incorrectly marked as unused or redeclared without usage in nested try/if blocks
When there is no `finally` in try-except statement, use transparent exit instruction to tie all normal exits from try-, else- and except- parts to the next instruction


Merge-request: IJ-MR-158265
Merged-by: Aleksandr Govenko <aleksandr.govenko@jetbrains.com>

(cherry picked from commit 734581b732a1a558b72811fdda977c470d045cc9)

IJ-MR-158265

GitOrigin-RevId: d3ca0e258fcbd71f014245f05e954c95a3c2a0ca
2025-05-14 17:50:23 +00:00
Aleksandr.Govenko
d8f57b77c6 PY-80524 Explicit return statement expected false positive for an if inside try / except
(cherry picked from commit 6877fc7b34622d7ae884233af96e06ea92c918c1)

IJ-MR-161824

GitOrigin-RevId: 8c3219ea8bb8f547f7c314af8cb0d432c042cd7c
2025-05-11 22:28:24 +00:00
Aleksandr.Govenko
a8934362ff Rename .java to .kt
PY-80524


(cherry picked from commit 4693b9762d778b7816bab73a3e24a9b934954559)

IJ-MR-161824

GitOrigin-RevId: 94e27715d8d6b3beb4d126112e5bf030ffc16f6b
2025-05-11 22:28:24 +00:00
Aleksandr.Govenko
7413b91db8 Rename .java to .kt
PY-80524


(cherry picked from commit b9e0ea17589e9124d4004fa147fab345c77f6f15)

IJ-MR-161824

GitOrigin-RevId: eff1243abd48f5e0785b6ecb97d88ec94652b26f
2025-05-11 22:28:23 +00:00
Mikhail Golubev
004fee8632 PY-80844 Disable the intention for converting f-strings into t-strings in Python < 3.14
(cherry picked from commit 97162fca82d36958d61641c56315295329018304)

GitOrigin-RevId: bd8a473ec0c175b8c5fdb49feec919c944777e81
2025-05-09 11:12:01 +00:00
Mikhail Golubev
f13659e3d5 PY-80850 Add support for Template strings as arguments of positional and keyword varargs
(cherry picked from commit a51c198623553ee9f0975c2b3bf7af0c86c88b7a)

GitOrigin-RevId: 72fbe0ba4137e2f02236979bbd84440ca7616c6a
2025-05-09 11:12:01 +00:00
Mikhail Golubev
388e48d5ad PY-80850 Insert "t" prefix on completion after "{" in regular strings where Templates are expected
(cherry picked from commit 6cc25474c2392b6b5de9958e58bb87db86854c5f)

GitOrigin-RevId: 74d7db586a75a3614481c29873a0a86b33416cc2
2025-05-09 11:12:01 +00:00
Mikhail Golubev
1cc8316591 PY-80844 Add a new intention for converting between f-strings and t-strings
(cherry picked from commit be3ab4d72de05a92c986af31ac8e40309d9754b1)

GitOrigin-RevId: fba9757978f5f669aa63e2657a3fcbd2923bec74
2025-05-09 11:12:01 +00:00
Daniil Kalinin
989485f44a PY-79967 Simplify Template type inference for t-strings
(cherry picked from commit 2964402eac2061e0230e612badc790d0d289f469)

GitOrigin-RevId: 74b859ff596970d08c5fd82f9a2a6112468804e1
2025-05-09 11:12:00 +00:00
Daniil Kalinin
328d4cc4e1 PY-79967 Introduce a separate method in PyStringLiteralUtil for t-strings
(cherry picked from commit 47b1a84c4331aa127a17e4f934c4b1dc28396cf0)

GitOrigin-RevId: 204f5ba41aa022b672e2d71db83b5bd3327770d4
2025-05-09 11:12:00 +00:00
Koudai Aono
5b8c2abc96 PY-79967 Support t-prefixed strings, Related PR: https://github.com/JetBrains/intellij-community/pull/302
* Add PYTHON314_PREFIXES to CompatibilityVisitor
* Patch typeshed, add t-string related stubs
* Infer `string.templatelib.Template` type for t-strings instead of plain `str`



(cherry picked from commit 0e913910ab9e0dca4052856b0585ce66265291c0)

GitOrigin-RevId: f03a68ae9aee458a74eccc19c38d8d3e4dc7491a
2025-05-09 11:11:59 +00:00
Mikhail Golubev
e8ad5a580a [pycharm] PY-38169 In quick documentation display .py sources as the origin for .pyi declarations
In particular point that `collection.abc` symbols are defined in _collections_abc.py.

IJ-MR-159943


(cherry picked from commit be9b7c9c72ae668cd59f5981a025bc6de8a8ca90)

IJ-MR-161809

GitOrigin-RevId: 779e3c4e9a2216c366b9ade2817739918420c0f7
2025-05-01 14:58:06 +00:00
Mikhail Golubev
12609db31a [pycharm] PY-80432 Fix navigation on collections.abc in imports from Typeshed to _collections_abc.py
IJ-MR-159943


(cherry picked from commit cc83e34de632c134a81c2d285b3c445ad76d2331)

IJ-MR-161809

GitOrigin-RevId: 66dca55d173d38d0a54df0c51220d0aa6bb5456d
2025-05-01 14:58:06 +00:00
Morgan Bartholomew
11f54723c8 [pycharm] PY-38169 special case definition location for standard collections that are wrong in typeshed
IJ-MR-159943


(cherry picked from commit c580a6408408965d909680ddba9b5b062d1c4782)

IJ-MR-161809

GitOrigin-RevId: 819e8f906003c02b80072b7c00c8f9e27e83dad2
2025-05-01 14:58:06 +00:00
Morgan Bartholomew
fa4b4eec34 [pycharm] PY-41827 check for union types in PySimplifyBooleanCheckInspection
to avoid ambiguous conditions


(cherry picked from commit f11c08f8dfea453a6676173bae57f96233429970)

IJ-MR-159379

GitOrigin-RevId: b700b1e5e7c077da7b61661d33c2a3aa135d9e21
2025-05-01 02:46:56 +00:00
Aleksandr.Govenko
572d9bc312 PY-78593 NPE: [PyControlFlowBuilder.visitCondition]
Merge-request: IJ-MR-158982
Merged-by: Aleksandr Govenko <aleksandr.govenko@jetbrains.com>

(cherry picked from commit 57f9a497e788f274ba20ccc95ddc07cb88f9c744)

IJ-MR-158982

GitOrigin-RevId: 2abea522a3ca869f49a7f22d73f13194992ad4f1
2025-04-24 20:42:05 +00:00
Aleksandr.Govenko
5bf9f9ff39 PY-80493 Inconsistent return inspection adding "return None" after every line in context manager
Merge-request: IJ-MR-160763
Merged-by: Aleksandr Govenko <aleksandr.govenko@jetbrains.com>

(cherry picked from commit b576e30d433d39e426c8854d3ad485594ac9e958)

IJ-MR-160763

GitOrigin-RevId: cf6a3a4c834ee1df160e1927af1b75eb16eec3dc
2025-04-24 02:27:25 +00:00
Petr
91f3589711 PY-76885 Conformance test failure: constructors_call_metaclass.py
Replace the verbatim comment with a link to the spec.

(cherry picked from commit 2c5012babed584cab4f5d9f0bb68e960a76e6bc4)

GitOrigin-RevId: 24f9c9df13b76bec1837922f05f47dd86eda0541
2025-04-23 23:27:31 +00:00
Petr
36e436bd70 PY-76885 Conformance test failure: constructors_call_metaclass.py
Assignability of metaclass's `__call__` return type to a type being constructed should be used instead of class equivalence.

(cherry picked from commit 94ae5d5870ca7deedc42f381456d13cb08d97ffc)

GitOrigin-RevId: d9e49b5813bafebf7ae3349d6c3232eaeaf5d925
2025-04-23 23:27:31 +00:00
Petr
9b70a7cf4a PY-76885 Conformance test failure: constructors_call_metaclass.py
(cherry picked from commit d4ae8eb0303ec141c9766599ede8be1d3bb538fb)

GitOrigin-RevId: 90a67c7cc6266752ab8cdfa3379e95123c3959f9
2025-04-23 23:27:31 +00:00
Petr
c52f4bbadf PY-80195 Literals of Enums broken after import (2025.1 EAP)
Consider enum attribute of an unknown type an enum member.

(cherry picked from commit 72c2fd37f18e4dde65d735f1032495df5aeda791)

GitOrigin-RevId: 7e56afe6a2d2efe0ea84ac20672aaf7712d8ed23
2025-04-23 23:27:31 +00:00
Petr
ed52e34951 [python] Inline oneliner method (PyAbstractClassInspection)
(cherry picked from commit 67821b8b8d8f643b5d93282fe9f6aebda33d3e28)

GitOrigin-RevId: eba0dfcb785d874aca1909e20cd6200245ead057
2025-04-23 23:27:31 +00:00
Petr
e1b380f8b9 PY-12132 Support ABC classes (pep-3119)
Report error for abstract method in non-abstract class.

(cherry picked from commit 824d45a310b95ada628d6e607ae1ced6e351d849)

GitOrigin-RevId: 446cfea2ab76611d13648c17d6f7419fdefa0954
2025-04-23 23:27:31 +00:00
Petr
42dd3f39bf PY-12132 Support ABC classes (pep-3119)
A class containing at least one method declared with `abstractmethod` decorator that hasn’t been overridden yet cannot be instantiated.

Also report instantiation of classes that directly inherit ABC or have metaclass set to ABCMeta.

(cherry picked from commit 55cb4dc90c55ddc63991a4c3f6b50b4e34a3b4bd)

GitOrigin-RevId: b37ea24490dc5ce7dcce87adf21aa6fe31e0e9dc
2025-04-23 23:27:31 +00:00
Petr
f09b6239ad PY-76824 Conformance test failure: directives_no_type_check.py
(cherry picked from commit d823c6dbc51959ec1d534814972b3323be8361cb)

GitOrigin-RevId: 2672df0698539b78d261e8667920072d2f921af7
2025-04-23 23:27:31 +00:00
Petr
b1b6fe88d3 PY-80169 Conformance test failure: exceptions_context_managers.py
(cherry picked from commit 9d0714edc4507cb90feb56f2ec72466b1b454c79)

GitOrigin-RevId: af485a6386b0c11fe348cbdfaa8b3767bf112cf5
2025-04-23 23:27:31 +00:00
Petr
8b35c2619c PY-80169 Conformance test failure: exceptions_context_managers.py
(cherry picked from commit 7d43529ffe01edc695ed2e3682ab38960df45961)

GitOrigin-RevId: 94259cd855bf74a032b764de478483a90fba2578
2025-04-23 23:27:31 +00:00
evgeny.bovykin
5cdec66645 PY-78250 Call PyDataclassTypeProvider before PyTypingTypeProvider so that it has a chance to infer the dataclass type first
(cherry picked from commit 18230af949275e3f585ce806fec25144731e347b)

IJ-MR-158112

GitOrigin-RevId: 50ed312ca85b506cd1a8e8411b80548f81b56487
2025-04-23 12:07:33 +00:00
Morgan Bartholomew
57b4491fda [pycharm] PY-79331 render type as "type", not "Type"
IJ-MR-159663

GitOrigin-RevId: e346f761a0c07e6f5897d02f6529ad78a073daa5
2025-04-16 08:37:21 +00:00
Morgan Bartholomew
5fba2f8e01 [pycharm] PY-80290 build empty tuple correctly
IJ-MR-160209

GitOrigin-RevId: deab46aaaa36f5b5d4baf0a9e19914db89d808a0
2025-04-16 08:28:26 +00:00
evgeny.bovykin
37d60f18fe PY-80147 Handle type of tuple expression being null in PyStringFormatInspection
It can be null if, for example, a Python interpreter is not configured and a tuple of strings is used as a rightExpression

(cherry picked from commit 23564503422a75de7b538dec3400fb8dd284cd73)

IJ-MR-159172

GitOrigin-RevId: 0bb36753d66f81afc784e88d8d7cd84b5795997c
2025-04-08 07:45:27 +00:00
evgeny.bovykin
206476236e PY-80150 Handle classQName possible being null in PyTypingTypeProvider$GeneratorTypeDescriptor
(cherry picked from commit b5310163bb0f6416f531ddcd703b9070f3cd8999)

IJ-MR-159177

GitOrigin-RevId: fb2b4781152d4a2775fb85cabf6f2758b354dc21
2025-04-02 22:11:22 +00:00
Aleksandr Sorotskii
da15579140 fix remote interpreters being incorrectly handled in the free tier; PY-79923
(cherry picked from commit 3b9622eac312b5131fdc8c16db94c36a14735be9)

IJ-MR-158632

GitOrigin-RevId: 9a18931d9b125d37029f6aa18c5129f054f13674
2025-04-02 21:49:23 +00:00
Mikhail Golubev
6ef865438e PY-53599 Declare Tensorflow 2.16.1+ layout since the Keras implementation was changed
See the release notes
https://github.com/tensorflow/tensorflow/releases/tag/v2.16.1
and the change
4be8c8d2d2


(cherry picked from commit 1482cdd5a3006ba07ae21fbeaf72111d3421f5d9)

IJ-MR-157295

GitOrigin-RevId: f09d4f9153222ea47d9ff258ff8ecae132f22f2e
2025-03-31 11:09:01 +00:00
Mikhail Golubev
ea3859577e PY-53599 Return the registry value "enable.tensorflow.pyi.stubs"
(cherry picked from commit 576c04fe79fadb7d92df79e5648c62c914852051)

IJ-MR-157295

GitOrigin-RevId: fd2f549710e42e5c94d01e3a49d7e2b1a00e3402
2025-03-31 11:09:01 +00:00
evgeny.bovykin
8d4198bd81 PY-53599 Manually update tensorflow Typeshed. Enable enable.tensorflow.pyi.stubs by default
New Tensorflow Typeshed has updated stubs for the keras module, as well as for other Tensorflow modules. So PY-65966 should not be reproducible anymore


(cherry picked from commit 929e1da40c82bf6dd26efd227c0421087df3b75c)

IJ-MR-157295

GitOrigin-RevId: 4bf2396c3cd62aea0339db51fbec058f1d765a05
2025-03-31 11:09:01 +00:00
evgeny.bovykin
dcffa4593b PY-43122 Fix type inference of a property reference in case switching to AST is not allowed
(cherry picked from commit a4d2f60ef2a23d99b6d4a9e01691dbe7bf35b23b)

GitOrigin-RevId: aef6e9342188537fc85682969da0757a4db9f8c9
2025-03-31 07:47:25 +00:00
Aleksandr Sorotskii
5dde5518fa cleanup package name normalization; PY-79870
(cherry picked from commit cfc8e220df5d7a2a33b2c027bbf37a7d5055ffc5)

IJ-MR-158370

GitOrigin-RevId: 85f665ae8f601052eb21526f974f196d6f53ceb9
2025-03-27 12:07:58 +00:00
Nikita.Ashihmin
c92d80bd47 PY-79631 PY-79641 Jupyter, Packages: Refactor and start use common approaches for detect it is required to suggest to install package
Signed-off-by: Nikita.Ashihmin <nikita.ashihmin@jetbrains.com>
(cherry picked from commit 8c1acf42534bbba06828419e3d170cea5f77bdd4)

GitOrigin-RevId: 1c644ecce8617641c7880b89a7f42f8ca6e2e3f0
2025-03-25 16:32:42 +00:00
Ilia Zakoulov
cebc930070 PY-79819: Normalize package name while converting module to package name.
Otherwise, package name for the module might be capitalized, causing
`PythonSdkUpdater.addBundledPyiStubsToInterpreterPaths` to think that
"Django" is not installed, because `PythonPackage::getName` returns the normalized (=lowercased) name.

GitOrigin-RevId: eba4f798be2e2fd6777437010530abcec3c83ada
2025-03-22 14:02:34 +00:00
Timur Malanin
dbdb988529 PY-54850 Normalized package names in PyPackageRequirementsInspection for consistent matching and refactored requirement satisfaction checks. Unified normalizePackageName logic. introduced a test to verify that requirement mismatch warnings disappear upon package installation.
GitOrigin-RevId: 11a4c70e26abcb4cb6d445016d8f68599666fb16
2025-03-22 14:02:34 +00:00
evgeny.bovykin
8a9854b80e PY-46623 Refactor PyKnownDecorator and related classes to be extendable
PyKnownDecorator is now a class instead of an enum, allowing extension to create new instances

(cherry picked from commit 846617f68e559f7f77af15a999f837391ac3090e)

GitOrigin-RevId: f3a8d9ac39955c888647e7186ad4315305a380bb
2025-03-19 18:57:08 +00:00
evgeny.bovykin
0060074133 PY-46623 Add setter and deleter to cached_property
(cherry picked from commit 97c7703a89d0e1c49f829aed3474006ac7e5324a)

GitOrigin-RevId: 266ec4f71c70550d06f1632005edfd008029298e
2025-03-19 18:57:08 +00:00
Daniil Kalinin
df767dfb8d IJ-MR-156740 Move indexStub to PyCustomStub interface
(cherry picked from commit 7be9af2a278348efcf6c4dabf9637853dc625b77)

GitOrigin-RevId: 151ad5d2004151d17206d6de6b3fe12eeffb02b0
2025-03-12 15:40:25 +00:00
Daniil Kalinin
a5e6c6d875 PY-4536 Implement completion for arguments of relationship declaration model references
(cherry picked from commit 3e24787ad0cb29097b8fbd954f15c23fd029d308)

GitOrigin-RevId: fc347d42ce31d5c8245e2a0849ef68915e66fd73
2025-03-12 15:40:24 +00:00
Daniil Kalinin
d486d6930f [python] Extract PyImportableNameCompletionContributor#addImportForLookupElement to a Companion object
(cherry picked from commit 2daf2dc7cee4a4ba8700e5aa24dc4295de36bb91)

GitOrigin-RevId: 3e2f6177e4393316ca0432db7c76b9c9ed12d407
2025-03-12 15:40:24 +00:00
Daniil Kalinin
4e35a3f45b [python] Support stub index for PyCustomClassStubType stub types
(cherry picked from commit 0925ffe0fc0fbffb3c6aa28c71945721022bfea6)

GitOrigin-RevId: 0e577c5227a66caa07bf4ee57fdaa8519410d6a5
2025-03-12 15:40:24 +00:00
Daniil Kalinin
573c282931 PY-79693 Fix false-positive: NoReturn and Never are wrongly reported as invalid type arguments
(cherry picked from commit e03f60689c6462dbb02cc869992233bb78fb0524)

GitOrigin-RevId: 31b3cba395df81274a76675ac061348bb8d2bf7e
2025-03-12 15:40:24 +00:00
Aleksandr.Govenko
abe414ffc5 PY-48011 Pattern Matching: Type inference
Merge-request: IJ-MR-154823
Merged-by: Aleksandr Govenko <aleksandr.govenko@jetbrains.com>

(cherry picked from commit 42cb07bee63f34127c85574fc9c09e6043bc7591)

IJ-MR-154823

GitOrigin-RevId: 2ad321e755a0efd262c077b2ea2571143ec72600
2025-03-08 03:26:16 +00:00
Aleksandr.Govenko
c02ef9f62d PY-78964 Incorrect return type warning when using try...finally
Added a new CFG instruction to indicate implicit raise after finally block. Also added PyDataFlow as an future entry point for DFA.


Merge-request: IJ-MR-155798
Merged-by: Aleksandr Govenko <aleksandr.govenko@jetbrains.com>

(cherry picked from commit db63ba632c48235cc51b8e64869d21f5bcfc2d1c)

IJ-MR-155798

GitOrigin-RevId: b913e67a07e035b03f1092d5b6d9529864cb4d1b
2025-03-07 16:41:12 +00:00