Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

poetry env use and poetry env remove are based on the directory name instead of tool.poetry.name #1425

Closed
geryogam opened this issue Sep 30, 2019 · 4 comments
Labels
kind/bug Something isn't working as expected

Comments

@geryogam
Copy link
Contributor

The poetry env use {python} and poetry env remove {python} commands incorrectly use the directory name of a project instead of the tool.poetry.name property of the pyproject.toml file to create/delete a virtual environment.

This clashes with the poetry add, poetry build, poetry install, poetry lock, poetry remove, poetry run, poetry shell, poetry show and poetry update commands which correctly use the tool.poetry.name property of the pyproject.toml file to implicitly create a virtual environment.

Example

For instance if a virtual environment was implicitly created with poetry install (so based on tool.poetry.name):

$ poetry install
Creating virtualenv rule_detection-Yz5oMgHf-py3.7 in C:\Users\maggyero\AppData\Local\pypoetry\Cache\virtualenvs
Using virtualenv: C:\Users\maggyero\AppData\Local\pypoetry\Cache\virtualenvs\{tool.poetry.name}-Yz5oMgHf-py3.7

and then removed with poetry env remove python (so based on the directory name of the project), a ValueError is raised if {directory_name}{tool.poetry.name}:

$ poetry env remove python
[ValueError]
Environment "{directory_name}-Yz5oMgHf-py3.7" does not exist.

FYI @stephsamson @sdispater

@geryogam geryogam added the kind/bug Something isn't working as expected label Sep 30, 2019
@KelSolaar
Copy link

Hi @maggyero,

I have referenced it here: #1417

@sdispater
Copy link
Member

This has been fixed in #1477

@geryogam
Copy link
Contributor Author

Thanks a lot @sdispater!

Copy link

github-actions bot commented Mar 3, 2024

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 3, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
kind/bug Something isn't working as expected
Projects
None yet
Development

No branches or pull requests

4 participants