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 remove does not work with in-project = true #2908

Closed
3 tasks done
ericriff opened this issue Sep 11, 2020 · 6 comments
Closed
3 tasks done

poetry env remove does not work with in-project = true #2908

ericriff opened this issue Sep 11, 2020 · 6 comments
Labels
area/cli Related to the command line area/venv Related to virtualenv management kind/bug Something isn't working as expected

Comments

@ericriff
Copy link

Hi Guys,

I'm using a poetry virtual env with in-project = true to have the environment created inside the project.
Anyways, if I run the command poetry env remove python3 instead of removing .venv it errors out saying that Environment "poetry-project-RoyKdWrW-py3.5" does not exist.

This command does work as expected if we store the environments in the regular cache.

It is a very minor bug since I can always do rm -rf .venv though.

Thanks for the amazing work.

  • 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 (-vvv option).

  • OS version and name: Ubuntu 16.04

  • Poetry version: 1.1.0a2

@ericriff ericriff added kind/bug Something isn't working as expected status/triage This issue needs to be triaged labels Sep 11, 2020
@finswimmer finswimmer added area/cli Related to the command line area/venv Related to virtualenv management labels Sep 15, 2020
@8F3E
Copy link
Contributor

8F3E commented Sep 16, 2020

Think this is because, unlike poetry env list, removal doesn't check for a .venv file if in-project = true. Happy to try and patch.

@ericriff
Copy link
Author

ericriff commented Sep 16, 2020

Thanks for looking into this!
I have another question regardless using in-project = true. This is a very useful feature since it allows us to easily integrate Poetry to our builds with docker/devcontainers since we don't have to mount external folders if we keep the environment in the project root.
The way Poetry implements this (which is the same way Pipenv does it AFAIK) is creating a .venv folder in the root of the project if the in-project flag is set. This has a big limitation compared to using the global cache approach: you can only have one environment "ready to go" at the time, breaking the poetry env use xxx functionality. Usually this is not a problem since a project is locked to a given environment, but there are cases when it would be really cool to have multiple environments ready and switch between them with a simple command. They way it works now means that we have to delete .venv and re-build another environment.
Would it be possible to have something like in-project that makes Poetry generate different environments inside the root of the project?
Like .venv-python3.5, .venv-python3.6.

Thanks!

@8F3E
Copy link
Contributor

8F3E commented Sep 16, 2020

Sounds reasonable. Perhaps open a new issue as it would (I assume) require a change in the way poetry treats in-project = true globally, as opposed to implementing missing functionality?

@max-sixty
Copy link
Contributor

Is this a duplicate of #2124?

@ericriff
Copy link
Author

ericriff commented Oct 14, 2020

In deed it is. I'll close it.

@abn abn removed the status/triage This issue needs to be triaged label Mar 3, 2022
Copy link

github-actions bot commented Mar 2, 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 2, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area/cli Related to the command line area/venv Related to virtualenv management kind/bug Something isn't working as expected
Projects
None yet
Development

No branches or pull requests

5 participants