Poetry does not automatically switch venvs in venv-activated shells
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 35/100
Línea de trabajo
Empieza reproduciendo el flujo reportado con poetry shell, cd entre los dos proyectos y poetry env info en un shell fish en Ubuntu. El cambio estará terminado cuando al moverse entre proyectos se seleccione automáticamente el entorno virtual correspondiente y el prompt del shell lo refleje, sin requerir poetry env use python.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
- I am on the latest Poetry version.
- I have searched the issues of this repo and believe that this is not a duplicate.
- If an exception occurs when executing a command, I executed it again in debug mode (
-vvvoption).
- OS version and name: Ubuntu 20.04.2 LTS
- Poetry version: 1.1.16
Issue
Create two blank projects
/t/test> poetry new a
Created package a in a
/t/test> poetry new b
Created package b in b
/t/test> cd a
Create a's venv
/t/t/a> poetry shell
Creating virtualenv a-sARTaVSs-py3.8 in ~/.cache/pypoetry/virtualenvs
Spawning shell within ~/.cache/pypoetry/virtualenvs/a-sARTaVSs-py3.8
source ~/.cache/pypoetry/virtualenvs/a-sARTaVSs-py3.8/bin/activate.fish
Welcome to fish, the friendly interactive shell
Type `help` for instructions on how to use fish
(a-sARTaVSs-py3.8) /t/t/a> exit
We quitted a's venv, now create b's
/t/t/a> cd ../b
/t/t/b> poetry shell
Creating virtualenv b-Eo6UuKir-py3.8 in ~/.cache/pypoetry/virtualenvs
Spawning shell within ~/.cache/pypoetry/virtualenvs/b-Eo6UuKir-py3.8
source ~/.cache/pypoetry/virtualenvs/b-Eo6UuKir-py3.8/bin/activate.fish
Welcome to fish, the friendly interactive shell
Type `help` for instructions on how to use fish
We're still in b's venv, now let's go to a's project
(b-Eo6UuKir-py3.8) /t/t/b> cd ../a
(b-Eo6UuKir-py3.8) /t/t/a> poetry env info
Virtualenv
Python: 3.8.5
Implementation: CPython
Path: ~/.cache/pypoetry/virtualenvs/b-Eo6UuKir-py3.8
Valid: True
System
Platform: linux
OS: posix
Python: /usr
Crap, we are still in b's venv... If we run poetry install we'll install a's dependencies in b's venv
But there is a way out, eventhough the prompt is wrong (should be a-sARTaVSs-py3.8)
(b-Eo6UuKir-py3.8) /t/t/a> poetry env use python
Using virtualenv: ~/.cache/pypoetry/virtualenvs/a-sARTaVSs-py3.8
(b-Eo6UuKir-py3.8) /t/t/a> poetry env info
Virtualenv
Python: 3.8.5
Implementation: CPython
Path: ~/.cache/pypoetry/virtualenvs/a-sARTaVSs-py3.8
Valid: True
System
Platform: linux
OS: posix
Python: /usr
Now we are in a's venv (the right one), let's go back to b's project folder
(b-Eo6UuKir-py3.8) /t/t/a> cd ../b
(b-Eo6UuKir-py3.8) /t/t/b> poetry env info
Virtualenv
Python: 3.8.5
Implementation: CPython
Path: ~/.cache/pypoetry/virtualenvs/b-Eo6UuKir-py3.8
Valid: True
System
Platform: linux
OS: posix
Python: /usr
Surprisingly, on the way back everything is alright
- Lenguaje dominante
- Python
- Estrellas
- 141
- Forks
- 10
- Merge medio
- 59 min
- PR fusionados (30 d)
- 3
Preparar el entorno
Aún no hemos revisado los archivos de configuración de este proyecto. 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 python-poetry/poetry-plugin-shell
-
Dificultad 4/5 3-5 días Aptitud para principiantes 20/100
python-poetry/poetry-plugin-shell#43 · 1 comentario · 1 reacción ·
-
Dificultad 3/5 1-2 días Aptitud para principiantes 52/100
python-poetry/poetry-plugin-shell#42 · 4 comentarios · 15 reacciones ·
-
Dificultad 3/5 1-2 días Aptitud para principiantes 38/100
python-poetry/poetry-plugin-shell#40 · 4 comentarios · 2 reacciones ·
-
Dificultad 4/5 3-5 días Aptitud para principiantes 42/100
python-poetry/poetry-plugin-shell#37 · 3 comentarios ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 25/100
python-poetry/poetry-plugin-shell#34 · 1 comentario ·
Todos los issues de python-poetry/poetry-plugin-shell
Issues similares
-
Claiming namespace `apoint`Abiertonamespace operations
Dificultad 1/5 Menos de una hora Aptitud para principiantes 82/100
EclipseFdn/open-vsx.org#13573 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
collective/icalendar#1854 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
rancher/rancher-ai-agent#412 ·
Los mantenedores suelen responder en 6 días
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 84/100
TUDelftGeodesy/DePSI#134 ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 88/100
HenriquesLab/rxiv-maker#335 ·