languages: Support terminal auto-activation for `poetry` managed Python environment (#46900)
Xin Zhao
created
Although `poetry` may store virtual environments in a global cache
directory (unlike the standard project-local `.venv`), the internal
directory structure of these environments remains consistent with
standard `venv` or `uv` environments.
Since our existing activation logic for `venv` environments relies on
relative paths within the environment root, it is naturally compatible
with `poetry` environments. Once the toolchain locates the environment's
root directory, the activation scripts can be applied without further
modification.
Testing:
- Verified on Windows: Confirmed working across `PowerShell`, `Pwsh`,
and `Cmd` for global poetry environments.
- Observation: When using an in-project `.venv` directory, the toolchain
may categorize the environment as `venv`-managed instead of
`poetry`-managed. While this behavior relates to the toolchain's
discovery logic, the activation itself remains fully functional as the
underlying structure is compatible.
Release Notes:
- N/A *or* Added/Fixed/Improved ...