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
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
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
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
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
``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
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
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
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