import warnings import subprocess res = subprocess.run(["python3", "setup.py", "build_ext", "--inplace"], cwd="./tdcgal") if res.returncode != 0: warnings.warn(res.stderr.decode()) warnings.warn("Error building toydesigner-cgal") elif res.returncode == 0: print("Successfully built toydesigner-cgal")