hatch icon indicating copy to clipboard operation
hatch copied to clipboard

Env creation left incomplete when initial install failed

Open madig opened this issue 2 years ago • 2 comments

On v1.7.0, I tried

  1. Cloning https://github.com/googlefonts/fontra.git
  2. Running hatch run fontra

but I had a too old version of nodejs installed, so the initial installation failed. After installing a nodejs 18, I tried the command again but was told that "fontra" is not a known command. I had to "hatch env prune" and try again. It would be nice if hatch did that automatically when initial craetion fails.

madig avatar Jul 14 '23 10:07 madig

I will do that, thanks!

ofek avatar Jul 14 '23 13:07 ofek

Same thing happened to me on a Windows 11 machine and Hatch version 1.14.0. I ran hatch test for a project, but the build failed due to a permissions error (this one to be exact). I restarted my Command Prompt as Administrator and when re-executing hatch test I no longer got the permissions error, but the Python conftest.py test entry point script failed with a ModuleNotFoundError with the module being the exact one of the project I was trying to run tests for. It took me forever to figure out what was going on, but it was this! I simply had to execute hatch env prune and then hatch test worked immediately after that. Is that not a bug that the broken environment is being cached?

shawncrawley avatar Mar 11 '25 04:03 shawncrawley