black/docs/contributing/reference
Perry Vargas 10677baa40
Allow setting custom cache directory on all platforms (#2739)
Fixes #2506

``XDG_CACHE_HOME`` does not work on Windows. To allow for users to set a custom cache directory on all systems I added a new environment variable ``BLACK_CACHE_DIR`` to set the cache directory. The default remains the same so users will only notice a change if that environment variable is set.

The specific use case I have for this is I need to run black on in different processes at the same time. There is a race condition with the cache pickle file that made this rather difficult. A custom cache directory will remove the race condition.

I created ``get_cache_dir`` function in order to test the logic. This is only used to set the ``CACHE_DIR`` constant.
2022-01-21 22:00:33 -08:00
..
reference_classes.rst Fix autodoc refs broken by refactor (#2207) 2021-05-08 21:53:01 +02:00
reference_exceptions.rst Fix autodoc refs broken by refactor (#2207) 2021-05-08 21:53:01 +02:00
reference_functions.rst Allow setting custom cache directory on all platforms (#2739) 2022-01-21 22:00:33 -08:00
reference_summary.rst Reorganize docs v2 (GH-2174) 2021-05-08 15:17:38 -04:00