Commit Graph

278 Commits

Author SHA1 Message Date
Ilya.Kazakevich
9f31575c35 PY-77483, PY-75549, FUS-5195: Misc project pycharm (squashed commits from master)
Lots of files are picked from the master

GitOrigin-RevId: 88dfc699cbfa2be9b11d1645c2c24221d16fbdc4
2024-11-26 17:47:29 +00:00
Ilya Kazakevich
7bd141a993 PyCharm: Rewrite NPW API: See com.jetbrains.python.newProjectWizard
This package (aka PyV3) fixes several issues, including
1. Lots of `DirectoryProjectGenerator` misuses: We now create UI and settings with `ProjectGeneratorPeer`: no more manuals casts in callback
2. Decouples project generation from UI: Settings aren't aware of UI but generate a project instead. Settings are mapped to the UI using Kotlin DSL UI
3. Kotlin DSL UI panel enables validation
4. `PySdkCreator` (an interface implemented by all "v2" SDK panels) now accepts `Module`, so we can provide it Poetry

The whole machinery of `PythonGenerateProjectCallback` (a pack of manual casts only mother could love) is completely deprecated and will be removed soon.

Lots of small changes towards `suspend` functions, Kotlin DSL UI and `Flow` decrease the technical debt.


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

GitOrigin-RevId: 21963e843b0ae67c71a6fc5ea1229cb0f57915a9
2024-09-10 19:50:12 +00:00
Ilya.Kazakevich
01228fba20 PyCharm: remove supportsPython3 check as any modern framework support it (all impls return true)
GitOrigin-RevId: 06f939ac73ae864a04ee6bdfd09be1e54b5bda5d
2024-08-01 19:52:34 +00:00
Nikolay Chashnikov
c39556d80e [python] add special access method to PyPackageManager to avoid incorrect usage of protected methods (IJPL-149126)
'getSdk' and 'shouldSubscribeToLocalChanges' were called not from a subclass, so they were actually used via 'package private' visibility. And this will fail with IllegalAccessError if intellij.python.community and intellij.python.community.impl are loaded by different classloaders.

GitOrigin-RevId: 6e2f779063ae9fc188b60b3d52bb5cbe6fe496a9
2024-05-02 08:45:44 +00:00
Ilya.Kazakevich
49fd59c70a PY-64402: Only create main.py if "create welcome script" checkbox set for the Jupyter project.
We used to create `main.py` in any case, but must do that with checkbox.

This code is not elegant due to boilerplate and possible inconsistency (generator might ask for the welcome script and ignore it), but this is the only API for now.

GitOrigin-RevId: 5ecf78f017229aa77d9ec296e46fc8bb742ccc0a
2024-03-21 20:10:55 +00:00
lada.gagina
670e389e15 Revert "[python] Convert underscores to hyphens for python packages (PY-65170)"
This reverts commit a9d3a72e050f8ddc104f706a63d181d81840e94c.

GitOrigin-RevId: d165051645a1e18efabe7ed3a7d1f186fb6d4049
2024-01-29 19:56:59 +00:00
lada.gagina
cfcc685699 [python] Convert underscores to hyphens for python packages (PY-65170)
Python packages use hyphens and underscores in their names. However, when publishing/searching the package on PyPI the underscore gets normalized to hyphen which can lead to inconsistencies between displaying/manipulating packages and requirements.txt files in PyCharm.

GitOrigin-RevId: 3382a6c002b8e593b9e398c182289e740dc3e19f
2024-01-26 01:05:29 +00:00
Aleksei Kniazev
49f0e39af3 [python] deprecate old python packaging classes in favor of PythonPackageManager
GitOrigin-RevId: 8c2bc03c04d95839192b612c2a9053cfdbc3ee00
2023-12-04 13:47:48 +00:00
Andrey Cherkasov
965336c323 The "Incorrect service retrieving" inspection: cleanup
Merge-request: IJ-MR-116714
Merged-by: Andrey Cherkasov <Andrey.Cherkasov@jetbrains.com>

GitOrigin-RevId: b1d06c88028fc2248ab63c8522dc67d7e4fa2e60
2023-10-17 01:21:54 +00:00
Vladimir Koshelev
7dc8c853c5 [python] move some stuff from openapi
GitOrigin-RevId: bc0a26fd9436a26c7e4b2be1cb0210b7179bf3bb
2023-10-10 08:27:58 +00:00
Vladimir Koshelev
967119e85f [python] add fus events for creating python project and adding python interpreter PY-61461
GitOrigin-RevId: daa2356f445485651eb563d8abd18f48a709d124
2023-07-20 13:00:53 +00:00
Nikolay Chashnikov
4899a5a210 cleanup: remove redundant '@author' tags from javadoc comments - 6
Now we have Code Vision hints which determine the author via Git history and show it in the editor automatically, and this information is more accurate than the tags which were automatically added when files were created.

GitOrigin-RevId: 30586ed1915e3b35394ff3ee6251607c64bbabdd
2023-01-18 17:01:44 +00:00
Daniil Ovchinnikov
578eaaf60e rename library kotlin-stdlib-jdk8 -> kotlin-stdlib
GitOrigin-RevId: cddf45ccfd5563d3fe209bea62a1c37c94f44ff9
2023-01-10 12:22:34 +00:00
andrey.matveev
70d6a4eb79 PY-55360 Use sdk instead of sdkHomePath to allow select interpreter in docker compose
(cherry picked from commit 2ae371ce70be9490ddb14b6981366e06a41ddb5d)

IJ-MR-96284

GitOrigin-RevId: 832cadd71e1a0d47852e44854b2ead217342b7e4
2022-11-14 18:55:08 +00:00
Ilya.Kazakevich
2a52439c6a Move `FullPathOnTarget` to the execution module
GitOrigin-RevId: 0bcc9f2085503f6be40bfbb69e4910c4cc76eff8
2022-10-26 22:49:57 +00:00
Ilya.Kazakevich
813cf3e706 PY-56796: Fix conda freeze for DockerCompose
* Coroutines must call ``blockingContext`` when run legacy code with ``invokeAndWait``. Modality state leads to livelock otherwise.
* Coroutines must use ``runInterruptible` when accessing process streams (see ProcessExt.kt)

GitOrigin-RevId: 5aaa357ff329dc95efd072d50fbca7e36ab07563
2022-10-17 23:59:23 +00:00
Alexey Sedunov
c443410d79 Django: Extract Django/Jinja2 commons
GitOrigin-RevId: 3f6bb7b7cd80cbf6007e1930d4d018e1b1cff44a
2022-10-16 11:59:01 +00:00
Ilya.Kazakevich
a4dcfdd16e PY-35978: Improve Conda support and refactor other parts to support it.
Each sdk has additional data with flavor and flavor-specific data. For target-based SDK there is also target information. ``PySdkExt`` has extension method that uses this data to execute code on some SDK. For Conda we store path to conda binary and env name.

GitOrigin-RevId: c63b57aac9b5a267b3a6710902670bfe7d10c722
2022-10-12 17:55:25 +00:00
Nikolay Chashnikov
0c2dd1eefd [python] cleanup: remove unused deprecated API (IDEA-295370)
GitOrigin-RevId: 35b47e4aea678a95d20f19e3cf66db7196fd9c7b
2022-09-16 12:41:46 +00:00
Ilya.Kazakevich
5ca58470f7 PY-54231: Fix "AlreadyDisposedException" and get rid of copy-paste and leak of this.
Each package manager must report explicitly if it needs to be subscribed to local changes or not.

Then, ``PyPackageManagersImpl`` obeys this flag.

Package manager disposed when SDK is disposed.

GitOrigin-RevId: 2cac8411c322c3b499ad6125b764c5c7e9dae8b7
2022-06-11 11:31:33 +00:00
Ilya.Kazakevich
fb158617c2 Do not pass disposed sdk: may lead to exception
GitOrigin-RevId: 868a825566810c6af04a335d1c626583a678f606
2022-05-25 20:42:44 +00:00
Nikolay Chashnikov
abc373560d [API] replace ApiStatus.ScheduledForRemoval annotation by 'forRemoval' attribute (IDEA-288466)
Since we don't want to specify planned removal date anymore, there is no need to use a separate annotation.

GitOrigin-RevId: a047c55475e0f4752a2842577e094fb041c6c05b
2022-02-11 15:12:14 +00:00
Vladimir Lagunov
6029ef5252 Introduce ExecutionExceptionWithAttachments and use it in SSH targets
GitOrigin-RevId: 1ba4d246629dacd0145b12c177a4c45e1185cfda
2021-10-20 14:22:11 +00:00
Mikhail Golubev
1dc1f77281 i18n: Add missing annotations in Python documentation providers
Proper internationalization of PyDocumentationBuilder and
PythonDocumentationProvider is still in the making, though.

GitOrigin-RevId: 57745d8c00a9cff9f0d6de6e599482c88a5b147e
2021-08-17 12:24:16 +00:00
Alexey Kudravtsev
761e8af4c7 remove wrong dependency of OpenAPI module "python-community" on impl modules
GitOrigin-RevId: 4dc39d6ab5eda3d2c8089cfb4fe587251ec00b22
2021-08-15 18:57:16 +00:00
Alexey Kudravtsev
0e1192da1e remove Guava from api modules dependencies
GitOrigin-RevId: 862ce946b10e0e1b5bdfbe7193d5f6cc6f5d516c
2021-07-14 17:56:24 +00:00
Dmitry Jemerov
749ce8a332 Cleanup: remove @author tags
GitOrigin-RevId: 9174eb8d77215b16f9f6c6074e6aced654d95ef1
2021-05-03 13:07:48 +00:00
Vladimir Lagunov
99f18023d7 DS-1074 Jupyter: Quick fix for importing in current cell.
(cherry picked from commit 445ba46b8b54bc61f1c8af89304cfa53f56d2d04)

IJ-MR-7199

GitOrigin-RevId: 748ab4f541e9ceedfe394ac41c74b8b95dc6e0a0
2021-04-14 13:34:51 +00:00
Andrew Kozlov
c07e578e7d InstalledPackage refactoring: explicit nullability; PackageManagementService#getInstalledPackage variance added
GitOrigin-RevId: 1bfb0969da77bde8809855f9c80da3878e7569e5
2021-02-22 18:20:41 +00:00
Vladimir Krivosheev
6338b863e4 do not use module level message bus
GitOrigin-RevId: e6b62994906b120b6c5ca394be39ad593d377f00
2021-02-18 18:49:48 +00:00
Ilya.Kazakevich
930b8a9f3c Result cleanup
GitOrigin-RevId: 4c3146734479e6abc155fd901b65bd8c93d2d0c3
2020-10-30 22:48:20 +00:00
Semyon Proshev
3d31f690f3 Re-use already calculated sdks in guessing language level
Drop `isPythonModule` call since it breaks PyStringLiteralTest.testEscapedUnicodeInLiterals.

GitOrigin-RevId: 6f5ea083a72bdb29826466a50f62cdf84cd26960
2020-10-19 16:36:20 +00:00
Semyon Proshev
603ae74c21 Make python disposable name more descriptive and not looking like interface
GitOrigin-RevId: 5009db52c121efbbf04952d3843b64ff4dc5888d
2020-10-16 14:44:56 +00:00
Vladimir Krivosheev
924abe229c cleanup (get rid of ServiceManager.get)
GitOrigin-RevId: 7f6a905353889c9795e5d40a8aa60f6251000f05
2020-10-16 11:34:52 +00:00
Vladimir Krivosheev
9ca499570c auto dispose of plugin disposables
GitOrigin-RevId: d3dd18f56168ed9ff421c9f84deabf1bb68d7f1d
2020-10-09 11:59:02 +00:00
Semyon Proshev
d95b00fdd8 Avoid application/project/module as parent disposable in python-related code
And fix several warnings.

GitOrigin-RevId: e97dae3116177bd919bc4ea51ceb1a3e7657e2cb
2020-09-29 10:04:22 +00:00
Mikhail Golubev
0f5277633b PY-43773 Correctly release VFS listeners detecting changes under interpreter roots
Previously, because we re-create instances of PyPackageManager, where they
are registered, on each change of the corresponding SDK, we could pile up stale
listeners, possibly processing relevant VFS changes and, thus, triggering SDK
updates multiple times.

GitOrigin-RevId: a9e6d3d87ca54114271efc220c3759ee6ae94ff3
2020-09-25 20:04:02 +00:00
Mikhail Golubev
49b9d76a03 i18n: Process remaining problems in Python project wizard
* Don't use message keys in isolation, without bundles
* Use HtmlBuilder for multiline HTML warnings

GitOrigin-RevId: 7652154d09e1237804cb690ed2dd763e1c60fd4d
2020-09-10 20:37:17 +00:00
Mikhail Golubev
2b1e7d872b i18n: Migrate packaging error messages containing links to HtmlBuilder
GitOrigin-RevId: 83bb593c6fed9a284d1a3c9a3ee57ce604670c91
2020-09-05 16:32:39 +00:00
Ilya.Kazakevich
953c37722f PY-40431: i18n: Result can be localized or not dependning on annotation
GitOrigin-RevId: e76acb018492a26d2e3f965d37685bd383964b7a
2020-08-30 14:08:02 +00:00
Ilya.Kazakevich
694162565c PY-40431: WSL i18n
GitOrigin-RevId: cdd28e2fe19715dcaf4fcb23bc64244ec9c9b102
2020-08-29 01:40:16 +00:00
Mikhail Golubev
c31fbeb18c i18n: Annotate PyRequirement#getPresentableText as @NlsSafe
GitOrigin-RevId: 504450af157c9bab9fb9ce40324287b46be817c5
2020-08-26 10:01:25 +00:00
Mikhail Golubev
73185f09fc i18n: Annotate WeakFileReference#getUnresolvedDescription() similarly to PsiReferenceEx
GitOrigin-RevId: b33030faf98ed9b9787f000a86f2b5977f6d5dd1
2020-08-25 13:39:01 +00:00
Mikhail Golubev
bc607f85ed i18n: Extract messages from remaining pure-Python inspection
* PyTypeCheckerInspection
* PyTypedDictInspection
* PyUnnecessaryBackslashInspection
* PyUnresolvedReferencesInspection
* PyUnusedLocalInspectionVisitor
* PyTypeHintsInspection

GitOrigin-RevId: 62d72bf38ef48412baf52960bc9da2b9f6d09070
2020-08-24 13:16:58 +00:00
andrey.matveev
13bed886ac i18n Fixes in remote interpreters
GitOrigin-RevId: 82ea247ba597511682b2e1f633ecde6b57718762
2020-08-19 17:08:05 +00:00
Alexey Kudravtsev
ffa825af57 use file.isCaseSensitive() instead of some VirtualFileSystem.isCaseSensitive()/SystemInfo.isCaseSensitive to support per-directory case sensitivity
GitOrigin-RevId: d7e7ecbba51a13c13935001238825b3740888458
2020-07-31 15:25:37 +00:00
Stanislav Utikeev
d8e63de195 LAB-31 Extract documentation service EPs to analysis API
GitOrigin-RevId: 6c4f05e4a625b9a855f0371cf2b39603fa4cc624
2020-07-10 12:29:55 +00:00
Vladimir Krivosheev
acb302b622 deprecate guava Lists.*
GitOrigin-RevId: c8a746f6620e525ba8f32e4d79dd6a40949e4bc6
2020-04-22 12:17:34 +00:00
Aleksei Kniazev
6cb5115bed more tests and improvements for python requirements generation (PY-18847)
GitOrigin-RevId: 2176648fd9021b3734e29c72b9daaa98e81a108a
2020-03-12 09:39:39 +00:00
Alex Plate
6174593c2b Fix some iml files (extra whitespaces / senseless paths)
GitOrigin-RevId: 48fc2ad90766f699b115536aa124799c451ea7a9
2020-03-10 15:23:35 +00:00