Skip to content

CLI command to remove all old environments #1884

@zachvalenta

Description

@zachvalenta

Feature Request

tldr: Is there a way to way to clean up old environments en masse?

context: I often spin up a quick project to explore an idea and then tear it down once I'm past the exploration phase. Using pip, the environment could be co-located to the project i.e. rm <my_project> would also remove the environment. With Poetry, environments are located outside the project, and thus it's possible to delete the project without deleting the environment. As a result, you could have environments at path/to/pypoetry/virtualenvs/ whose projects have been deleted. Currently, Poetry only offers the ability to remove an environment using the CLI from within the project itself; if you've already deleted the project, you need to navigate to path/to/pypoetry/virtualenvs/ and manually remove its hanging environment. It'd be nice if Poetry had a CLI command in which you could remove all environments that no longer correspond to source code directories on the operating system.

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/featureFeature requests/implementations

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions