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.
.. code-block:: text
.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:
.. code-block:: text
pipx inject tox tox-workdir
If you're using a virtual environment, install tox-workdir as a regular package:
.. code-block:: text
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:
.. code-block:: text
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:
.. code-block:: console
$ du -csh */.tox | tail -n 1
10G total
On Windows, using Powershell:
.. code-block:: console
$ (Get-ChildItem -Recurse */.tox | Measure-Object -Property Length -Sum).Sum / 1GB
10.00000000
Raw data
{
"_id": null,
"home_page": "https://github.com/kurtmckee/tox-workdir",
"name": "tox-workdir",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.9",
"maintainer_email": null,
"keywords": "tox, plugin",
"author": "Kurt McKee",
"author_email": "contactme@kurtmckee.org",
"download_url": "https://files.pythonhosted.org/packages/0d/58/02c5b791b6bf1dd5ceebb3881484bd244f50fa18a113115d240bb0539c28/tox_workdir-0.1.0.tar.gz",
"platform": null,
"description": "tox-workdir\n###########\n\n*Put tox work directories in a cache directory by default.*\n\n----\n\nBy default, tox will create packaging and test environments in a ``.tox/`` subdirectory\nin the same directory as the project's ``tox.ini`` or ``pyproject.toml`` file.\n\n.. code-block:: text\n\n .tox/\n | +-- .pkg/\n | +-- docs/\n | +-- mypy/\n | +-- py39/\n | +-- py310/\n | +-- py311/\n | +-- py312/\n | \\-- py313/\n |\n \\-- tox.ini\n\nAs you interact with more and more projects,\nthose ``.tox/`` directories will proliferate throughout your filesystem.\n\nThis default behavior makes it harder to clean up all of your cached environments\nand can make backups slow (and potentially expensive).\n\ntox-workdir changes the default work directory to point to your user cache directory,\nkeeping your development directories trim and sleek over time.\n\n\nInstallation\n============\n\nIf you're using pipx, inject tox-workdir into your existing tox install:\n\n.. code-block:: text\n\n pipx inject tox tox-workdir\n\nIf you're using a virtual environment, install tox-workdir as a regular package:\n\n.. code-block:: text\n\n pip install tox-workdir\n\nNo configuration is needed;\ninstalling the plugin immediately changes the default ``work_dir`` value.\n\n\nWork directory paths\n====================\n\nWhere tox defaults to ``.tox/``, tox-workdir defaults to your user cache directory:\n\n=================== ===============================================================\nOperating system Base path\n=================== ===============================================================\nLinux ``$XDG_CACHE_DIR/tox-workdir/``\nmacOS ``/Users/{user}/Library/Caches/tox-workdir/``\nWindows ``C:\\Users\\{user}\\AppData\\Local\\kurtmckee\\tox-workdir\\Cache\\``\n=================== ===============================================================\n\nNote that ``$XDG_CACHE_DIR``, above, defaults to ``$HOME/.cache`` if unset.\n\nA hash of the path to the tox config file is used as a subdirectory for uniqueness.\n\nYou can see the ``workdir`` value that will be used by running:\n\n.. code-block:: text\n\n tox workdir\n\n\nFeel-good benefits\n==================\n\nTo feel good about your choice to install this plugin,\nsimply check how much space ``.tox/`` directories are consuming.\nThen, think about how much faster your backups will process\nwithout all of those ``.tox/`` directories!\n\nAssuming that you have a development directory with a number of project directories,\nyou can run one of the following commands to see how much space is consumed\nby ``.tox/`` subdirectories.\n\nOn Linux and macOS:\n\n.. code-block:: console\n\n $ du -csh */.tox | tail -n 1\n 10G total\n\nOn Windows, using Powershell:\n\n.. code-block:: console\n\n $ (Get-ChildItem -Recurse */.tox | Measure-Object -Property Length -Sum).Sum / 1GB\n 10.00000000\n\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "Put tox work directories in a cache directory by default",
"version": "0.1.0",
"project_urls": {
"Homepage": "https://github.com/kurtmckee/tox-workdir",
"Repository": "https://github.com/kurtmckee/tox-workdir"
},
"split_keywords": [
"tox",
" plugin"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "b8faba933d47a1bfd95847a0fc19addc0dbc3b3e712d8f061f6f53b28e00ee4a",
"md5": "9f9d930083795ba056dce4c956d59203",
"sha256": "c210b3e2dc9243e829094aaaed6266c569b34a5990ba65890caa3638e9c67c40"
},
"downloads": -1,
"filename": "tox_workdir-0.1.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "9f9d930083795ba056dce4c956d59203",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.9",
"size": 4268,
"upload_time": "2024-12-21T00:42:31",
"upload_time_iso_8601": "2024-12-21T00:42:31.035839Z",
"url": "https://files.pythonhosted.org/packages/b8/fa/ba933d47a1bfd95847a0fc19addc0dbc3b3e712d8f061f6f53b28e00ee4a/tox_workdir-0.1.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "0d5802c5b791b6bf1dd5ceebb3881484bd244f50fa18a113115d240bb0539c28",
"md5": "a580384e5e13fce50c310701a8056f0f",
"sha256": "9be41c8939468b60f599efb9a0b70a75feef9d1b0ee801470a5e8c57936c9750"
},
"downloads": -1,
"filename": "tox_workdir-0.1.0.tar.gz",
"has_sig": false,
"md5_digest": "a580384e5e13fce50c310701a8056f0f",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.9",
"size": 3986,
"upload_time": "2024-12-21T00:42:33",
"upload_time_iso_8601": "2024-12-21T00:42:33.398545Z",
"url": "https://files.pythonhosted.org/packages/0d/58/02c5b791b6bf1dd5ceebb3881484bd244f50fa18a113115d240bb0539c28/tox_workdir-0.1.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-12-21 00:42:33",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "kurtmckee",
"github_project": "tox-workdir",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"tox": true,
"lcname": "tox-workdir"
}