summaryrefslogtreecommitdiff
path: root/venv/lib/python3.7/site-packages/pip-10.0.1-py3.7.egg/pip/_vendor/__init__.py
diff options
context:
space:
mode:
authorShubham Saini <shubham6405@gmail.com>2018-12-11 10:01:23 +0000
committerShubham Saini <shubham6405@gmail.com>2018-12-11 10:01:23 +0000
commit68df54d6629ec019142eb149dd037774f2d11e7c (patch)
tree345bc22d46b4e01a4ba8303b94278952a4ed2b9e /venv/lib/python3.7/site-packages/pip-10.0.1-py3.7.egg/pip/_vendor/__init__.py
First commit
Diffstat (limited to 'venv/lib/python3.7/site-packages/pip-10.0.1-py3.7.egg/pip/_vendor/__init__.py')
-rw-r--r--venv/lib/python3.7/site-packages/pip-10.0.1-py3.7.egg/pip/_vendor/__init__.py109
1 files changed, 109 insertions, 0 deletions
diff --git a/venv/lib/python3.7/site-packages/pip-10.0.1-py3.7.egg/pip/_vendor/__init__.py b/venv/lib/python3.7/site-packages/pip-10.0.1-py3.7.egg/pip/_vendor/__init__.py
new file mode 100644
index 0000000..607757f
--- /dev/null
+++ b/venv/lib/python3.7/site-packages/pip-10.0.1-py3.7.egg/pip/_vendor/__init__.py
@@ -0,0 +1,109 @@
1"""
2pip._vendor is for vendoring dependencies of pip to prevent needing pip to
3depend on something external.
4
5Files inside of pip._vendor should be considered immutable and should only be
6updated to versions from upstream.
7"""
8from __future__ import absolute_import
9
10import glob
11import os.path
12import sys
13
14# Downstream redistributors which have debundled our dependencies should also
15# patch this value to be true. This will trigger the additional patching
16# to cause things like "six" to be available as pip.
17DEBUNDLED = False
18
19# By default, look in this directory for a bunch of .whl files which we will
20# add to the beginning of sys.path before attempting to import anything. This
21# is done to support downstream re-distributors like Debian and Fedora who
22# wish to create their own Wheels for our dependencies to aid in debundling.
23WHEEL_DIR = os.path.abspath(os.path.dirname(__file__))
24
25
26# Define a small helper function to alias our vendored modules to the real ones
27# if the vendored ones do not exist. This idea of this was taken from
28# https://github.com/kennethreitz/requests/pull/2567.
29def vendored(modulename):
30 vendored_name = "{0}.{1}".format(__name__, modulename)
31
32 try:
33 __import__(vendored_name, globals(), locals(), level=0)
34 except ImportError:
35 try:
36 __import__(modulename, globals(), locals(), level=0)
37 except ImportError:
38 # We can just silently allow import failures to pass here. If we
39 # got to this point it means that ``import pip._vendor.whatever``
40 # failed and so did ``import whatever``. Since we're importing this
41 # upfront in an attempt to alias imports, not erroring here will
42 # just mean we get a regular import error whenever pip *actually*
43 # tries to import one of these modules to use it, which actually
44 # gives us a better error message than we would have otherwise
45 # gotten.
46 pass
47 else:
48 sys.modules[vendored_name] = sys.modules[modulename]
49 base, head = vendored_name.rsplit(".", 1)
50 setattr(sys.modules[base], head, sys.modules[modulename])
51
52
53# If we're operating in a debundled setup, then we want to go ahead and trigger
54# the aliasing of our vendored libraries as well as looking for wheels to add
55# to our sys.path. This will cause all of this code to be a no-op typically
56# however downstream redistributors can enable it in a consistent way across
57# all platforms.
58if DEBUNDLED:
59 # Actually look inside of WHEEL_DIR to find .whl files and add them to the
60 # front of our sys.path.
61 sys.path[:] = glob.glob(os.path.join(WHEEL_DIR, "*.whl")) + sys.path
62
63 # Actually alias all of our vendored dependencies.
64 vendored("cachecontrol")
65 vendored("colorama")
66 vendored("distlib")
67 vendored("distro")
68 vendored("html5lib")
69 vendored("lockfile")
70 vendored("six")
71 vendored("six.moves")
72 vendored("six.moves.urllib")
73 vendored("six.moves.urllib.parse")
74 vendored("packaging")
75 vendored("packaging.version")
76 vendored("packaging.specifiers")
77 vendored("pkg_resources")
78 vendored("progress")
79 vendored("pytoml")
80 vendored("retrying")
81 vendored("requests")
82 vendored("requests.packages")
83 vendored("requests.packages.urllib3")
84 vendored("requests.packages.urllib3._collections")
85 vendored("requests.packages.urllib3.connection")
86 vendored("requests.packages.urllib3.connectionpool")
87 vendored("requests.packages.urllib3.contrib")
88 vendored("requests.packages.urllib3.contrib.ntlmpool")
89 vendored("requests.packages.urllib3.contrib.pyopenssl")
90 vendored("requests.packages.urllib3.exceptions")
91 vendored("requests.packages.urllib3.fields")
92 vendored("requests.packages.urllib3.filepost")
93 vendored("requests.packages.urllib3.packages")
94 vendored("requests.packages.urllib3.packages.ordered_dict")
95 vendored("requests.packages.urllib3.packages.six")
96 vendored("requests.packages.urllib3.packages.ssl_match_hostname")
97 vendored("requests.packages.urllib3.packages.ssl_match_hostname."
98 "_implementation")
99 vendored("requests.packages.urllib3.poolmanager")
100 vendored("requests.packages.urllib3.request")
101 vendored("requests.packages.urllib3.response")
102 vendored("requests.packages.urllib3.util")
103 vendored("requests.packages.urllib3.util.connection")
104 vendored("requests.packages.urllib3.util.request")
105 vendored("requests.packages.urllib3.util.response")
106 vendored("requests.packages.urllib3.util.retry")
107 vendored("requests.packages.urllib3.util.ssl_")
108 vendored("requests.packages.urllib3.util.timeout")
109 vendored("requests.packages.urllib3.util.url")