7

Looking on the tox global settings section from tox documentation, the .tox directory which is working dir, is created in directory where tox.ini is located:

toxworkdir={toxinidir}/.tox(PATH)
    Directory for tox to generate its environments into, will be created if 
    it does not exist.

Is there a way to change this location?

For instance, I have a project as follows:

awesome_project/
├── main.py
├── src
│   └── app.py
└── tox.ini

I want to execute tox.ini from awesome_project dir, but want to write .tox dir in /tmp/.tox not in awesome_project/.tox.

Thanks for help.

2 Answers 2

8

{toxinidir}/.tox is just a default value that you can change in tox.ini:

[tox]
toxworkdir=/tmp/.tox
2
  • 1
    Thanks a lot. It's working. There is also possible set this location per specific environment using envdir variavle.
    – brxie
    Commented Sep 28, 2018 at 8:00
  • 1
    If you have two unrelated projects which use the same toxworkdir, this will cause you trouble. And all files in /tmp get removed after a reboot (at least on linux). I would suggest /var/tmp/MY_PROJECT/.tox
    – guettli
    Commented Aug 4, 2022 at 7:55
1

You can change the working directory from the command line:

tox --workdir /tmp/.tox

It may be useful if you want to use the same tox.ini file in two different computers with different working directories.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.