From 66078772afae7eb6411ec276c0df542afbe1df5f Mon Sep 17 00:00:00 2001 From: j-ittner Date: Fri, 21 Jun 2024 15:57:25 +0200 Subject: [PATCH] BUILD: explicitly state tox.ini path --- make.py | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/make.py b/make.py index 989dd08..72d02d8 100755 --- a/make.py +++ b/make.py @@ -512,7 +512,7 @@ def build(self, exposed_package_dependencies: Mapping[str, str]) -> None: os.chdir(build_path) # run tox - build_cmd = f"tox -e {tox_env} -v" + build_cmd = f"tox -c '{self._get_tox_ini_path()}' -e {tox_env} -v" log(f"Build Command: {build_cmd}") subprocess.run(args=build_cmd, shell=True, check=True) log("Tox build completed – creating local PyPi index") @@ -552,6 +552,23 @@ def build(self, exposed_package_dependencies: Mapping[str, str]) -> None: finally: os.chdir(original_dir) + def _get_tox_ini_path(self) -> str: + """ + Remove all lines from the tox.ini file that reference environment variables + that we have not exported. + + :return: the path to the resulting temporary tox.ini file + """ + + tox_ini_dir = os.path.join(os.environ[ARTKIT_PATH_ENV], self.project) + + # get the path to tox.ini + tox_ini_path = os.path.abspath( + os.path.join(tox_ini_dir, ToxBuilder.FILE_TOX_INI) + ) + + return tox_ini_path + def get_projects_root_path() -> str: if (ARTKIT_PATH_ENV in os.environ) and os.environ[ARTKIT_PATH_ENV]: