Open sneakers-the-rat opened 3 weeks ago
i think it ends up being a lot of space because when developing locally you run the tests a bunch of times as you make changes to the package, so the hashes (i'm assuming) of the pyproject keep changing, so i had like 30 envs for the package
I was wondering why i was running out of space on my laptop, turns out that the tests were creating a ton of hatch environments that were taking up 9GB, and it seemed like every run was creating new environments.
So this PR just temporarily sets the
HATCH_DATA_DIR
to a tmpdir and cleans it up after the test run. pytest removes temporary directories itself, but it keeps them around for a bit, and since they are big i just manually removed them.I added a
--reuse-envs
flag like nox in case someone wanted to keep those around for some reason. Note that these are not the envs created to run the tests in, but the envs that are created when running the tests for the generated packages.