Skip to content

Commit

Permalink
BUILD: explicitly state tox.ini path
Browse files Browse the repository at this point in the history
  • Loading branch information
j-ittner committed Jun 21, 2024
1 parent 18ebc9b commit 6607877
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion make.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down Expand Up @@ -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]:
Expand Down

0 comments on commit 6607877

Please sign in to comment.