Skip to content

Commit

Permalink
Improve output from pip install and build_docs failures
Browse files Browse the repository at this point in the history
  • Loading branch information
guyer committed Sep 11, 2023
1 parent dd40f5b commit 4171511
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 8 deletions.
17 changes: 10 additions & 7 deletions ntd2d/entrypoint.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,10 @@ def main():
requirements = pathlib.Path(requirements)
if requirements.is_file():
gha_utils.debug(f"pip installing", use_subprocess=True)
subprocess.check_call(["pip", "install", "-r", requirements.as_posix()])
subprocess.run(["pip", "install", "-r", requirements.as_posix()],
bufsize=1,
text=True,
check=True)

# Install any Conda packages requested
environment = os.environ['INPUT_CONDA-ENVIRONMENT']
Expand All @@ -51,14 +54,14 @@ def main():
"--name", "base",
"--solver", "libmamba",
"--file", environment.as_posix()],
bufsize=1,
text=True,
check=True)
bufsize=1,
text=True,
check=True)
subprocess.run(["conda", "list",
"--name", "base"],
bufsize=1,
text=True,
check=True)
bufsize=1,
text=True,
check=True)

# Actually NIST the Docs 2 Death
# This needs to be a subprocess so that it sees packages installed above
Expand Down
5 changes: 4 additions & 1 deletion ntd2d/ntd2d.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,10 @@ def main():
try:
main()
except subprocess.CalledProcessError as e:
gha_utils.error(e.stdout.decode('utf-8'), use_subprocess=True)
if e.stdout is not None:
gha_utils.error(e.stdout.decode('utf-8'), use_subprocess=True)
if e.stderr is not None:
gha_utils.error(e.stderr.decode('utf-8'), use_subprocess=True)
raise
except Exception as e:
gha_utils.error("".join(traceback.format_exception(e)), use_subprocess=True)
Expand Down

0 comments on commit 4171511

Please sign in to comment.