Commit Graph

105 Commits

Author SHA1 Message Date
Nikolay Chashnikov
2999a2c383 cleanup: remove redundant '@author' tags from javadoc comments - 24
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: f1b80125c2555d89f32aae4e5290d7771a357abf
2023-01-18 17:02:43 +00:00
Daniil Ovchinnikov
578eaaf60e rename library kotlin-stdlib-jdk8 -> kotlin-stdlib
GitOrigin-RevId: cddf45ccfd5563d3fe209bea62a1c37c94f44ff9
2023-01-10 12:22:34 +00:00
Vladimir Krivosheev
57764d700b mark classes final
GitOrigin-RevId: 6414b6f2119c82c7567987dd30b35cab5491d9e2
2022-12-30 06:58:01 +00:00
Vladimir Krivosheev
98ace0a061 use XXH3 instead of MurMur3 to generate an icon image key
The main reason — use XXH3 everywhere

GitOrigin-RevId: 7b158b9b3689d16f09182abb0b58113c7303f874
2022-12-27 08:01:26 +00:00
Tagir Valeev
a8b394e10c Fix constant value and other warnings
GitOrigin-RevId: 5521a732a94fb9c8ee55e6487e306392d53173bd
2022-12-05 16:50:45 +00:00
Alexander Koshevoy
95c8b06dfc PY-57558 Take into account interpreter path stored in additional data for running Python processes
Using `Sdk.getHomePath()` as the path to interpreter is not reliable for every case. For example, for legacy remote interpreters `Sdk.getHomePath()` contains prefix, which is used to distinguish different types of remote credentials (for example `sftp://` or `docker://`). It also contains the representation of the value of the remote credentials used. In this case the interpreter path is available via `PythonSdkAdditionalData.getInterpreterPath()`.

These changes fix the problem introduced in c63b57aac9b5a267b3a6710902670bfe7d10c722.

GitOrigin-RevId: a7dc2579d1b0b367353fbecf4b9fe4a56b098e9b
2022-11-25 21:38:35 +00:00
Ilya.Kazakevich
cfdfcce091 Add logging to trace invalid SDK errors
GitOrigin-RevId: 86bd1001a07f0d005625c0cff99b2eda36e8f73a
2022-11-15 22:57:56 +00:00
Ilya.Kazakevich
8c2308c2c3 Revert PY-56467, provide another fix for PY-57226:
See last comment in PY-57226.
* Use console encoding for PythonExecution
* DO NOT provide ``PYTHONIOENCODING``
* Build PyCharm without of ``file.encoding``

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

GitOrigin-RevId: 943402d55d3c4aa5460b2fae2602ed43e88029ce
2022-11-15 19:43:07 +00:00
Ilya.Kazakevich
3a0fc5ba5e PY-57146: Fix warning for non-base condas.
See ``TargetedCommandLineBuilder.addEnvVars`` doc for the main issue.
We also add fix to patch path in PythonScripts

GitOrigin-RevId: f42044338f91d5b444c5e1431957272392ab5f1c
2022-11-10 23:02:30 +00:00
Ilya.Kazakevich
ab43751a51 PY-57146, DS-4124, DS-3992: Fix local conda activation on Windows for newly created SDKs
What was wrong:
For SDK creation we execute python to get python path for homePath (see ``PyAddCondaTools``).

So, we execute python on conda before homePath set.

On each execution we read vars from ``activate.bat`` to workaround conda SSL in path problem and activate terminal (since cmd in terminal still uses old API).

``PySdkUtil`` can't read vars when homePath not set, hence caches empty vars for SDK and both terminal and conda workaround stop working until IDE restart.

We now stopped caching empty vars if homePath is empty.

GitOrigin-RevId: de3e37bbbc5281775e3fca79840089561ceed189
2022-11-08 20:19:13 +00:00
Ilya.Kazakevich
f0ae385d6b DS-3992: Activate local conda as virtual env (as we're done before).
This is a quick-and-dirty for terminals. Regular conda execution shouldn't be affected since we store python path in ``homePath`` now.

With this change, ``activate.bat`` read by IJ and vars (including ``PATH``) are passed to the terminal

GitOrigin-RevId: 711e5ea84519894ad3779626d4411196abb5a6b6
2022-11-03 21:37:24 +00:00
Ilya.Kazakevich
1e69327de5 DS-4036: Do not set `PYCHARM_HOSTED` for Conda.
``PYCHARM_HOSTED`` makes ``Coloroma`` assume that ``isatty() == true`` (even for bat file redirected to another file) which leads to problems on Windows. See issue comments for more info

GitOrigin-RevId: b82b25e7175330ae86604fc14012ef85e2b8ba0b
2022-10-27 19:03:17 +00:00
Ilya.Kazakevich
96c3efd4c8 PY-57014 (WIP): Use `Path instead of String for suggestLocalHomePath`
GitOrigin-RevId: af1a29aa02a943a5b2a952363ac9d9e53c56a6bc
2022-10-26 22:49:52 +00:00
Ilya.Kazakevich
29ccb7031a Add conda doc
GitOrigin-RevId: b6bc66d0bcd643ac48f83396df41e11875a6b279
2022-10-18 19:38:53 +00:00
Ilya.Kazakevich
ee538772ac PY-35978: support old SDK to new Conda conversion
GitOrigin-RevId: dc4edb65c5eae997ff07e329cd35190309f51e85
2022-10-13 17:03:07 +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
Ilya.Kazakevich
d3bdd60b34 PY-56467: Set python output to UTF-8 to support non-ascii chars
The problem is ``sys.stdout.encoding``.
On Unix Python uses ``LC_`` which is UTF-8 since late 2000s.
But on Windows for non-console based executions (with stdout redirected) it uses one byte encoding (aka non-unicode programs charset) due to backward compatibility with 9x/me.

With one-byte charset you can't have both latin-1 and cyrillic characters.

To fix that, we provide ``PYTHONIOENCODING`` which sets charset explicitly

GitOrigin-RevId: 5c3304e002d80fb5780f11f05fe5f4d1b6aef3ad
2022-09-28 01:57:50 +00:00
Ilya.Kazakevich
bb949d238c Move UUID to the `PythonSdkAdditionalData` because each SDK (including local one) should have unique id.
``homePath`` isn't unique for things like conda and remote interpreter.

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

GitOrigin-RevId: 2695cd29f2e102e48e22d751d8fb37a5aea567e4
2022-09-19 15:58:44 +00:00
Andrey Vokin
e343878737 DS-3673: JavaDoc
DS-3673 Interpreter widget doesn't show WSL interpreter

GitOrigin-RevId: 50e4b0a630dea664b78da0ee4a6b49637032dcda
2022-08-23 09:11:08 +00:00
Andrey Vokin
dad512ccde DS-3673 Interpreter widget doesn't show WSL interpreter
GitOrigin-RevId: bb7754bc6d30d2d9818acbb5cb522b758b78539f
2022-08-12 14:19:48 +00:00
Andrey Vokin
c34f3f30f4 DS-3673 Interpreter widget doesn't show WSL interpreter
GitOrigin-RevId: 6c709c7f4dce4226da9e5d9847b1030d7b836894
2022-08-11 08:35:59 +00:00
Ilya.Kazakevich
decee30082 PY-52925: Do not depend on target UUID since it is not persistent. Persist SDK UUID instead.
Remote paths are calculated based on SDK UUID, not target UUID which is not persistent.

GitOrigin-RevId: 287e2e3e7cb3e6c2099f396eb59fa72d82fdf83b
2022-08-05 15:51:40 +00:00
Alexander Koshevoy
a29837f328 PY-55047 When "python.use.targets.api" flag disabled display target-based interpreters as invalid and disable them
If "python.use.targets.api" registry flag is disabled:
 - display target-based interpreters as invalid;
 - show an error on an attempts to run or debug Python run configuration with an assigned target-based Python interpreter;
 - show an error on trying to open Python console with a target-based Python interpreter;
 - show a warning on an attempt to generate skeletons for target-based interpreters;
 - show an empty list of packages for target-based Python interpreters.

GitOrigin-RevId: 97ee828ab289e5104f0539c9ab49e6fab99fe56b
2022-08-02 11:17:33 +00:00
Andrey Vokin
8c83d321a2 DS-1661: performance optimization of the "findSdkForDirectory" method
DS-1661 New opened terminal sessions use the Workspace environment even though the opened folder has a different environment set in settings

GitOrigin-RevId: 286d7d076429f6b429b8b5378229d1336a6bca06
2022-07-19 09:13:41 +00:00
Andrey Vokin
3bb6f6204f DS-1661 Add working directory to customizeCommandAndEnvironment
DS-1661 New opened terminal sessions use the Workspace environment even though the opened folder has a different environment set in settings

GitOrigin-RevId: e47df9bc9b6ee65e85f0667f0390be7edce4a891
2022-07-08 09:09:25 +00:00
Petr Golubev
a77517a6b6 LAB-31: skeleton refresher
GitOrigin-RevId: 4fac85b06de6b8d65d96eb1b97259d2e7d39fc7f
2022-04-14 19:49:13 +00:00
Vladimir Krivosheev
a8f6a48409 add jdom to source code to modify and strip to our needs
GitOrigin-RevId: 3e16d0d954aa7bc45c4eadb91164b44e4b2e75d3
2022-03-27 18:52:47 +00:00
Alexander Koshevoy
d5c74bb7a5 PY-52632 Fix hanging on expanding Interpreter combobox
GitOrigin-RevId: 01b7f5ec45e8f32d23fbe972886134f626d9d2eb
2022-01-20 17:41:47 +00:00
Semyon Proshev
294e10debe Iterate only once through CONDA_DEFAULT_ROOTS in PyCondaPackageService.getCondaExecutableByName
GitOrigin-RevId: 4356444240b4cdc81365135612167e9af8d80dd9
2021-12-14 17:13:36 +00:00
Semyon Proshev
90e1a8533e Don't discover Python 2 based anaconda/miniconda
GitOrigin-RevId: 8aee1f382e46b6ee686d46b98aef3fb679e8a69d
2021-12-14 17:13:34 +00:00
Semyon Proshev
27df6491d9 Visit all possible roots during looking for conda in /opt/ (PY-52052)
GitOrigin-RevId: 3ff0814c25dd7479b455c4a09365fb993725869d
2021-12-14 17:13:32 +00:00
Semyon Proshev
560f3cde8e Add logging when looking for conda executable
GitOrigin-RevId: 6f315e5fa86162af0ca3cda90c38c0d8cf925ab3
2021-12-07 11:45:55 +00:00
Semyon Proshev
194ce1fae8 Look only for python3 binaries on linux (PY-51527)
GitOrigin-RevId: c643870cb9682d716876d94069fbad2d0c166f65
2021-12-06 10:20:43 +00:00
Vladimir Krivosheev
0429b0130d use murmur 3 32 instead of xxhash 64 for icon digests - reduce icon db size (mostly in memory, because on disk compressed using LZ4) and avoid loading extra classes on start-up (murmur is already used in classloader)
no collisions so far

GitOrigin-RevId: 1f41a238729772b4b3c4faa5de5cd1ccb9ec3f65
2021-11-19 09:43:32 +00:00
Andrey Vlasovskikh
9cd033354e [python] i18n-ize an error message in a skeleton generator
GitOrigin-RevId: 54d6de5102b200a2341f1b454b8ca63e08d3bb8f
2021-11-17 20:26:58 +00:00
Lada Gagina
f9362a8d03 PY-51198 Fixes in redesigned package installation failure window
- fix absence of package name if installation failed via file-level warning on requirements file
- get rid of unnecessary columns
- make the dialog resizable
- add forgotten dot to the troubleshooting tip#1
- add paddings to output and command text areas
- move hardcoded strings to bundles

IJ-CR-16145

GitOrigin-RevId: 6bafccd46dc6eb01db31d33d8979cca9c2b99c20
2021-11-17 12:54:36 +00:00
Lada Gagina
b8a6b65f89 Fix the message for failed virtualenv creation
GitOrigin-RevId: 2a566d48619aced61da4c18b8e45c86e4cdb9c15
2021-11-03 12:40:50 +00:00
Alexander Koshevoy
3647ee3e84 Remove unused message form bundle
The usage removed in da24a7bef8e812d8f5fefeebed7852bf3bb726c5.

GitOrigin-RevId: 88464549365d82ac9f397272b096c68a93a29690
2021-10-24 15:01:11 +00:00
Lada Gagina
18d0c28655 PY-50160 Implement the redesigned dialog for package installation failures
IJ-CR-13328

GitOrigin-RevId: 2cfa6c468411391772639441f0d2aeda4fddc435
2021-10-19 15:30:24 +00:00
Alexander Koshevoy
5c895e5073 Add @Nullable/@NotNull annotations to PythonSdkFlavor methods and its subclasses
GitOrigin-RevId: 9b18bf04d4330e4cc6b45760e3b99b171295a883
2021-10-11 11:37:31 +00:00
Alexander Koshevoy
de0697f2ce Add @NotNull annotations for fields in PySkeletonGenerator and parameter in its constructor
GitOrigin-RevId: 719ef7bbd29f8d7c1dc6e8fc2a296e21782be408
2021-10-06 09:04:55 +00:00
Alexander Koshevoy
180883b8e8 PY-40486 Introduce Python interpreter introspection procedure implementation based on Targets API
GitOrigin-RevId: da24a7bef8e812d8f5fefeebed7852bf3bb726c5
2021-10-04 14:13:40 +00:00
Alexander Koshevoy
ec320a15a3 Add @Nullable/@NotNull annotations to PySkeletonGenerator.getProcessOutput() method signature
GitOrigin-RevId: 1db85519e83cb297e64db5c1fb4f7d280d5d6945
2021-10-04 14:13:37 +00:00
Alexander Koshevoy
c0981499a1 Add @Nullable/@NotNull annotations to PySkeletonGenerator.getProcessOutput() method signature
GitOrigin-RevId: ee07b42d6ab9c167b5ef5949822613be8713d965
2021-09-08 10:41:42 +00:00
Mikhail Golubev
1813611ffc PY-49559 Strip trailing backslashes from the path to skeletons directory
It causes some weird problems with escaping, when in some places the platform
escapes `C:\foo bar\` as `"C:\foo bar\\"` and as `"C:\foo bar"\` in others
(compare ParametersListUtil.escape and CommandLineUtil.backslashEscapeQuotes).
One way or another, Python interpreter gets the path to the skeletons directory
as two separate command line arguments. The platform escaping problem needs
further investigation, but removing the trailing backslashes is the simplest
workaround on the Python plugin side. We stripped them in generator3 anyway.

GitOrigin-RevId: 52c0c1d3733cc004c1f0c2f1bf8cc186dfa698de
2021-08-13 13:17:48 +00:00
Semyon Proshev
6ad90fff38 Don't run actions related to transferred roots on editable sdks since they can share data with original ones (PY-45708)
PyTransferredSdkRootsKt#transferRoots and PyTransferredSdkRootsKt#removeTransferredRoots skip sdks that are not equal to module one (editable as well).

That's why roots changes were not applied in PythonSdkUpdater#updateSdkPaths but paths to transfer were successfully set.

When PythonSdkUpdater#updateSdkPaths was executed for original sdk, roots changes were not applied since there were no changes in paths to transfer (they were shared with editable copy).

Update PythonSdkAdditionalData containers usages: they returned cached values in `getPathsAsVirtualFiles` after `killAll` was called.

IJ-CR-10935

GitOrigin-RevId: 72a99f7b14e4d30c5886accb0db56d463890f265
2021-07-27 14:14:30 +00:00
Semyon Proshev
d4558ff94c Update source roots that were configured from interpreter paths on sdk switch (PY-45708)
IJ-CR-10935

GitOrigin-RevId: 03b1a9362e93d5408d88c82b8a8318dc3abff078
2021-07-27 14:14:27 +00:00
Mikhail Golubev
0a9eb7e19e i18n: Remove unused properties
GitOrigin-RevId: fbfac80b55e8e0bb78bde54253c8100f951ac9f9
2021-07-07 11:44:14 +00:00
Lada Gagina
9504153383 PY-42196 PY-41238 Switch to virtualenv library for virtual environment creation
It speeds up virtual environment creation (PY-41172), although from now on the latest releases of packaging tools will be installed in the created virtual environment after the 28 days period that should guarantee we are not pulling in automatically releases that have known bugs within (https://virtualenv.pypa.io/en/latest/user_guide.html#wheels)

IJ-CR-9549

GitOrigin-RevId: 563409e9f7ef1d61572989555f572b06b19ded85
2021-06-16 21:53:58 +00:00
Anna Kozlova
5cd6b5c3d2 [java] protected method in final class: make private where possible
GitOrigin-RevId: 3e6f6d1d19c2ffd51020bb8fb6ef76ee0c5eaae5
2021-06-11 07:49:00 +00:00