Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add an option to not store virtual environments #695

Open
oscarbenjamin opened this issue Mar 1, 2023 · 0 comments
Open

Add an option to not store virtual environments #695

oscarbenjamin opened this issue Mar 1, 2023 · 0 comments

Comments

@oscarbenjamin
Copy link

oscarbenjamin commented Mar 1, 2023

How would this feature be useful?

Maybe I've missed an option that is already there but I would like to be able to configure nox so that it does not store the environments used for the sessions because currently I don't see any benefit from storing them and they use a lot of space.

The situation I have in my dev checkout is like this:

$ du -sh .
710M	.
$ rm -r .nox
$ du -sh .
27M	.

In other words the environments that nox stores in the .nox folder increase the disk usage of my checkout by over an order of magnitude. I intend to add more sessions but that will make it worse. Of the 27M currently used after deleting nox over half is mypy's cache. Working through there are other tools using space. There are actually only 7000 lines in all VCS-tracked files in this repo. The project is tiny but with nox a checkout consumes a gigabyte of disk space!

I have timed how long it takes to run nox before and after deleting the .nox folder and there is no difference. As I understand that is because nox rebuilds each environment every time even if it already exists. I understand why nox does that and in fact that is precisely why I want to use nox in the way that I do. It makes me wonder why the environments are kept at all though. I know there are options like -R to avoid recreating them but in my case using -R tends to be flakey (i.e. it doesn't work properly) so when I use nox I always let it recreate the environments fully.

Is there already a way to tell nox to delete each environment when done using it?

Describe the solution you'd like

Maybe there could be an option somehow to be configured in noxfile to tell nox to delete each environment as soon as the session is complete.

Describe alternatives you've considered

No response

Anything else?

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

1 participant