Skip to content

hatch prune env doesn't prune internal environments #2121

@warsaw

Description

@warsaw

One reason why this is a problem (I think) is that if say your hatch-static-analysis environment was set up to use a version of Python that's no longer on your system, you can end up with errors like this:

/Users/xxx/Library/Application
Support/hatch/env/.internal/hatch-static-analysis/projectjCyxL-Ja/hatch-static-analysis/bin/python3`
  Caused by: Broken symlink at `/Users/xxx/Library/Application
Support/hatch/env/.internal/hatch-static-analysis/project/jCyxL-Ja/hatch-static-analysis/bin/python3`, was the
underlying Python interpreter removed?

This happened to me now that Python 3.9 is EOL'd. The fix is to manually rm the internal hatch environment, but it would be better if hatch env prune did that for you, either automatically or with say a -i flag.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions