`hatch prune env` doesn't prune internal environments
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.
This will be fixed in the next patch release. Do you think it's worth adding a flag like how the env show command doesn't consider internal environments by default?
This will be fixed in the next patch release. Do you think it's worth adding a flag like how the
env showcommand doesn't consider internal environments by default?
I think it makes sense for them to work the same way, so yes, adding a flag for internal environments makes sense. I don't remember if the docs make a distinction between internal and other environments.