gregneagle / relocatable-python

A tool for building standalone relocatable Python.framework bundles
Apache License 2.0
156 stars 42 forks source link

tool should fail if any pip installs fail #10

Closed erikng closed 2 years ago

erikng commented 3 years ago

A user could have issues building reloctable-python with their requirements.txt file or just the built in requirements hardcoded into r-p. The usual culprit is pyobjc as of late.

The tool should bail and not create a framework if any of the pip installs fail.

gregneagle commented 3 years ago
    cmd = [python_path, "-s", "-m", "pip", "install", "-r", requirements_file]
    print("Installing modules from %s..." % requirements_file)
    subprocess.check_call(cmd)

The code is using subprocess.check_call, which raises an exception if the command returns non-zero. Since we're not seeing an unhandled exception when pip fails to install something, that implies to me that pip is returning zero even when it fails to install something. This means detecting a pip installation failure is going to be tricky-to-unreliable...

gregneagle commented 3 years ago

Same for the individual pip item installs:

    cmd = [python_path, "-s", "-m", "pip", "install", pkgname]
    print("Installing %s..." % pkgname)
    subprocess.check_call(cmd)
erikng commented 2 years ago

I think at this point there's nothing that can necessarily be done to work around this, but the person using relocatable-python can do extra checks against this (like forcing pyobjc to not use wheels)