Set CONDA_PROMPT_MODIFIER env var when activating conda environment
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 3/5
- Tiempo estimado
- 1-2 días
- Aptitud para principiantes
- 45/100
Línea de trabajo
Start by reading the activation and deactivation paths around the referenced lines in bin/pyenv-sh-activate and bin/pyenv-sh-deactivate. Run the conda-activate.bats, conda-deactivate.bats, activate.bats, and deactivate.bats tests to understand the existing environment-variable expectations. Done means conda activation matches the reported CONDA_PROMPT_MODIFIER behavior and the relevant tests cover activation and deactivation.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Overview
When activating a conda environment manually (eg. conda activate textgen), the following CONDA_* env vars are set in my environment:
⇒ env | grep CONDA
CONDA_EXE=/Users/devalias/.pyenv/versions/miniconda3-latest/bin/conda
_CE_CONDA=
CONDA_PYTHON_EXE=/Users/devalias/.pyenv/versions/miniconda3-latest/bin/python
CONDA_SHLVL=1
CONDA_PROMPT_MODIFIER=(textgen)
CONDA_DEFAULT_ENV=textgen
CONDA_PREFIX=/Users/devalias/.pyenv/versions/miniconda3-latest/envs/textgen
Yet when I use pyenv/pyenv-virtualenv to activate the conda environment, the CONDA_* env vars are different:
⇒ env | grep CONDA
CONDA_EXE=/Users/devalias/.pyenv/versions/miniconda3-latest/bin/conda
_CE_CONDA=
CONDA_PYTHON_EXE=/Users/devalias/.pyenv/versions/miniconda3-latest/bin/python
CONDA_SHLVL=0
CONDA_DEFAULT_ENV=textgen
CONDA_PREFIX=/Users/devalias/.pyenv/versions/miniconda3-latest/envs/textgen
Diffing these it seems that CONDA_SHLVL changes from 0 to 1, and CONDA_PROMPT_MODIFIER isn't set:
CONDA_EXE=/Users/devalias/.pyenv/versions/miniconda3-latest/bin/conda
_CE_CONDA=
CONDA_PYTHON_EXE=/Users/devalias/.pyenv/versions/miniconda3-latest/bin/python
- CONDA_SHLVL=1
+ CONDA_SHLVL=0
- CONDA_PROMPT_MODIFIER=(textgen)
CONDA_DEFAULT_ENV=textgen
CONDA_PREFIX=/Users/devalias/.pyenv/versions/miniconda3-latest/envs/textgen
In the manually activated version, having CONDA_PROMPT_MODIFIER set tells my shell prompt to display the activated conda environment; yet the fact that this isn't set in the automatically activated environment makes it seem as though it isn't working properly, even though I can see that it is based on the activated python version/etc.
It looks like changes would probably have to be made in the following files to implement this, though i'm not 100% sure how easy/hard it would be, or if there are other deeper places I would need to be looking also:
- https://github.com/pyenv/pyenv-virtualenv/blob/master/bin/pyenv-sh-activate#L210
- https://github.com/pyenv/pyenv-virtualenv/blob/master/bin/pyenv-sh-deactivate#L97
- https://github.com/pyenv/pyenv-virtualenv/blob/master/test/conda-activate.bats#L12
- https://github.com/pyenv/pyenv-virtualenv/blob/master/test/conda-deactivate.bats#L11
- https://github.com/pyenv/pyenv-virtualenv/blob/master/test/activate.bats#L11
- https://github.com/pyenv/pyenv-virtualenv/blob/master/test/deactivate.bats#L11
Issue Template
Too many issues will kill our team's development velocity, drastically.
Make sure you have checked all steps below.
Prerequisite
- Make sure your problem is not listed in the common build problems.
- Make sure no duplicated issue has already been reported in the pyenv-virtualenv issues. You should look in closed issues, too.
- Make sure you are not asking us to help solving your specific issue.
- GitHub issues is opened mainly for development purposes. If you want to ask someone to help solving your problem, go to some community site like Gitter, StackOverflow, etc.
- Make sure your problem is not derived from packaging (e.g. Homebrew).
- Please refer to the package documentation for the installation issues, etc.
- Make sure your problem is not derived from other plugins.
- This repository is maintaining the
pyenv-virtualenvplugin only. Please refrain from reporting issues of other plugins here.
- This repository is maintaining the
Description
- Platform information (e.g. Ubuntu Linux 20.04):
macOS Ventura 13.2.1 (22D68) - OS architecture (e.g. amd64):
?x86_64? - pyenv version:
pyenv 2.3.10 - pyenv-virtualenv version:
pyenv-virtualenv 1.1.5 (virtualenv unknown) - Python version:
Python 3.10.9 - virtualenv version (if installed):
pyenv: virtualenv: command not found - Please attach the debug log of a faulty Pyenv invocation as a gist:
N/A
- Lenguaje dominante
- Shell
- Estrellas
- 6.7k
- Forks
- 427
- Métricas de merge de PR
- Sin PR fusionados en 30 d
Preparar el entorno
Este proyecto no incluye contenedor de desarrollo, Dockerfile ni guía de contribución, así que la configuración corre por tu cuenta: empieza por su README y consulta nuestra guía para la primera contribución para los pasos generales.
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de pyenv/pyenv-virtualenv
-
Dificultad 4/5 3-5 días Aptitud para principiantes 35/100
pyenv/pyenv-virtualenv#524 · 5 comentarios ·
-
Dificultad 4/5 3-5 días Aptitud para principiantes 42/100
pyenv/pyenv-virtualenv#515 · 5 comentarios ·
-
Dificultad 5/5 Más de una semana Aptitud para principiantes 25/100
pyenv/pyenv-virtualenv#514 · 1 comentario ·
-
enhancement
Dificultad 5/5 Más de una semana Aptitud para principiantes 35/100
pyenv/pyenv-virtualenv#510 · 5 reacciones ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 25/100
pyenv/pyenv-virtualenv#507 ·
Todos los issues de pyenv/pyenv-virtualenv
Issues similares
-
Feature Needs Triage
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
project-chip/certification-tool#1154 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 84/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 84/100
beehive-lab/TornadoVM#1151 ·
Los mantenedores suelen responder en 1 día
-
writing-plans: user-facing text that describes app behaviour should cite the code it describesAbierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
obra/superpowers#2433 ·
Los mantenedores suelen responder en 5 días
-
area/release kind/bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
kubernetes-sigs/kueue#16455 · 1 comentario ·
Los mantenedores suelen responder en 1 día