mirror of
https://github.com/Stone-Red-Code/dvc.git
synced 2026-11-05 15:28:27 +01:00
* tests: isolate dvc config and directories by introducing envvars to change default values. This lets pytest handle the deletion of tmpdirs, instead of filling /var/tmp with hundreds of thousands of directories. Also isolates test run from faulty global/system config files. * move to dvc/env and sort
27 lines
521 B
Python
27 lines
521 B
Python
import os
|
|
|
|
import platformdirs
|
|
|
|
from . import env
|
|
|
|
APPNAME = "dvc"
|
|
APPAUTHOR = "iterative"
|
|
|
|
|
|
def system_config_dir():
|
|
return os.getenv(env.DVC_SYSTEM_CONFIG_DIR) or platformdirs.site_config_dir(
|
|
APPNAME, APPAUTHOR
|
|
)
|
|
|
|
|
|
def global_config_dir():
|
|
return os.getenv(env.DVC_SYSTEM_CONFIG_DIR) or platformdirs.user_config_dir(
|
|
APPNAME, APPAUTHOR
|
|
)
|
|
|
|
|
|
def site_cache_dir():
|
|
return os.getenv(env.DVC_SITE_CACHE_DIR) or platformdirs.site_cache_dir(
|
|
APPNAME, APPAUTHOR, opinion=True
|
|
)
|