]>
jfr.im git - dlqueue.git/blob - venv/lib/python3.11/site-packages/pip/_vendor/__init__.py
2 pip._vendor is for vendoring dependencies of pip to prevent needing pip to
3 depend on something external.
5 Files inside of pip._vendor should be considered immutable and should only be
6 updated to versions from upstream.
8 from __future__
import absolute_import
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.
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.
23 WHEEL_DIR
= os
.path
.abspath(os
.path
.dirname(__file__
))
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.
29 def vendored(modulename
):
30 vendored_name
= "{0}.{1}".format(__name__
, modulename
)
33 __import__(modulename
, globals(), locals(), level
=0)
35 # We can just silently allow import failures to pass here. If we
36 # got to this point it means that ``import pip._vendor.whatever``
37 # failed and so did ``import whatever``. Since we're importing this
38 # upfront in an attempt to alias imports, not erroring here will
39 # just mean we get a regular import error whenever pip *actually*
40 # tries to import one of these modules to use it, which actually
41 # gives us a better error message than we would have otherwise
45 sys
.modules
[vendored_name
] = sys
.modules
[modulename
]
46 base
, head
= vendored_name
.rsplit(".", 1)
47 setattr(sys
.modules
[base
], head
, sys
.modules
[modulename
])
50 # If we're operating in a debundled setup, then we want to go ahead and trigger
51 # the aliasing of our vendored libraries as well as looking for wheels to add
52 # to our sys.path. This will cause all of this code to be a no-op typically
53 # however downstream redistributors can enable it in a consistent way across
56 # Actually look inside of WHEEL_DIR to find .whl files and add them to the
57 # front of our sys.path.
58 sys
.path
[:] = glob
.glob(os
.path
.join(WHEEL_DIR
, "*.whl")) + sys
.path
60 # Actually alias all of our vendored dependencies.
61 vendored("cachecontrol")
68 vendored("six.moves.urllib")
69 vendored("six.moves.urllib.parse")
71 vendored("packaging.version")
72 vendored("packaging.specifiers")
74 vendored("pkg_resources")
75 vendored("platformdirs")
78 vendored("requests.exceptions")
79 vendored("requests.packages")
80 vendored("requests.packages.urllib3")
81 vendored("requests.packages.urllib3._collections")
82 vendored("requests.packages.urllib3.connection")
83 vendored("requests.packages.urllib3.connectionpool")
84 vendored("requests.packages.urllib3.contrib")
85 vendored("requests.packages.urllib3.contrib.ntlmpool")
86 vendored("requests.packages.urllib3.contrib.pyopenssl")
87 vendored("requests.packages.urllib3.exceptions")
88 vendored("requests.packages.urllib3.fields")
89 vendored("requests.packages.urllib3.filepost")
90 vendored("requests.packages.urllib3.packages")
91 vendored("requests.packages.urllib3.packages.ordered_dict")
92 vendored("requests.packages.urllib3.packages.six")
93 vendored("requests.packages.urllib3.packages.ssl_match_hostname")
94 vendored("requests.packages.urllib3.packages.ssl_match_hostname."
96 vendored("requests.packages.urllib3.poolmanager")
97 vendored("requests.packages.urllib3.request")
98 vendored("requests.packages.urllib3.response")
99 vendored("requests.packages.urllib3.util")
100 vendored("requests.packages.urllib3.util.connection")
101 vendored("requests.packages.urllib3.util.request")
102 vendored("requests.packages.urllib3.util.response")
103 vendored("requests.packages.urllib3.util.retry")
104 vendored("requests.packages.urllib3.util.ssl_")
105 vendored("requests.packages.urllib3.util.timeout")
106 vendored("requests.packages.urllib3.util.url")
107 vendored("resolvelib")
109 vendored("rich.console")
110 vendored("rich.highlighter")
111 vendored("rich.logging")
112 vendored("rich.markup")
113 vendored("rich.progress")
114 vendored("rich.segment")
115 vendored("rich.style")
116 vendored("rich.text")
117 vendored("rich.traceback")