Commit Graph

170 Commits

Author SHA1 Message Date
Egor Eliseev
f910392d5d PY-77160 Poetry/Pipenv modules refactoring
Split pipenv into separate files.
Rewrite functions/methods using coroutines.
Add `internal` or `@Internal`.

Merge-request: IJ-MR-148379
Merged-by: Egor Eliseev <Egor.Eliseev@jetbrains.com>

(cherry picked from commit b398d04bfa358ce97bf1d30d59b2113548e7983c)


Merge-request: IJ-MR-151355
Merged-by: Egor Eliseev <Egor.Eliseev@jetbrains.com>

GitOrigin-RevId: 2cd929fad7649fd6302100b8af5ff7969de8ec3e
2024-12-18 14:01:31 +00:00
Ilya.Kazakevich
02a8b8e3b6 PY-71771: Do not validate SSH interpreters using tools for local paths.
`isValidSdkHome` works for local paths only.
We must use `sdkSeemsValid` instead: it is aware of remote interpreters and usually ignores them if can't validate


(cherry picked from commit 31b42e14518f5a8f7a69ba35e50353f4f4894f42)

IJ-CR-149658

GitOrigin-RevId: b30a6bb5d8a6b9986b0690eabbd0d39da6310f01
2024-11-27 13:48:17 +00:00
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
Nikolay Chashnikov
b03b560520 [python] API cleanup: mark deprecated unused API for removal (IJPL-156972)
Deprecated APIs which still have internal usage are marked as internal to ensure that new external usages won't appear.

GitOrigin-RevId: 09818b884851d7b768f8ee0f356f982e79b46ed9
2024-10-10 23:55:42 +00:00
Ilya.Kazakevich
24be5efa81 PY-76147: Do not call sync tasks on pure EDT.
Use coroutines instead

GitOrigin-RevId: 447a28ae363f88b575b148b2dea931e09f6a4741
2024-09-23 17:06:44 +00:00
Aleksandr Sorotskii
d67337d2c9 fix additional data creation for remote interpreters; (#PY-76055) Fixed
GitOrigin-RevId: 064cbbaeb5f4241b718c9e51df0396b49971a365
2024-09-23 16:37:06 +00:00
Ilya.Kazakevich
14b44d05a6 Python: unused symbol removed
GitOrigin-RevId: 5bcc6542fbc9225629cf7b78e9cfd54cfb6df546
2024-09-20 23:12:02 +00:00
Ilya.Kazakevich
0438f8093b PY-76036 PY-75988 PY-75990 PY-76065: Fix various threading issues after the new platform threading policy
All "implicit" locks are removed from the platform, so we need to call read/write action explicitly (which is a right thing to do in any case).

GitOrigin-RevId: 290788bc78e39ca42f7d0f14ae4ccd16dd315ce7
2024-09-20 23:12:02 +00:00
Yuriy Artamonov
7810bf8adb [python] IJPL-158521 Actions: fix ellipsis in messages for actions
GitOrigin-RevId: c896f17db89f934ae64c24b920ed3684b605d168
2024-09-15 14:50:09 +00:00
Pavel Karateev
62a8794fdb PY-75865 Update Python version on Sep 12, 2024
* 3.12.2 -> 3.12.6
* +3.11.10
* 3.10.14 -> 3.10.15
* 3.9.19 -> 3.9.20
* 3.8.19 -> 3.8.20
* +Miniconda 24.7.1-0
* +Anaconda 2024.06-1
* +Miniconda 24.5.0-0
* +Miniconda 24.4.0-0


(cherry picked from commit 0afd9c5403c37dbe4376e11d01ecb368941adae6)

IJ-MR-144680

GitOrigin-RevId: aeb897013f2ef1c5f753f99210cd186b2344ce95
2024-09-13 11:19:14 +00:00
Egor Eliseev
c23cd17165 PY-74168 Poetry: Check a python version from "pyproject.toml" and from Base interpreter
Implement version tracking for Python specified in pyproject.toml files.
Validate base interpreters using a Python version from pyproject.toml.


Merge-request: IJ-MR-142231
Merged-by: Egor Eliseev <Egor.Eliseev@jetbrains.com>

GitOrigin-RevId: ddd685240b6d58ef8d2e6c5668c89c96d8992d27
2024-09-05 13:15:45 +00:00
Andrei Iurko
f65c970d2d [qodana] QD-9527 Enabled Poetry SDK creation for Poetry projects in headless mode
GitOrigin-RevId: edaab8de048359a95a197989fb2c53068dd21f3e
2024-08-28 13:11:34 +00:00
Aleksandr Sorotskii
1cb0659dad python interpreter should be at least executable but not necessarily called python; PY-60259; PY-11992
(cherry picked from commit a9dd773947b75e850c1e74e209bec9330ae8d74f)

IJ-MR-143222

GitOrigin-RevId: 16f075b18210dbd73a8e04e86282064048c06b99
2024-08-24 00:37:05 +00:00
Aleksandr Sorotskii
81e490cd6f cleanup sdk validation api
GitOrigin-RevId: 33747cf0cfada370181b43d02f203b8401740c5c
2024-08-22 19:03:41 +00:00
Aleksei Kniazev
7e95d1c688 [python] initial step of python interpreter creation unification (PY-73396)
- refactored NPW to use target-specific model
- creating interpreter through widget reuses the same UI (can be turned off by python.unified.interpreter.configuration)
- interpreter discovery and virtualenv creation using Targets API
- no more PyDetectedSdk in dialog


(cherry picked from commit 581b2d40254d26f02eb3aa61bc2e842854b87a3e)

IJ-MR-140986

GitOrigin-RevId: be29188304882ef5f0fb88bb60c538714a2d8746
2024-07-25 18:01:45 +00:00
Ilya.Kazakevich
cc9b394af1 Pycharm: Venv might have UnixPythonSdkFlavor instead of VirtualEnvSdkFlavor on Linux.
`getFlavor(@Nullable String sdkPath)` was used, and it detected the first flavor that is reports `isValidSdkHome`.

Somehow `UnixPythonSdkFlavor` stayed before `VirtualEnvSdkFlavor`.

We now sort them to make platform independent go first (as platform-dependent are always there).

We also use a separate method `tryDetectFlavorByLocalPath` not to use a deprecated one.

GitOrigin-RevId: ee7010e2b4a51d8447bd57264b2ce85af4ea1199
2024-07-24 19:20:28 +00:00
Egor.Eliseev
0be08ded36 [python] Rewrite PythonHelpersLocator
1. `PythonHelpersLocator` is an API to get helpers. It is aware of PyCharm Community helpers but also aware of some EP that provides additional helper paths.
2. EP implementations for PyCharm Prof and Jupyter that provide additional (prof) helpers.
It will help avoid problems with which Locator to use from Professional, Community or Jupiter plugins.


Merge-request: IJ-MR-140027
Merged-by: Egor Eliseev <Egor.Eliseev@jetbrains.com>

GitOrigin-RevId: c7c34f323247002699866f12f6ff5a08cf6a18ff
2024-07-23 12:04:22 +00:00
Egor.Eliseev
58d8eddeb8 PY-73525 Split HelpersLocator into Community/Pro versions
Merge-request: IJ-MR-138058
Merged-by: Egor Eliseev <Egor.Eliseev@jetbrains.com>

GitOrigin-RevId: cd82bc44337e7fdd182262c44ea5ca29e1804ad2
2024-07-02 11:43:46 +00:00
Bernhard Geisberger
c4dccf178c [python] Consider all available flavors when loading PythonSdkAdditionalData
GitOrigin-RevId: e5ea8d2adbb2a28bd5a639898dc2dc9b8cf42a96
2024-06-19 17:17:00 +00:00
Nikita.Ashihmin
886b4f0716 PY-31400 Jupyter: support get envs for Notebook export
GitOrigin-RevId: 0d4f3959e20e0bfbd51236333c24f69eccc7785a
2024-06-07 06:52:08 +00:00
Nikolay Chashnikov
908883714c [python] API cleanup: remove unused deprecated API (IJPL-503)
GitOrigin-RevId: bc9846615603353710cae0b35f362d199de113e8
2024-05-16 18:01:12 +00:00
Vitaly Legchilkin
9a56930105 Use BinaryInstaller for CPython, update sdks registry, remove os field from FUS (PY-71414)
* os field is a reserved field, it is an autofilled field, no need to add it manually.

GitOrigin-RevId: 9506335e17c6e049adce9ebf17352c609739022a
2024-05-11 17:40:47 +00:00
Ilya.Kazakevich
9f06f1a251 PY-71747: Do not fail if remote interpreter has a path with ssh:// prefix.
Some remote interpreters have `sdk#homePath` starting with `ssh://`.

Code all over the monorepo assumes that `homePath` is a local file path and tries to convert it to `Path` throwing the exception effectively.

There is a `isCustomPythonSdkHomePath` which must be used to check string before trying to convert it into `Path`

The current situation (along with "solution") is a legacy from dark ages and will be rewritten to the workspace model soon

GitOrigin-RevId: 9adc02f312667571a65ff63d4e802aa7d6dbb518
2024-05-02 14:20:44 +00:00
Aleksei Kniazev
984183cbea [python] executable cache in PythonSdkFlavor prevents from validating newly installed conda (PY-63084)
(cherry picked from commit 2b7e6c361fd1429f0ce94d271214c5e1f5bca23b)

IJ-MR-129618

GitOrigin-RevId: 55551e94e651a953863e0766419e881220c0a45b
2024-03-21 19:02:35 +00:00
Vitaly Legchilkin
a3a2a5db18 Add Conda (Miniconda/Anaconda) install manager (PY-63084)
Make project optional (PY-63084)

Fix BinaryInstallerUsagesCollector(PY-63084)

* align eventIds according to naming convention
* fix version regex (allow only digits dots and dashes)

Add Conda (Miniconda/Anaconda) install manager (PY-63084)

* refactor python installers
* add conda updater
* create conda sdks registry


Merge-request: IJ-MR-128404
Merged-by: Vitaly Legchilkin <Vitaly.Legchilkin@jetbrains.com>

GitOrigin-RevId: 1e73d1bd32fced94901c4c9a2c1260fca8aca9e2
2024-03-19 00:50:15 +00:00
Nikolay Chashnikov
8856dd6264 API: mark for removal unused deprecated API (IJPL-275)
GitOrigin-RevId: d4f67b9700b60c8eb278ed79baaba4fa01d71fd9
2024-02-16 15:45:57 +00:00
Aleksei Kniazev
d5281a5055 [python] serialization for PyDetectedSdkAdditionalData with TargetEnvironmentConfiguration (PY-65470)
PyDetectedSdk is expected to be serialized only by SdkModificatorBridgeImpl for internal storage
Every time PyDetectedSdk is selected as a project interpreter it should be transformed to a regular SDK

GitOrigin-RevId: 2e38e894014436b8a1a2740ea0fd5dc7aacbe10b
2024-01-24 21:17:58 +00:00
Ilya.Kazakevich
743936d654 [python, ds] remove python.remoteInterpreter -> intellij.python (prof) dependency.
DS doesn't have prof, but should support SSH and WSL

GitOrigin-RevId: 3c0759d64bdd8ce41e939864659177f9ff6cec12
2024-01-18 08:17:56 +00:00
Ilya.Kazakevich
b533e29ce0 [python] get rid of classes registered in wrong modules
You must register class in the same v2 module class sits

GitOrigin-RevId: c7fcccd27c2fcaa3d9391d1173f61ad43fe2b076
2024-01-17 04:59:01 +00:00
Ilya.Kazakevich
b599287e32 [python] Refactor icons layout in community
Icons removed from SDK package (no need to have a separate class for it), ultimate icons moved out of community module.

There are only 3 icon packages in community:
* `PythonParserIcons`
* `PythonPsiApiIcons`
* `PythonIcons` (aka `intellij.python.community.impl`)

Latter two have `.json` mapper to replace old icons with new one for New UI which is included into corresponding `.xml` file.

GitOrigin-RevId: 0438ad4485b5a82a89c81ec63ae6e575d5bb52de
2024-01-12 15:53:48 +00:00
Ilya.Kazakevich
826e478335 [python] Move icons in SDK in the right package
GitOrigin-RevId: fcd5331038928a183665a4869c7ea4e34502f1fb
2024-01-12 10:53:46 +00:00
Vitaly Legchilkin
5dc633a1ab Remove 3.6 & 3.7 python versions from install dialog (PY-65338)
+ bump CPython 3.12.0 -> 3.12.1

GitOrigin-RevId: fc29d8f5b49585a93e819acd1926eb33c141c9b0
2024-01-05 11:32:22 +00:00
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