Commit Graph

138 Commits

Author SHA1 Message Date
Vitaly Legchilkin
09c8981fab Fix Unit tests (PY-64546)
Verifies if there are python distributives for MacOS / Windows on ARM / X86 / X86_64

(cherry picked from commit 717f1a4540d12502e46e3b0fd29b08d2d2043281)

IJ-MR-121650

GitOrigin-RevId: 71ff849618c362bec369372f4952824a454d607d
2023-12-07 16:53:37 +00:00
Vitaly Legchilkin
3e1de3259e Add Python Sdks update script (PY-64546)
also bump sdks.json to latest

(cherry picked from commit 14cc088c20a8b77ee49007d8f7b982920e40c6e6)

IJ-MR-121650

GitOrigin-RevId: db7c0d11a61e239e2f47bd2f1a8dd1156f3712b1
2023-12-07 16:53:33 +00:00
Vitaly Legchilkin
95b312f00e Align python download and install progress text/details with a guideline (PY-64420)
Previous texts were uninformative and didn't comply with our guidelines.

GitOrigin-RevId: ec9f3b6456e504a806c94ff9427f147085be668d
2023-12-04 17:10:54 +00:00
Vitaly Legchilkin
a470903176 Alwats run python installer in the "/repair" mode on windows. (PY-64420)
it prevents failures when the python was installed and deleted previously, or it is in a corrupted state (previous installation was cancelled for example)

GitOrigin-RevId: ca373847db5ed694501da3db6e8a7e88aa15efd5
2023-12-01 23:50:35 +00:00
Vitaly Legchilkin
6f69eaeb7a Don't show errors on prepare cancel action (PY-63083)
+ correct exception handling (remove double wrap)
+ treat cancellation of sudo password request as cancel, not as ExitNonZero

GitOrigin-RevId: baf43c9bb4652b0552899252b5638371715ee7a0
2023-11-28 19:19:26 +00:00
Vitaly Legchilkin
34f3828f5a Redesign of download python sdk (PY-63083)
+ Installer for pkg (MacOS packages)
+ Installer for exe (Windows executable)
- get rid of XCodeSelect installer (command line tools)
* Split PySdkToInstall

(cherry picked from commit c1a0becc70c6e421c48dd03bb80f31b8b7509dfe)

IJ-MR-120874

GitOrigin-RevId: 4fdcaa18c41bcdd0c004fed76de3054683b9ffbd
2023-11-28 09:58:50 +00:00
Alexander Koshevoy
0bf24e60d0 PY-32853 Fix potential NPE in CondaExecutablesLocator
GitOrigin-RevId: 0c10666b2d97610e8ba2e109a86a90f8e1b1e5de
2023-10-23 00:47:10 +00:00
Alexander Koshevoy
b56e3b9b47 PY-32853 Rewrite CondaExecutablesLocator.kt using NIO Paths instead of VirtualFiles
GitOrigin-RevId: e31e36a209c19d9ab26a0fd030ce130a8e732752
2023-10-23 00:47:10 +00:00
Alexander Koshevoy
6ec5aaa128 Cleanup PyCondaPackageService after convertion to Kotlin
GitOrigin-RevId: 1c0983527cf7d76c40b8f7135f139dd63ec453bd
2023-10-23 00:47:09 +00:00
Alexander Koshevoy
20f4cbe128 Convert PyCondaPackageService class from Java to Kotlin
GitOrigin-RevId: 846c924d19fcc4199b506385d7282d7b3fad763c
2023-10-23 00:47:09 +00:00
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