Use Python module to run Pip

setup.py used systemcalls for package management pip. This call is
platform dependent as on ubuntu distros this needs to be pip3. On these
platforms pip points to the python2 version.

By direct calling the pip module from within the running python process
we know for sure we are triggering the correct one.

Differential revision: https://developer.blender.org/D4952/

Reviewed by: sybren
This commit is contained in:
Jeroen Bakker 2019-05-29 10:28:34 +02:00 committed by Sybren A. Stüvel
parent 985b3f6a7d
commit c457767edf

View File

@ -23,6 +23,7 @@ import shutil
import subprocess
import re
import pathlib
import pip
import zipfile
from distutils import log
@ -121,9 +122,8 @@ class BuildWheels(Command):
def download_wheel(self, requirement):
"""Downloads a wheel from PyPI and saves it in self.wheels_path."""
subprocess.check_call([
'pip', 'download',
pip.main([
'download',
'--no-deps',
'--dest', str(self.wheels_path),
requirement[0]