BLD Make package build output less verbose (#947)

This commit is contained in:
Dexter Chua 2020-12-31 20:19:41 +08:00 committed by GitHub
parent e205121806
commit 57fea1bf74
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 8 additions and 3 deletions

View File

@ -72,10 +72,15 @@ class Package:
stderr=subprocess.STDOUT, stderr=subprocess.STDOUT,
) )
with open(self.pkgdir / "build.log", "r") as f: try:
shutil.copyfileobj(f, sys.stdout) p.check_returncode()
except subprocess.CalledProcessError:
print(f"Error building {self.name}. Printing build logs.")
p.check_returncode() with open(self.pkgdir / "build.log", "r") as f:
shutil.copyfileobj(f, sys.stdout)
raise
if not self.library: if not self.library:
shutil.copyfile( shutil.copyfile(