@@ -64,22 +64,22 @@ def extract_packages(package_names):
64
64
saved_sys_path = sys .path
65
65
sys .path = sys .path [:]
66
66
import pip
67
+ import pip ._vendor .certifi
67
68
sys .path = saved_sys_path
68
69
69
70
import setuptools
70
71
import wheel
71
72
72
-
73
73
def pip_main (argv ):
74
74
# Extract the certificates from the PAR following the example of get-pip.py
75
75
# https://github.com/pypa/get-pip/blob/430ba37776ae2ad89/template.py#L164-L168
76
- # cert_tmpdir = tempfile.mkdtemp()
77
- # cert_path = os.path.join(cert_tmpdir, "cacert.pem")
78
- # atexit.register(lambda: shutil.rmtree(cert_tmpdir, ignore_errors=True))
79
- # with open(cert_path, "wb") as cert:
80
- # cert.write(pkgutil.get_data("pip._vendor.requests ", "cacert.pem"))
81
- # argv = ["--isolated", "--disable-pip-version-check", "--cert", cert_path] + argv
82
- argv = [ "--isolated" , "--disable-pip-version-check" ] + argv
76
+ cert_tmpdir = tempfile .mkdtemp ()
77
+ cert_path = os .path .join (cert_tmpdir , "cacert.pem" )
78
+ atexit .register (lambda : shutil .rmtree (cert_tmpdir , ignore_errors = True ))
79
+ with open (cert_path , "wb" ) as cert :
80
+ cert .write (pkgutil .get_data ("pip._vendor.certifi " , "cacert.pem" ))
81
+ argv = ["--isolated" , "--disable-pip-version-check" , "--cert" , cert_path ] + argv
82
+ pip . _vendor . certifi . where = lambda : cert_path
83
83
return pip .main (argv )
84
84
85
85
from packaging .whl import Wheel
0 commit comments