Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 2d26c04

Browse filesBrowse files
Update piptool.py for newer pip version
1 parent 65c56af commit 2d26c04
Copy full SHA for 2d26c04

File tree

Expand file treeCollapse file tree

2 files changed

+8
-8
lines changed
Filter options
Expand file treeCollapse file tree

2 files changed

+8
-8
lines changed

‎packaging/piptool.py

Copy file name to clipboardExpand all lines: packaging/piptool.py
+8-8Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -64,22 +64,22 @@ def extract_packages(package_names):
6464
saved_sys_path = sys.path
6565
sys.path = sys.path[:]
6666
import pip
67+
import pip._vendor.certifi
6768
sys.path = saved_sys_path
6869

6970
import setuptools
7071
import wheel
7172

72-
7373
def pip_main(argv):
7474
# Extract the certificates from the PAR following the example of get-pip.py
7575
# 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
8383
return pip.main(argv)
8484

8585
from packaging.whl import Wheel

‎tools/piptool.par

Copy file name to clipboard
-2 Bytes
Binary file not shown.

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.