Commit Graph

88 Commits

Author SHA1 Message Date
Ilya Kazakevich
056bc17f28 PY-71499: Spaces in a conda env path break terminal action on **nix.
To activate conda on **nix, we provide a path to `active` script and a path to the env directory.

Terminal shell integration scripts then "source" `activate` providing an env path as an argument.

The latter is called `JEDITERM_SOURCE` env var, the former is `JEDITERM_SOURCE_ARGS`.

The problem is those integration scripts treat `JEDITERM_SOURCE_ARGS` as a list, so they use shell magic to break it into several arguments, so `/path/foo bar/` effectively presented as `['/path/foo', 'bar/']`.

To fix it, we introduce the ` JEDITERM_SOURCE_SINGLE_ARG ` key which means "do not explode argument."

(cherry picked from commit a0a7c7a7bc8789078dd6cf109f4fd4386c9b7da6)

IJ-MR-159065

PY-78762: Activate conda in Powershell.

We used to use `Invoke-Expression` but then migrated to `&`.

However, a conda activation script is a command (code block), not a file, so we need to use `Invoke-Expression` as '&' doesn't support it.

We check if a file exists, and if it does -- we use '&' which is safe and fast. We use `Invoke-Expression` otherwise.

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

PY-78762 (partially): Conda activation for PS cleanup:

1. Use a conda path from SDK
2. report error using echo


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

GitOrigin-RevId: b16bd0b1babb1ea3b685daa5697426418356d089
2025-04-23 14:10:26 +00:00
Konstantin Hudyakov
582fb251ce [terminal] Fix PowerShell virtual env customizer test
The meaning of parameters of `LocalShellIntegrationInjector.injectShellIntegration` was changed in the scope of IJPL-176934.
So, the test was running with the shell integration of the New Terminal (Gen1).
Update the values to run it with the Classic Terminal shell integration.
But maybe it is worth adding the same test that will run with Reworked Terminal (Gen2) shell integration.

GitOrigin-RevId: 0bd43d4e1f65c7e42600d18d3b99b4177ea2639d
2025-02-07 08:38:52 +00:00
Vladimir Krivosheev
c3c21baac5 update bazel files
GitOrigin-RevId: 1a10e8174a47f688a95a93af0540f722462acd97
2025-02-03 11:42:18 +00:00
Ilya.Kazakevich
69d4f52dbb Python tests: move venv test fixture into a separate module
We finally decouple test framework from community impl

GitOrigin-RevId: 87178107f2fe785d295aca4cb46527634f465f90
2025-02-02 21:05:54 +00:00
Vladimir Krivosheev
b8245e1370 IJ-CR-146078 update bazel files
GitOrigin-RevId: 3bcfd10f71c84283bded464e142ead99edc6a278
2025-02-02 15:20:11 +00:00
Ilya.Kazakevich
88dc070d16 Python: move classes to access pythons created by setup-env script into right module.
We now store classes to access pythons installed by tests setup env right next to the script

GitOrigin-RevId: 922e5cfbb89e1e550679796e02deb24553ad6852
2025-02-02 07:05:23 +00:00
Ilya.Kazakevich
eab4466488 Python: move VirtualEnvReader out of psi-impl module
GitOrigin-RevId: c4d7bd0bf0c5592b13a2ccffcd217c1bae819637
2025-01-29 21:40:40 +00:00
Vladimir Krivosheev
f565c7eee8 update bazel files
GitOrigin-RevId: 6098b437c6d0239551d19af7bd631f5e372a8b48
2025-01-18 10:56:48 +00:00
Konstantin.Nisht
d100810ce6 [eel] IJPL-172897: Export intellij.platform.eel from intellij.platform.eel.provider, as an API module can be exported from the module with utilities
GitOrigin-RevId: 6819299595d2401de7451929e6e80169a81c5c10
2025-01-17 19:46:01 +00:00
Vladimir Krivosheev
9485392013 update bazel files
GitOrigin-RevId: c4c38c3273b34ae07b97f31a6f7d9ef80e7d6387
2025-01-12 14:08:41 +00:00
Ilya Kazakevich
7a430b2f54 PY-71633: Use call operator to execute PS terminal activation.
See `powershell-integration.ps1`.
Call operator is space-proof and more reliable.

Quote from MSDN:

>>>
Call operator `&`

Runs a command, script, or script block. The call operator, also known as the invocation operator, lets you run commands that are stored in variables and represented by strings or script blocks.
>>>

https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_operators?view=powershell-7.4#call-operator-

We also add tests: as we do not have Windows tests in the platform, we use PyCharm infra.


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

GitOrigin-RevId: 6de26e0d88cff45e30d9354a96b62e8b00c7547a
2025-01-08 23:05:02 +00:00
Vladimir Krivosheev
0bc1cf1557 update bazel files
GitOrigin-RevId: 7320d3eff3aba093692ce66839c720ece6d7c4db
2024-12-30 11:28:24 +00:00
Vladimir Krivosheev
a522f96d66 do not export deps blindly (part 3)
GitOrigin-RevId: 7277ece9ded25f1111febc8dccaba9ac8cc75c21
2024-12-22 20:28:42 +00:00
Vladimir Krivosheev
98799639aa do not use _test as lib - test targets do not support this
GitOrigin-RevId: f2f49db4294b6a64040dbbd5f1d95e972cbd70a3
2024-12-15 18:32:30 +00:00
Vladimir Krivosheev
17916c90f8 libraries -> lib, resources, opt-in, test deps
GitOrigin-RevId: db66ee95dcb0f0553b40c9cc56cd6afed8634cdd
2024-11-27 13:53:42 +00:00
Egor.Eliseev
0c73c9eff9 PY-72274 separating content for python core/pro plugins
1. Delete `intellij.python.community.impl.xml` (move content to `PythonCore` plugin). It is necessary to fix incorrect dependencies: `PythonCore`, `Pythonid` include the same module.
2. Fixed dependencies: if some plugin/module needs Python core functionality, then it should depend on `PythonCore`.


Co-authored-by: Vladimir Koshelev <Vladimir.Koshelev@jetbrains.com>

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

GitOrigin-RevId: ce9ed4c17f601ee1ca2b6cf608f4e30fdac1d879
2024-06-19 21:39:24 +00:00
Konstantin Hudyakov
6a4d2bff4f [terminal] IDEA-342678 Fix PowerShell initialization in projects with virtual env and conda env
GitOrigin-RevId: bffd94a96ffe0d7cf53eb0df6de12b4a41a6b65b
2024-01-29 17:03:15 +00:00
Andrey Cherkasov
1a62d88764 Cleanup: use light services
^IDEA-254577

GitOrigin-RevId: 01afb3f2166f8713cd4599f37d43ecf7f4d2944c
2024-01-23 06:03:51 +00:00
Ilya.Kazakevich
9d4751f238 [python, ds, jupyter]: Migrate Python support to V2
Layout:

  JPS modules
  `intellij.python.community`
  `intellij.python.community.impl`
  `intellij.python.parser`
  `intellij.python.psi`
  `intellij.python.psi.impl`
  `intellij.python.ast`
  use package `com.jetbrains.python`
  and go to `intellij.python.community.impl` v2 module

  JPS module
  `intellij.python`
  uses package `com.intellij.python.pro`
  and goes to `intellij.python/pro` v2 module

  Both v2 modules (along with lots of others) come with
  `PythonId` (prof) or `PythonCore` (community) plugins

  DS bundles  `intellij.python.community.impl`

  Idea and other Mini IDEs get `PythonCore` or `PythonId` plugin that bundle modules for Idea and mini IDEs

GitOrigin-RevId: 98f418c52d90d51b9adf3250c561f2c36c767e2d
2024-01-22 20:26:58 +00:00
Ilya.Kazakevich
5903ec85c4 Migrate python terminal to v2
GitOrigin-RevId: 690d4ead522e2153b89d1ab09ed2026237173160
2023-12-21 21:23:23 +00:00
Sergey Simonchik
5adb20dcc6 terminal: move bash integration to shell-integrations folder (IJ-CR-107365)
GitOrigin-RevId: 1a82bdc56211848e3c7f45d15e13ae2927e84185
2023-05-17 15:43:20 +00:00
Ilya.Kazakevich
93be54fc7d PY-58019: Support `pwsh.exe along with powershell.exe` in terminal activation.
``pwsh.exe`` is a new name for PowerShell 7.1. It is more or less backward compatible

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

GitOrigin-RevId: ddc8606b884a7b93bab93c0fc30e4f4b4230a095
2023-05-10 20:18:32 +00:00
Vladimir Krivosheev
227d75a1fc don't extend DynamicBundle
GitOrigin-RevId: 49cbebd629a92877dbeeffba8d97b0631fb9407e
2023-05-05 09:46:42 +00:00
Ilya.Kazakevich
9f5a2469ad PY-53890: Run powershell with execution policy `RemoteSigned` to support conda in the terminal activation
Merge-request: IJ-MR-104573
Merged-by: Ilya Kazakevich <ilya.kazakevich@jetbrains.com>

GitOrigin-RevId: 92e1ebd9893968ece915c0f1ae12686c7d828ff6
2023-03-14 00:56:38 +00:00
Daniil Ovchinnikov
578eaaf60e rename library kotlin-stdlib-jdk8 -> kotlin-stdlib
GitOrigin-RevId: cddf45ccfd5563d3fe209bea62a1c37c94f44ff9
2023-01-10 12:22:34 +00:00
Valery Teplyakov
ebc066ac2d [fleet] Activate project virtualenv in terminal
FL-10630, FL-15640

GitOrigin-RevId: 3d32440dcf03bd079b29170ea29630849e87a8d2
2022-12-19 02:09:08 +00:00
Vladimir Lagunov
c0d5e73846 PY-57644 Escape characters in PowerShell Conda activator
GitOrigin-RevId: b45b6888327b7aa630106351b3ed673760fb41b7
2022-12-01 14:07:21 +00:00
Andrey Vokin
7fc185917b [PyCharm] use readAction for findSdkForDirectory
GitOrigin-RevId: 28bc6b35c25a212ad0de6490ab19e0696373597d
2022-11-18 14:51:53 +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
50ce0b803b Move conda in separate package (as part of refactoring)
GitOrigin-RevId: 9d93793cba64d0aa8352399cd7dd8a1537aec845
2022-09-26 13:53:11 +00:00
Vladimir Krivosheev
0af2e7b5c5 fix - reduce member visibility (public -> private)
GitOrigin-RevId: fe8a4740e27d192798a9fa55ff41112d1b633e49
2022-09-14 15:09:45 +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
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
Ilya.Kazakevich
3cda641232 PY-54801: Automate conda in PS in terminal activation.
Conda installs user profile hook when user runs ``conda init``.
We call this hook manually

GitOrigin-RevId: 2f2886a1a9ce57e6daa828b0c3133b1265cbcfc6
2022-06-30 15:20:05 +00:00
Ilya.Kazakevich
a225ee6251 PY-53979: Activate Conda with PowerShell in terminal.
Since we don't store conda path in SDK, we only can ask user to run `conda init powershell` to patch her profile and add ``conda.exe`` to ``PATH``.

After that, we can run ``conda activate``.

GitOrigin-RevId: c6cdac9252f022d7bcd1e020c8aaeffaa89b3fbf
2022-05-27 02:45:24 +00:00
Ilya.Kazakevich
e2da8e878b PY-22469: Activate Python venv in terminal when Powershell used as shell
GitOrigin-RevId: 4f5cb12a90d27368ce868852949b45bb0518cce3
2022-02-21 15:05:43 +00:00
Sergey Simonchik
6f75cf62a8 terminal: no need to override getDefaultFolder without changing logic
GitOrigin-RevId: 808955019a3d16863f6a8efe40a9496d8e7accf1
2022-02-21 09:58:28 +00:00
Ilya.Kazakevich
a60c2cd8d6 PY-22469: Activate Python venv in terminal when Powershell used as shell
(cherry picked from commit 8b1071f8fdeb306213e43e8c971ebffb2077aac3)

IJ-CR-20759

GitOrigin-RevId: 8a65ea59b40d5d985b9fb5a7910201d52b5fef04
2022-02-14 15:48:18 +00:00
Sergey Simonchik
2812f1101e terminal: refactor TerminalOptionsProvider
GitOrigin-RevId: 8d13ed2f5aae093ce3323234cb998784ac1a0464
2022-01-10 10:33:09 +00:00
Vladimir Krivosheev
809b7ca201 deprecate ServiceManager.getService(project)
GitOrigin-RevId: 3805c3aac4e084c828558bf1b1570339f7f3b4a3
2021-03-26 21:30:32 +00:00
Tagir Valeev
4d21ad341f Annotate bundle methods as Nls
GitOrigin-RevId: db851b498d99f538e1f747faa4fb4d954848982f
2020-07-17 07:46:42 +00:00
Vladimir Krivosheev
d4e9b09e26 cleanup (final)
GitOrigin-RevId: 93607e195763f2acf29ee0d7a280d7e07e8d2f14
2020-06-26 12:21:17 +03:00
Sergey Simonchik
35004c9344 python: remove unneeded PATH set, shell should add /usr/local/bin to PATH on macOS (IDEA-209282)
GitOrigin-RevId: 637f1dbc5128516adeaa235fcbb537a47b5c39e4
2020-03-26 21:05:36 +00:00
Dmitry.Krasilschikov
a47b8f5a72 Bundle API: rename lazyMessage() to messagePointer()
GitOrigin-RevId: 1b4a35db8900da03fe48d4638362e5ea36cf106b
2020-03-03 16:02:28 +00:00
Alexander Koshevoy
831d39b705 PY-40431 Extract messages from intellij.python.terminal module to the message bundle
GitOrigin-RevId: c0d584eff9d43e03895009bbfbf580ff31c058ed
2020-02-10 14:20:15 +00:00
Stanislav Utikeev
101f0cea62 LAB-31 Extract PySkeletonGenerator to intellij.python.sdk module
GitOrigin-RevId: c3439371efa9a882f1f208b64fb8c0bc31e7b71f
2020-02-10 11:03:00 +00:00
Vladimir Krivosheev
ba98224912 remove author (only some, where it is ok)
GitOrigin-RevId: 7dbab7524fe4efc5d17a04b95dee88b6f80fbe8d
2020-01-21 17:36:52 +00:00
Gregory.Shrago
92f5adff73 PY-38312 Reuse Python plugin in PyCharm
GitOrigin-RevId: 614aecfde6c57cb8f2b99c01c7085c5ae33a1d5d
2019-10-08 17:03:50 +00:00
Alexander Zolotov
4f5dbd65a4 Make python auxiliary plugins incompatible with IntelliJ IDEA as they are bundled into python plugin
+ get rid of python plugin without auxiliary plugins inside

GitOrigin-RevId: 4a74b542be95aa012b7d74755bfffab21c8c0cfe
2019-09-30 15:03:47 +00:00