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

add support for poetry env remove when virtualenvs.in-project = true #2748

Closed

Conversation

ITProKyle
Copy link
Contributor

Pull Request Check List

Resolves: #2124

  • Added tests for changed code.
  • Updated documentation for changed code.

What Changed

  • poetry env remove argument now defaults to .venv for ease of use with the static value
  • when .venv is passed as the <python> argument and virtualenvs.in-project=true, it will remove the .env directory in the root of the project

@finswimmer finswimmer requested a review from a team August 27, 2020 04:10
@abn
Copy link
Member

abn commented Oct 14, 2020

@ITProKyle Apoligies for dropping the ball on this one. Feel free to ping on discord if something falls through the crack again. We appricate your contribution.

Can you rebase this change with latest master please? Also can we make <python> optional for poetry env remove? Defaulting to activated environment. This will also allow easier removal in the in-project case ase well.

- remove python default value
- split the remove method into smaller methods
- used the logic from remove to create a new method for finding an environment
- remove now uses get to delete the active venv if python is not provided
- remove now uses the new find method to located the venv to remove

TODO update existing tests and write new tests
- method name is now more accurate to its intended functionality
- add test for `env remove` command
- add tests for EnvManager.find
- update some previously added tests to use mocker instead of monkeypatch
@ITProKyle ITProKyle marked this pull request as ready for review November 15, 2020 19:32
@jidicula
Copy link

jidicula commented Jun 7, 2021

@ITProKyle is this PR still alive? I've encountered the bug that this fixes, so it would be great if this fix could get merged 🙂

@ITProKyle
Copy link
Contributor Author

@jidicula - I could probably find some time to update the PR if it were to get reviewed. But, I don't want to waste the time if it's just going to sit for months to the point where I need to spend hours bring it back up to date for the third time.

Not having this functionality is still an annoyance for me as well.

@finswimmer
Copy link
Member

Hello @ITProKyle,

yes please rebase this PR please. Don't hesitate to ping me on Discord for a review.

Thanks a lot for your contribution 👍

fin swimmer

@ryjik
Copy link

ryjik commented Oct 27, 2021

Hi, @ITProKyle @abn @finswimmer !

Is there any chance for this PR to be reviewed and merged? Fixing up this issue manually after every poetry installation/update is pretty inconvenient.

@janwaltl
Copy link

Until this is fixed, simply removing the .venv folder does not seem to break anything with poetry.

@ITProKyle
Copy link
Contributor Author

I really haven't had any time to revisit this to update it so anyone else is free to continue from where I left off.

Not that this isn't annoying and an inconvenience to not have but I have adapted to live without it. I use the following snippet in its absence either per project or the root directory for all my projects to cleanup all virtual environments in one go.

find  -name ".venv" -type d -prune -exec rm -rf '{}' +

@neersighted neersighted self-assigned this Nov 11, 2021
@neersighted
Copy link
Member

Closing for now as this is long out of date/conflicted and poetry env remove --all does this -- special-casing can be added later if desired and will be easier from a clean slate.

@neersighted neersighted mentioned this pull request Sep 18, 2022
2 tasks
Copy link

This pull request 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 Feb 29, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

poetry env remove with virtualenvs.in-project = true
7 participants