Skip to content

Commit 460af40

Browse files
committed
ignore setup.py exit code for known packages
1 parent bffed25 commit 460af40

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

graalpython/lib-graalpython/modules/ginstall.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -487,7 +487,7 @@ def xit(msg, status=-1):
487487
exit(-1)
488488

489489

490-
def _install_from_url(url, patch=None, extra_opts=[], add_cflags=""):
490+
def _install_from_url(url, patch=None, extra_opts=[], add_cflags="", ignore_errors=False):
491491
name = url[url.rfind("/")+1:]
492492
tempdir = tempfile.mkdtemp()
493493

@@ -526,11 +526,11 @@ def _install_from_url(url, patch=None, extra_opts=[], add_cflags=""):
526526
else:
527527
user_arg = ""
528528
status = system("cd %s/%s; %s %s %s setup.py install %s %s" % (tempdir, bare_name, 'CFLAGS="%s"' % cflags if cflags else "", 'CPPFLAGS="%s"' % cppflags if cppflags else "", sys.executable, user_arg, " ".join(extra_opts)))
529-
if status != 0:
529+
if status != 0 and not ignore_errors:
530530
xit("An error occurred trying to run `setup.py install %s %s'" % (user_arg, " ".join(extra_opts)))
531531

532532

533-
def install_from_pypi(package, patch=None, extra_opts=[], add_cflags=""):
533+
def install_from_pypi(package, patch=None, extra_opts=[], add_cflags="", ignore_errors=True):
534534
package_pattern = os.environ.get("GINSTALL_PACKAGE_PATTERN", "https://pypi.org/pypi/%s/json")
535535
package_version_pattern = os.environ.get("GINSTALL_PACKAGE_VERSION_PATTERN", "https://pypi.org/pypi/%s/%s/json")
536536

@@ -556,7 +556,7 @@ def install_from_pypi(package, patch=None, extra_opts=[], add_cflags=""):
556556
break
557557

558558
if url:
559-
_install_from_url(url, patch=patch, extra_opts=extra_opts, add_cflags=add_cflags)
559+
_install_from_url(url, patch=patch, extra_opts=extra_opts, add_cflags=add_cflags, ignore_errors=ignore_errors)
560560
else:
561561
xit("Package not found: '%s'" % package)
562562

@@ -647,7 +647,7 @@ def main(argv):
647647
KNOWN_PACKAGES[pkg]()
648648
elif args.command == "pypi":
649649
for pkg in args.package.split(","):
650-
install_from_pypi(pkg)
650+
install_from_pypi(pkg, ignore_errors=False)
651651

652652

653653

0 commit comments

Comments
 (0)