Commit e70ef0a
[python] Fix incorrect VIRTUAL_ENV in pyenv-mode-set-local-version (#17246)
Remove the erroneous `(setenv "VIRTUAL_ENV" version)` call from
`spacemacs//pyenv-mode-set-local-version`.
This line was introduced in commit e699763 to help Python LSP servers
detect pyenv version changes. However, the implementation was incorrect:
it set `VIRTUAL_ENV` to a bare version string (e.g. "3.13.2") instead
of a filesystem path. The `VIRTUAL_ENV` environment variable, by
convention, should contain the absolute path to a virtualenv directory.
This causes issues in pyenv + Poetry workflows: Poetry reads
`VIRTUAL_ENV` and interprets the version string as a virtualenv path,
leading to errors. The severity depends on hook execution order — if
`spacemacs//python-setup-backend` (which calls `poetry-venv-workon` →
`pyvenv-activate`) runs after the pyenv hook, the bogus value gets
overwritten and the bug is masked; otherwise Poetry breaks.
The `setenv` call is also unnecessary. `pyenv-mode-set` already handles
all required environment setup internally:
- calls `pythonic-activate` with the full path from `pyenv-mode-full-path`
to set `python-shell-virtualenv-root`
- sets `PYENV_VERSION` to the version string
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>1 parent bbce098 commit e70ef0a
1 file changed
+0
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
243 | 243 | | |
244 | 244 | | |
245 | 245 | | |
246 | | - | |
247 | 246 | | |
248 | 247 | | |
249 | 248 | | |
| |||
0 commit comments