Skip to content

Add better debugging if hatch subprocess fails during bootstrap_gen #1672

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 13 additions & 6 deletions scripts/otel_packaging.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@

import os
import subprocess
from subprocess import CalledProcessError

import tomli

Expand All @@ -28,12 +29,18 @@ def get_instrumentation_packages():
if not os.path.isdir(pkg_path):
continue

version = subprocess.check_output(
"hatch version",
shell=True,
cwd=pkg_path,
universal_newlines=True,
)
try:
version = subprocess.check_output(
"hatch version",
shell=True,
cwd=pkg_path,
universal_newlines=True,
)
except CalledProcessError as exc:
print(f"Could not get hatch version from path {pkg_path}")
print(exc.output)
raise exc

pyproject_toml_path = os.path.join(pkg_path, "pyproject.toml")

with open(pyproject_toml_path, "rb") as file:
Expand Down