Commit Graph

128 Commits

Author SHA1 Message Date
Alexander Koshevoy
60a31a8a74 Rename .java to .kt
GitOrigin-RevId: c511e2e0b6b7404c6ff70e674b4b78887d1c960a
2023-10-23 00:47:09 +00:00
Alexander Koshevoy
e8db488933 Move content of CondaExecutablesLocator object to top level
GitOrigin-RevId: 2e746835595e016b7eae16c971c7ace1a39e9cca
2023-10-23 00:47:09 +00:00
Alexander Koshevoy
4ffa9979e4 Convert pythonName and systemCondaExecutable properties to functions
GitOrigin-RevId: b33371a2ab709363cc69b5d0751a21f836a90c04
2023-10-23 00:47:09 +00:00
Alexander Koshevoy
bdebdb1923 Use List instead of Array for CONDA_DEFAULT_ROOTS constant
GitOrigin-RevId: 4fa9a86abb1d071f1ebbf0be4a36856fb26715ec
2023-10-23 00:47:09 +00:00
Alexander Koshevoy
d925980ca1 Convert CondaExecutablesLocator class from Java to Kotlin
GitOrigin-RevId: 86f8a18dc4cf4c4bb4f0062b3d81c55f78aa18f5
2023-10-23 00:47:09 +00:00
Alexander Koshevoy
7077413e14 Rename .java to .kt
GitOrigin-RevId: a662db0da80d94257be8034981e0c9000e78235f
2023-10-23 00:47:09 +00:00
Alexander Koshevoy
84bbb3881a Extract literals as constants in CondaExecutablesLocator
GitOrigin-RevId: e5303f57bb453d2860e97a7e07578de02b141a33
2023-10-23 00:47:09 +00:00
Alexander Koshevoy
aad564d2a6 Extract utility methods from PyCondaPackageService to CondaExecutablesLocator
GitOrigin-RevId: 0f7f4fc4bd05391501b01f2ad6bca8cf929c7c1c
2023-10-23 00:47:09 +00:00
Alexander Koshevoy
1af4d43d17 Remove deprecation from PyCondaPackageService
There are yet no alternatives to this class.

GitOrigin-RevId: 7116f894c53d338e43d8e19968a4cdc4f75d82dd
2023-10-23 00:47:09 +00:00
Alexander Koshevoy
d8a7e9ae1c Remove unused methods of PyCondaPackageService after removing PyCondaManagementService class
GitOrigin-RevId: aa5341421c5a3121a5aecf1d2abd46114153a498
2023-10-23 00:47:09 +00:00
Andrey Vokin
02e863680e DS-5308: improve dbt init experience
GitOrigin-RevId: 43d346752cedb9d19c6bc3080f1a13c9eaf3abdf
2023-09-26 09:59:53 +00:00
Vladimir Krivosheev
818b0b7776 IJPL-238 Remove unnecessary library "commons-collections"
Removed the "commons-collections" library across multiple modules as it is no longer needed. This clean up helps streamline dependencies and reduce project complexity.

GitOrigin-RevId: 3763cf649644d8782e03b7419d780e245c5f3eef
2023-09-15 20:49:53 +00:00
Ilya.Kazakevich
b708b01a7d Python path validation should support \\wsl paths on Windows.
On Windows user may create project in `\\wsl`

GitOrigin-RevId: 593ecf6440394df6d3034b1ea630c262b6ff26c2
2023-08-11 19:34:35 +00:00
Vladimir Krivosheev
8dd13764a9 IDEA-326151 update hash algo for icons
GitOrigin-RevId: bb8f3acd0314190362619afb86151270b893f082
2023-08-09 14:46:20 +00:00
andrew
8a6a3a0b45 PY-11992: Loosen constraint on Python SDK file name.
(cherry picked from commit 80448a7a579ac0b1f6fe87cc311f1a5840caa7dc)

IJ-CR-111687

GitOrigin-RevId: 79cb6cfa36776bf224c639f08fe1637e81fcec72
2023-08-08 19:04:29 +00:00
Roman Shevchenko
386eee00be [project] replacing custom Path extensions with stdlib/JRE calls
GitOrigin-RevId: 521524062de528211d495d08b32afcd2132d7ebd
2023-08-04 17:11:22 +00:00
Ilya.Kazakevich
2bb2ea60fc Various validation refactorings
`readableFs` is redundant and unstable. Remove it: we will migrate to ijent anyway.
All validations are in `PathValidator.kt` now. They are used by `ManualPathEntryDialog` and sdk validation.
Lots of thread annotations added to prevent calling validation code from EDT.

In general, this change makes path validation ready for ijent: validation based on nio with slow IO access.

Validation is removed from old, non-target classes

(cherry picked from commit 185b4f7fe8cbd5d7a37dad609c8a4cb8163d6eed)

IJ-MR-112281

GitOrigin-RevId: 12c4a4f3d459d0523ef6694a9e4bb2db7a1582b7
2023-08-04 13:42:38 +00:00
Ilya.Kazakevich
45dd3dd86e move WinAppxTools to sdk to make it usable by sdk validation, add test
GitOrigin-RevId: 01db8da280be654313cb78aa8d4b8ee9d52b7fa5
2023-07-29 19:50:26 +00:00
Ilya.Kazakevich
9a7dd26b3b Log "file is not executable" only once.
No need to pollute logs with each call, so we cache calls and log it only once. Circular buffer is used to prevent memory leak

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

GitOrigin-RevId: ab20095f15a69f02cc971627865a65b396a54d64
2023-05-31 21:22:40 +00:00
Vladimir Krivosheev
6dbda83b26 use komihash for icon classes to align rasterized key with a runtime cache key (same algo)
GitOrigin-RevId: fec04acb91d4a69d5c50571d3408c9b0ce3fddd4
2023-03-24 15:49:56 +00:00
Anton Bragin
ab8a0d3508 PY-57410 Use lowercase for conda
GitOrigin-RevId: c049199904a6d48c311a940df5d1f92f6d69586b
2023-03-10 13:45:21 +00:00
Ilya.Kazakevich
2e6c91c3ea DS-4175: Workaround for symlinks on WSL
``/usr/bin/python`` is symlink in many distros and can't be checked via 9P (``\\wsl$``). Hence, we provide ``Unknown`` for such cases.
See issue comment for more info

(cherry picked from commit 529eec2203f21e91c1ebc4f3df5d9b22ce4fcf3b)

IJ-MR-98852

(cherry picked from commit e4954edbc1d87709387ebaaf0a2cac0f150c5d05)

GitOrigin-RevId: d6b4b955a14e38fe217a20f33e6260c050af0984
2023-02-10 22:29:41 +00:00
Tagir Valeev
0892646cb9 Enhanced switch used
GitOrigin-RevId: cf148ceb6c09ad0a00d05475b55113ab36c7a0ac
2023-02-09 11:21:32 +00:00
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