tox-workdir
Put tox work directories in a cache directory by default.
By default, tox will create packaging and test environments in a .tox/ subdirectory in the same directory as the project’s tox.ini or pyproject.toml file.
.tox/
| +-- .pkg/
| +-- docs/
| +-- mypy/
| +-- py39/
| +-- py310/
| +-- py311/
| +-- py312/
| \-- py313/
|
\-- tox.ini
As you interact with more and more projects, those .tox/ directories will proliferate throughout your filesystem.
This default behavior makes it harder to clean up all of your cached environments and can make backups slow (and potentially expensive).
tox-workdir changes the default work directory to point to your user cache directory, keeping your development directories trim and sleek over time.
Installation
If you’re using pipx, inject tox-workdir into your existing tox install:
pipx inject tox tox-workdir
If you’re using a virtual environment, install tox-workdir as a regular package:
pip install tox-workdir
No configuration is needed; installing the plugin immediately changes the default work_dir value.
Work directory paths
Where tox defaults to .tox/, tox-workdir defaults to your user cache directory:
Operating system |
Base path |
|---|---|
Linux |
$XDG_CACHE_DIR/tox-workdir/ |
macOS |
/Users/{user}/Library/Caches/tox-workdir/ |
Windows |
C:\Users\{user}\AppData\Local\kurtmckee\tox-workdir\Cache\ |
Note that $XDG_CACHE_DIR, above, defaults to $HOME/.cache if unset.
A hash of the path to the tox config file is used as a subdirectory for uniqueness.
You can see the workdir value that will be used by running:
tox workdir
Feel-good benefits
To feel good about your choice to install this plugin, simply check how much space .tox/ directories are consuming. Then, think about how much faster your backups will process without all of those .tox/ directories!
Assuming that you have a development directory with a number of project directories, you can run one of the following commands to see how much space is consumed by .tox/ subdirectories.
On Linux and macOS:
$ du -csh */.tox | tail -n 1
10G total
On Windows, using Powershell:
$ (Get-ChildItem -Recurse */.tox | Measure-Object -Property Length -Sum).Sum / 1GB
10.00000000
Metadata
Release files for tox-workdir 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| tox_workdir-0.1.0.tar.gz | 4.0 kB | Without provenance | Details for tox_workdir-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| tox_workdir-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for tox_workdir-0.1.0-py3-none-any.whl |
Total release size: 8.3 kB
Release files / tox_workdir-0.1.0.tar.gz
| Download URL | tox_workdir-0.1.0.tar.gz |
|---|---|
| Size | 4.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
9be41c8939468b60f599efb9a0b70a75feef9d1b0ee801470a5e8c57936c9750
|
|
BLAKE2b-256 checksum How to use checksums |
0d5802c5b791b6bf1dd5ceebb3881484bd244f50fa18a113115d240bb0539c28
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.0.1 CPython/3.13.1
|
Release files / tox_workdir-0.1.0-py3-none-any.whl
| Download URL | tox_workdir-0.1.0-py3-none-any.whl |
|---|---|
| Size | 4.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
c210b3e2dc9243e829094aaaed6266c569b34a5990ba65890caa3638e9c67c40
|
|
BLAKE2b-256 checksum How to use checksums |
b8faba933d47a1bfd95847a0fc19addc0dbc3b3e712d8f061f6f53b28e00ee4a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.0.1 CPython/3.13.1
|
Security for tox-workdir 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.