From 1cb608d8a71ef5d2acd374813ab6abce39c49135 Mon Sep 17 00:00:00 2001 From: Kuan-Yi Li Date: Thu, 1 Dec 2022 00:04:32 +0800 Subject: [PATCH] allow project name to be fetched from dotenv Look for project name in `self.environ` which includes both `os.environ` and dotenv variables so that the project name can also be defined in an environment file. Signed-off-by: Kuan-Yi Li --- podman_compose.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/podman_compose.py b/podman_compose.py index 4667e46..1a583e6 100755 --- a/podman_compose.py +++ b/podman_compose.py @@ -1541,7 +1541,7 @@ class PodmanCompose: if project_name is None: # More strict then actually needed for simplicity: podman requires [a-zA-Z0-9][a-zA-Z0-9_.-]* project_name = ( - os.environ.get("COMPOSE_PROJECT_NAME", None) or dir_basename.lower() + self.environ.get("COMPOSE_PROJECT_NAME", None) or dir_basename.lower() ) project_name = norm_re.sub("", project_name) if not project_name: