Poetry does not automatically switch venvs in venv-activated shells
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 35/100
Hướng nghiên cứu
Bắt đầu bằng cách tái hiện quy trình đã được báo cáo với poetry shell, cd giữa hai dự án và poetry env info trong một shell fish trên Ubuntu. Thay đổi được hoàn tất khi việc chuyển đổi giữa các dự án tự động chọn môi trường ảo tương ứng và dấu nhắc shell phản ánh điều đó, mà không cần poetry env use python.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
- 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
- Ngôn ngữ chính
- Python
- Star
- 141
- Fork
- 10
- Merge trung bình
- 59 phút
- Pull request đã merge (30 ngày)
- 3
Chuẩn bị môi trường
Chúng tôi chưa kiểm tra các tệp thiết lập môi trường của dự án này. Hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của python-poetry/poetry-plugin-shell
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 20/100
python-poetry/poetry-plugin-shell#43 · 1 bình luận · 1 reaction ·
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 52/100
python-poetry/poetry-plugin-shell#42 · 4 bình luận · 15 reaction ·
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 38/100
python-poetry/poetry-plugin-shell#40 · 4 bình luận · 2 reaction ·
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 42/100
python-poetry/poetry-plugin-shell#37 · 3 bình luận ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 25/100
python-poetry/poetry-plugin-shell#34 · 1 bình luận ·
Tất cả issue của python-poetry/poetry-plugin-shell
Issue tương tự
-
ACK_WAITING HELP_WANTED UPDATE_CS
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
OWASP/CheatSheetSeries#2458 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 90/100
BasedHardware/omi#19711 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Qwen3_5MoeModel no longer returns router_logits, breaking aux loss with output_router_logits=TrueĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
huggingface/transformers#49172 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
vllm-project/vllm-metal#885 ·
Maintainer thường phản hồi trong vòng 1 ngày