From a98c900213c9372a74fe49577878d6234860a4be Mon Sep 17 00:00:00 2001 From: Srikanth Aithal Date: Fri, 15 May 2026 14:17:32 +0530 Subject: [PATCH] Write avocado.conf to venv config dir inside a virtualenv Honor $VIRTUAL_ENV in AVOCADO_CONFIG_DIR so the file lands where avocado actually reads it. Behaviour outside a venv is unchanged. Signed-off-by: Srikanth Aithal --- avocado-setup.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/avocado-setup.py b/avocado-setup.py index 87e3165..fff1871 100644 --- a/avocado-setup.py +++ b/avocado-setup.py @@ -28,7 +28,8 @@ from lib.logger import logger_init from lib import helper -AVOCADO_CONFIG_DIR = "%s/.config/avocado" % os.environ['HOME'] +_AVOCADO_USER_BASE = os.environ.get("VIRTUAL_ENV") or os.environ['HOME'] +AVOCADO_CONFIG_DIR = "%s/.config/avocado" % _AVOCADO_USER_BASE BASE_PATH = os.path.dirname(os.path.abspath(__file__)) CONFIG_PATH = "%s/config/wrapper/env.conf" % BASE_PATH CONFIGFILE = configparser.ConfigParser()