Add better debugging if hatch subprocess fails (#1672)
This commit is contained in:
parent
1e89854832
commit
ffbbb4d8e3
|
|
@ -14,6 +14,7 @@
|
||||||
|
|
||||||
import os
|
import os
|
||||||
import subprocess
|
import subprocess
|
||||||
|
from subprocess import CalledProcessError
|
||||||
|
|
||||||
import tomli
|
import tomli
|
||||||
|
|
||||||
|
|
@ -28,12 +29,18 @@ def get_instrumentation_packages():
|
||||||
if not os.path.isdir(pkg_path):
|
if not os.path.isdir(pkg_path):
|
||||||
continue
|
continue
|
||||||
|
|
||||||
version = subprocess.check_output(
|
try:
|
||||||
"hatch version",
|
version = subprocess.check_output(
|
||||||
shell=True,
|
"hatch version",
|
||||||
cwd=pkg_path,
|
shell=True,
|
||||||
universal_newlines=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")
|
pyproject_toml_path = os.path.join(pkg_path, "pyproject.toml")
|
||||||
|
|
||||||
with open(pyproject_toml_path, "rb") as file:
|
with open(pyproject_toml_path, "rb") as file:
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue