Initial commit of BGMusic
This commit is contained in:
@@ -0,0 +1,222 @@
|
||||
# don't import any costly modules
|
||||
import sys
|
||||
import os
|
||||
|
||||
|
||||
is_pypy = '__pypy__' in sys.builtin_module_names
|
||||
|
||||
|
||||
def warn_distutils_present():
|
||||
if 'distutils' not in sys.modules:
|
||||
return
|
||||
if is_pypy and sys.version_info < (3, 7):
|
||||
# PyPy for 3.6 unconditionally imports distutils, so bypass the warning
|
||||
# https://foss.heptapod.net/pypy/pypy/-/blob/be829135bc0d758997b3566062999ee8b23872b4/lib-python/3/site.py#L250
|
||||
return
|
||||
import warnings
|
||||
|
||||
warnings.warn(
|
||||
"Distutils was imported before Setuptools, but importing Setuptools "
|
||||
"also replaces the `distutils` module in `sys.modules`. This may lead "
|
||||
"to undesirable behaviors or errors. To avoid these issues, avoid "
|
||||
"using distutils directly, ensure that setuptools is installed in the "
|
||||
"traditional way (e.g. not an editable install), and/or make sure "
|
||||
"that setuptools is always imported before distutils."
|
||||
)
|
||||
|
||||
|
||||
def clear_distutils():
|
||||
if 'distutils' not in sys.modules:
|
||||
return
|
||||
import warnings
|
||||
|
||||
warnings.warn("Setuptools is replacing distutils.")
|
||||
mods = [
|
||||
name
|
||||
for name in sys.modules
|
||||
if name == "distutils" or name.startswith("distutils.")
|
||||
]
|
||||
for name in mods:
|
||||
del sys.modules[name]
|
||||
|
||||
|
||||
def enabled():
|
||||
"""
|
||||
Allow selection of distutils by environment variable.
|
||||
"""
|
||||
which = os.environ.get('SETUPTOOLS_USE_DISTUTILS', 'local')
|
||||
return which == 'local'
|
||||
|
||||
|
||||
def ensure_local_distutils():
|
||||
import importlib
|
||||
|
||||
clear_distutils()
|
||||
|
||||
# With the DistutilsMetaFinder in place,
|
||||
# perform an import to cause distutils to be
|
||||
# loaded from setuptools._distutils. Ref #2906.
|
||||
with shim():
|
||||
importlib.import_module('distutils')
|
||||
|
||||
# check that submodules load as expected
|
||||
core = importlib.import_module('distutils.core')
|
||||
assert '_distutils' in core.__file__, core.__file__
|
||||
assert 'setuptools._distutils.log' not in sys.modules
|
||||
|
||||
|
||||
def do_override():
|
||||
"""
|
||||
Ensure that the local copy of distutils is preferred over stdlib.
|
||||
|
||||
See https://github.com/pypa/setuptools/issues/417#issuecomment-392298401
|
||||
for more motivation.
|
||||
"""
|
||||
if enabled():
|
||||
warn_distutils_present()
|
||||
ensure_local_distutils()
|
||||
|
||||
|
||||
class _TrivialRe:
|
||||
def __init__(self, *patterns):
|
||||
self._patterns = patterns
|
||||
|
||||
def match(self, string):
|
||||
return all(pat in string for pat in self._patterns)
|
||||
|
||||
|
||||
class DistutilsMetaFinder:
|
||||
def find_spec(self, fullname, path, target=None):
|
||||
# optimization: only consider top level modules and those
|
||||
# found in the CPython test suite.
|
||||
if path is not None and not fullname.startswith('test.'):
|
||||
return
|
||||
|
||||
method_name = 'spec_for_{fullname}'.format(**locals())
|
||||
method = getattr(self, method_name, lambda: None)
|
||||
return method()
|
||||
|
||||
def spec_for_distutils(self):
|
||||
if self.is_cpython():
|
||||
return
|
||||
|
||||
import importlib
|
||||
import importlib.abc
|
||||
import importlib.util
|
||||
|
||||
try:
|
||||
mod = importlib.import_module('setuptools._distutils')
|
||||
except Exception:
|
||||
# There are a couple of cases where setuptools._distutils
|
||||
# may not be present:
|
||||
# - An older Setuptools without a local distutils is
|
||||
# taking precedence. Ref #2957.
|
||||
# - Path manipulation during sitecustomize removes
|
||||
# setuptools from the path but only after the hook
|
||||
# has been loaded. Ref #2980.
|
||||
# In either case, fall back to stdlib behavior.
|
||||
return
|
||||
|
||||
class DistutilsLoader(importlib.abc.Loader):
|
||||
def create_module(self, spec):
|
||||
mod.__name__ = 'distutils'
|
||||
return mod
|
||||
|
||||
def exec_module(self, module):
|
||||
pass
|
||||
|
||||
return importlib.util.spec_from_loader(
|
||||
'distutils', DistutilsLoader(), origin=mod.__file__
|
||||
)
|
||||
|
||||
@staticmethod
|
||||
def is_cpython():
|
||||
"""
|
||||
Suppress supplying distutils for CPython (build and tests).
|
||||
Ref #2965 and #3007.
|
||||
"""
|
||||
return os.path.isfile('pybuilddir.txt')
|
||||
|
||||
def spec_for_pip(self):
|
||||
"""
|
||||
Ensure stdlib distutils when running under pip.
|
||||
See pypa/pip#8761 for rationale.
|
||||
"""
|
||||
if self.pip_imported_during_build():
|
||||
return
|
||||
clear_distutils()
|
||||
self.spec_for_distutils = lambda: None
|
||||
|
||||
@classmethod
|
||||
def pip_imported_during_build(cls):
|
||||
"""
|
||||
Detect if pip is being imported in a build script. Ref #2355.
|
||||
"""
|
||||
import traceback
|
||||
|
||||
return any(
|
||||
cls.frame_file_is_setup(frame) for frame, line in traceback.walk_stack(None)
|
||||
)
|
||||
|
||||
@staticmethod
|
||||
def frame_file_is_setup(frame):
|
||||
"""
|
||||
Return True if the indicated frame suggests a setup.py file.
|
||||
"""
|
||||
# some frames may not have __file__ (#2940)
|
||||
return frame.f_globals.get('__file__', '').endswith('setup.py')
|
||||
|
||||
def spec_for_sensitive_tests(self):
|
||||
"""
|
||||
Ensure stdlib distutils when running select tests under CPython.
|
||||
|
||||
python/cpython#91169
|
||||
"""
|
||||
clear_distutils()
|
||||
self.spec_for_distutils = lambda: None
|
||||
|
||||
sensitive_tests = (
|
||||
[
|
||||
'test.test_distutils',
|
||||
'test.test_peg_generator',
|
||||
'test.test_importlib',
|
||||
]
|
||||
if sys.version_info < (3, 10)
|
||||
else [
|
||||
'test.test_distutils',
|
||||
]
|
||||
)
|
||||
|
||||
|
||||
for name in DistutilsMetaFinder.sensitive_tests:
|
||||
setattr(
|
||||
DistutilsMetaFinder,
|
||||
f'spec_for_{name}',
|
||||
DistutilsMetaFinder.spec_for_sensitive_tests,
|
||||
)
|
||||
|
||||
|
||||
DISTUTILS_FINDER = DistutilsMetaFinder()
|
||||
|
||||
|
||||
def add_shim():
|
||||
DISTUTILS_FINDER in sys.meta_path or insert_shim()
|
||||
|
||||
|
||||
class shim:
|
||||
def __enter__(self):
|
||||
insert_shim()
|
||||
|
||||
def __exit__(self, exc, value, tb):
|
||||
remove_shim()
|
||||
|
||||
|
||||
def insert_shim():
|
||||
sys.meta_path.insert(0, DISTUTILS_FINDER)
|
||||
|
||||
|
||||
def remove_shim():
|
||||
try:
|
||||
sys.meta_path.remove(DISTUTILS_FINDER)
|
||||
except ValueError:
|
||||
pass
|
||||
BIN
Binary file not shown.
BIN
Binary file not shown.
@@ -0,0 +1 @@
|
||||
__import__('_distutils_hack').do_override()
|
||||
@@ -0,0 +1 @@
|
||||
import os; var = 'SETUPTOOLS_USE_DISTUTILS'; enabled = os.environ.get(var, 'local') == 'local'; enabled and __import__('_distutils_hack').add_shim();
|
||||
Binary file not shown.
@@ -0,0 +1,5 @@
|
||||
__version__ = "2.1.0"
|
||||
|
||||
|
||||
class MQTTException(Exception):
|
||||
pass
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
Binary file not shown.
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,113 @@
|
||||
import enum
|
||||
|
||||
|
||||
class MQTTErrorCode(enum.IntEnum):
|
||||
MQTT_ERR_AGAIN = -1
|
||||
MQTT_ERR_SUCCESS = 0
|
||||
MQTT_ERR_NOMEM = 1
|
||||
MQTT_ERR_PROTOCOL = 2
|
||||
MQTT_ERR_INVAL = 3
|
||||
MQTT_ERR_NO_CONN = 4
|
||||
MQTT_ERR_CONN_REFUSED = 5
|
||||
MQTT_ERR_NOT_FOUND = 6
|
||||
MQTT_ERR_CONN_LOST = 7
|
||||
MQTT_ERR_TLS = 8
|
||||
MQTT_ERR_PAYLOAD_SIZE = 9
|
||||
MQTT_ERR_NOT_SUPPORTED = 10
|
||||
MQTT_ERR_AUTH = 11
|
||||
MQTT_ERR_ACL_DENIED = 12
|
||||
MQTT_ERR_UNKNOWN = 13
|
||||
MQTT_ERR_ERRNO = 14
|
||||
MQTT_ERR_QUEUE_SIZE = 15
|
||||
MQTT_ERR_KEEPALIVE = 16
|
||||
|
||||
|
||||
class MQTTProtocolVersion(enum.IntEnum):
|
||||
MQTTv31 = 3
|
||||
MQTTv311 = 4
|
||||
MQTTv5 = 5
|
||||
|
||||
|
||||
class CallbackAPIVersion(enum.Enum):
|
||||
"""Defined the arguments passed to all user-callback.
|
||||
|
||||
See each callbacks for details: `on_connect`, `on_connect_fail`, `on_disconnect`, `on_message`, `on_publish`,
|
||||
`on_subscribe`, `on_unsubscribe`, `on_log`, `on_socket_open`, `on_socket_close`,
|
||||
`on_socket_register_write`, `on_socket_unregister_write`
|
||||
"""
|
||||
VERSION1 = 1
|
||||
"""The version used with paho-mqtt 1.x before introducing CallbackAPIVersion.
|
||||
|
||||
This version had different arguments depending if MQTTv5 or MQTTv3 was used. `Properties` & `ReasonCode` were missing
|
||||
on some callback (apply only to MQTTv5).
|
||||
|
||||
This version is deprecated and will be removed in version 3.0.
|
||||
"""
|
||||
VERSION2 = 2
|
||||
""" This version fix some of the shortcoming of previous version.
|
||||
|
||||
Callback have the same signature if using MQTTv5 or MQTTv3. `ReasonCode` are used in MQTTv3.
|
||||
"""
|
||||
|
||||
|
||||
class MessageType(enum.IntEnum):
|
||||
CONNECT = 0x10
|
||||
CONNACK = 0x20
|
||||
PUBLISH = 0x30
|
||||
PUBACK = 0x40
|
||||
PUBREC = 0x50
|
||||
PUBREL = 0x60
|
||||
PUBCOMP = 0x70
|
||||
SUBSCRIBE = 0x80
|
||||
SUBACK = 0x90
|
||||
UNSUBSCRIBE = 0xA0
|
||||
UNSUBACK = 0xB0
|
||||
PINGREQ = 0xC0
|
||||
PINGRESP = 0xD0
|
||||
DISCONNECT = 0xE0
|
||||
AUTH = 0xF0
|
||||
|
||||
|
||||
class LogLevel(enum.IntEnum):
|
||||
MQTT_LOG_INFO = 0x01
|
||||
MQTT_LOG_NOTICE = 0x02
|
||||
MQTT_LOG_WARNING = 0x04
|
||||
MQTT_LOG_ERR = 0x08
|
||||
MQTT_LOG_DEBUG = 0x10
|
||||
|
||||
|
||||
class ConnackCode(enum.IntEnum):
|
||||
CONNACK_ACCEPTED = 0
|
||||
CONNACK_REFUSED_PROTOCOL_VERSION = 1
|
||||
CONNACK_REFUSED_IDENTIFIER_REJECTED = 2
|
||||
CONNACK_REFUSED_SERVER_UNAVAILABLE = 3
|
||||
CONNACK_REFUSED_BAD_USERNAME_PASSWORD = 4
|
||||
CONNACK_REFUSED_NOT_AUTHORIZED = 5
|
||||
|
||||
|
||||
class _ConnectionState(enum.Enum):
|
||||
MQTT_CS_NEW = enum.auto()
|
||||
MQTT_CS_CONNECT_ASYNC = enum.auto()
|
||||
MQTT_CS_CONNECTING = enum.auto()
|
||||
MQTT_CS_CONNECTED = enum.auto()
|
||||
MQTT_CS_CONNECTION_LOST = enum.auto()
|
||||
MQTT_CS_DISCONNECTING = enum.auto()
|
||||
MQTT_CS_DISCONNECTED = enum.auto()
|
||||
|
||||
|
||||
class MessageState(enum.IntEnum):
|
||||
MQTT_MS_INVALID = 0
|
||||
MQTT_MS_PUBLISH = 1
|
||||
MQTT_MS_WAIT_FOR_PUBACK = 2
|
||||
MQTT_MS_WAIT_FOR_PUBREC = 3
|
||||
MQTT_MS_RESEND_PUBREL = 4
|
||||
MQTT_MS_WAIT_FOR_PUBREL = 5
|
||||
MQTT_MS_RESEND_PUBCOMP = 6
|
||||
MQTT_MS_WAIT_FOR_PUBCOMP = 7
|
||||
MQTT_MS_SEND_PUBREC = 8
|
||||
MQTT_MS_QUEUED = 9
|
||||
|
||||
|
||||
class PahoClientMode(enum.IntEnum):
|
||||
MQTT_CLIENT = 0
|
||||
MQTT_BRIDGE = 1
|
||||
@@ -0,0 +1,78 @@
|
||||
class MQTTMatcher:
|
||||
"""Intended to manage topic filters including wildcards.
|
||||
|
||||
Internally, MQTTMatcher use a prefix tree (trie) to store
|
||||
values associated with filters, and has an iter_match()
|
||||
method to iterate efficiently over all filters that match
|
||||
some topic name."""
|
||||
|
||||
class Node:
|
||||
__slots__ = '_children', '_content'
|
||||
|
||||
def __init__(self):
|
||||
self._children = {}
|
||||
self._content = None
|
||||
|
||||
def __init__(self):
|
||||
self._root = self.Node()
|
||||
|
||||
def __setitem__(self, key, value):
|
||||
"""Add a topic filter :key to the prefix tree
|
||||
and associate it to :value"""
|
||||
node = self._root
|
||||
for sym in key.split('/'):
|
||||
node = node._children.setdefault(sym, self.Node())
|
||||
node._content = value
|
||||
|
||||
def __getitem__(self, key):
|
||||
"""Retrieve the value associated with some topic filter :key"""
|
||||
try:
|
||||
node = self._root
|
||||
for sym in key.split('/'):
|
||||
node = node._children[sym]
|
||||
if node._content is None:
|
||||
raise KeyError(key)
|
||||
return node._content
|
||||
except KeyError as ke:
|
||||
raise KeyError(key) from ke
|
||||
|
||||
def __delitem__(self, key):
|
||||
"""Delete the value associated with some topic filter :key"""
|
||||
lst = []
|
||||
try:
|
||||
parent, node = None, self._root
|
||||
for k in key.split('/'):
|
||||
parent, node = node, node._children[k]
|
||||
lst.append((parent, k, node))
|
||||
# TODO
|
||||
node._content = None
|
||||
except KeyError as ke:
|
||||
raise KeyError(key) from ke
|
||||
else: # cleanup
|
||||
for parent, k, node in reversed(lst):
|
||||
if node._children or node._content is not None:
|
||||
break
|
||||
del parent._children[k]
|
||||
|
||||
def iter_match(self, topic):
|
||||
"""Return an iterator on all values associated with filters
|
||||
that match the :topic"""
|
||||
lst = topic.split('/')
|
||||
normal = not topic.startswith('$')
|
||||
def rec(node, i=0):
|
||||
if i == len(lst):
|
||||
if node._content is not None:
|
||||
yield node._content
|
||||
else:
|
||||
part = lst[i]
|
||||
if part in node._children:
|
||||
for content in rec(node._children[part], i + 1):
|
||||
yield content
|
||||
if '+' in node._children and (normal or i > 0):
|
||||
for content in rec(node._children['+'], i + 1):
|
||||
yield content
|
||||
if '#' in node._children and (normal or i > 0):
|
||||
content = node._children['#']._content
|
||||
if content is not None:
|
||||
yield content
|
||||
return rec(self._root)
|
||||
@@ -0,0 +1,43 @@
|
||||
"""
|
||||
*******************************************************************
|
||||
Copyright (c) 2017, 2019 IBM Corp.
|
||||
|
||||
All rights reserved. This program and the accompanying materials
|
||||
are made available under the terms of the Eclipse Public License v2.0
|
||||
and Eclipse Distribution License v1.0 which accompany this distribution.
|
||||
|
||||
The Eclipse Public License is available at
|
||||
http://www.eclipse.org/legal/epl-v20.html
|
||||
and the Eclipse Distribution License is available at
|
||||
http://www.eclipse.org/org/documents/edl-v10.php.
|
||||
|
||||
Contributors:
|
||||
Ian Craggs - initial implementation and/or documentation
|
||||
*******************************************************************
|
||||
"""
|
||||
|
||||
|
||||
class PacketTypes:
|
||||
|
||||
"""
|
||||
Packet types class. Includes the AUTH packet for MQTT v5.0.
|
||||
|
||||
Holds constants for each packet type such as PacketTypes.PUBLISH
|
||||
and packet name strings: PacketTypes.Names[PacketTypes.PUBLISH].
|
||||
|
||||
"""
|
||||
|
||||
indexes = range(1, 16)
|
||||
|
||||
# Packet types
|
||||
CONNECT, CONNACK, PUBLISH, PUBACK, PUBREC, PUBREL, \
|
||||
PUBCOMP, SUBSCRIBE, SUBACK, UNSUBSCRIBE, UNSUBACK, \
|
||||
PINGREQ, PINGRESP, DISCONNECT, AUTH = indexes
|
||||
|
||||
# Dummy packet type for properties use - will delay only applies to will
|
||||
WILLMESSAGE = 99
|
||||
|
||||
Names = ( "reserved", \
|
||||
"Connect", "Connack", "Publish", "Puback", "Pubrec", "Pubrel", \
|
||||
"Pubcomp", "Subscribe", "Suback", "Unsubscribe", "Unsuback", \
|
||||
"Pingreq", "Pingresp", "Disconnect", "Auth")
|
||||
@@ -0,0 +1,421 @@
|
||||
# *******************************************************************
|
||||
# Copyright (c) 2017, 2019 IBM Corp.
|
||||
#
|
||||
# All rights reserved. This program and the accompanying materials
|
||||
# are made available under the terms of the Eclipse Public License v2.0
|
||||
# and Eclipse Distribution License v1.0 which accompany this distribution.
|
||||
#
|
||||
# The Eclipse Public License is available at
|
||||
# http://www.eclipse.org/legal/epl-v20.html
|
||||
# and the Eclipse Distribution License is available at
|
||||
# http://www.eclipse.org/org/documents/edl-v10.php.
|
||||
#
|
||||
# Contributors:
|
||||
# Ian Craggs - initial implementation and/or documentation
|
||||
# *******************************************************************
|
||||
|
||||
import struct
|
||||
|
||||
from .packettypes import PacketTypes
|
||||
|
||||
|
||||
class MQTTException(Exception):
|
||||
pass
|
||||
|
||||
|
||||
class MalformedPacket(MQTTException):
|
||||
pass
|
||||
|
||||
|
||||
def writeInt16(length):
|
||||
# serialize a 16 bit integer to network format
|
||||
return bytearray(struct.pack("!H", length))
|
||||
|
||||
|
||||
def readInt16(buf):
|
||||
# deserialize a 16 bit integer from network format
|
||||
return struct.unpack("!H", buf[:2])[0]
|
||||
|
||||
|
||||
def writeInt32(length):
|
||||
# serialize a 32 bit integer to network format
|
||||
return bytearray(struct.pack("!L", length))
|
||||
|
||||
|
||||
def readInt32(buf):
|
||||
# deserialize a 32 bit integer from network format
|
||||
return struct.unpack("!L", buf[:4])[0]
|
||||
|
||||
|
||||
def writeUTF(data):
|
||||
# data could be a string, or bytes. If string, encode into bytes with utf-8
|
||||
if not isinstance(data, bytes):
|
||||
data = bytes(data, "utf-8")
|
||||
return writeInt16(len(data)) + data
|
||||
|
||||
|
||||
def readUTF(buffer, maxlen):
|
||||
if maxlen >= 2:
|
||||
length = readInt16(buffer)
|
||||
else:
|
||||
raise MalformedPacket("Not enough data to read string length")
|
||||
maxlen -= 2
|
||||
if length > maxlen:
|
||||
raise MalformedPacket("Length delimited string too long")
|
||||
buf = buffer[2:2+length].decode("utf-8")
|
||||
# look for chars which are invalid for MQTT
|
||||
for c in buf: # look for D800-DFFF in the UTF string
|
||||
ord_c = ord(c)
|
||||
if ord_c >= 0xD800 and ord_c <= 0xDFFF:
|
||||
raise MalformedPacket("[MQTT-1.5.4-1] D800-DFFF found in UTF-8 data")
|
||||
if ord_c == 0x00: # look for null in the UTF string
|
||||
raise MalformedPacket("[MQTT-1.5.4-2] Null found in UTF-8 data")
|
||||
if ord_c == 0xFEFF:
|
||||
raise MalformedPacket("[MQTT-1.5.4-3] U+FEFF in UTF-8 data")
|
||||
return buf, length+2
|
||||
|
||||
|
||||
def writeBytes(buffer):
|
||||
return writeInt16(len(buffer)) + buffer
|
||||
|
||||
|
||||
def readBytes(buffer):
|
||||
length = readInt16(buffer)
|
||||
return buffer[2:2+length], length+2
|
||||
|
||||
|
||||
class VariableByteIntegers: # Variable Byte Integer
|
||||
"""
|
||||
MQTT variable byte integer helper class. Used
|
||||
in several places in MQTT v5.0 properties.
|
||||
|
||||
"""
|
||||
|
||||
@staticmethod
|
||||
def encode(x):
|
||||
"""
|
||||
Convert an integer 0 <= x <= 268435455 into multi-byte format.
|
||||
Returns the buffer converted from the integer.
|
||||
"""
|
||||
if not 0 <= x <= 268435455:
|
||||
raise ValueError(f"Value {x!r} must be in range 0-268435455")
|
||||
buffer = b''
|
||||
while 1:
|
||||
digit = x % 128
|
||||
x //= 128
|
||||
if x > 0:
|
||||
digit |= 0x80
|
||||
buffer += bytes([digit])
|
||||
if x == 0:
|
||||
break
|
||||
return buffer
|
||||
|
||||
@staticmethod
|
||||
def decode(buffer):
|
||||
"""
|
||||
Get the value of a multi-byte integer from a buffer
|
||||
Return the value, and the number of bytes used.
|
||||
|
||||
[MQTT-1.5.5-1] the encoded value MUST use the minimum number of bytes necessary to represent the value
|
||||
"""
|
||||
multiplier = 1
|
||||
value = 0
|
||||
bytes = 0
|
||||
while 1:
|
||||
bytes += 1
|
||||
digit = buffer[0]
|
||||
buffer = buffer[1:]
|
||||
value += (digit & 127) * multiplier
|
||||
if digit & 128 == 0:
|
||||
break
|
||||
multiplier *= 128
|
||||
return (value, bytes)
|
||||
|
||||
|
||||
class Properties:
|
||||
"""MQTT v5.0 properties class.
|
||||
|
||||
See Properties.names for a list of accepted property names along with their numeric values.
|
||||
|
||||
See Properties.properties for the data type of each property.
|
||||
|
||||
Example of use::
|
||||
|
||||
publish_properties = Properties(PacketTypes.PUBLISH)
|
||||
publish_properties.UserProperty = ("a", "2")
|
||||
publish_properties.UserProperty = ("c", "3")
|
||||
|
||||
First the object is created with packet type as argument, no properties will be present at
|
||||
this point. Then properties are added as attributes, the name of which is the string property
|
||||
name without the spaces.
|
||||
|
||||
"""
|
||||
|
||||
def __init__(self, packetType):
|
||||
self.packetType = packetType
|
||||
self.types = ["Byte", "Two Byte Integer", "Four Byte Integer", "Variable Byte Integer",
|
||||
"Binary Data", "UTF-8 Encoded String", "UTF-8 String Pair"]
|
||||
|
||||
self.names = {
|
||||
"Payload Format Indicator": 1,
|
||||
"Message Expiry Interval": 2,
|
||||
"Content Type": 3,
|
||||
"Response Topic": 8,
|
||||
"Correlation Data": 9,
|
||||
"Subscription Identifier": 11,
|
||||
"Session Expiry Interval": 17,
|
||||
"Assigned Client Identifier": 18,
|
||||
"Server Keep Alive": 19,
|
||||
"Authentication Method": 21,
|
||||
"Authentication Data": 22,
|
||||
"Request Problem Information": 23,
|
||||
"Will Delay Interval": 24,
|
||||
"Request Response Information": 25,
|
||||
"Response Information": 26,
|
||||
"Server Reference": 28,
|
||||
"Reason String": 31,
|
||||
"Receive Maximum": 33,
|
||||
"Topic Alias Maximum": 34,
|
||||
"Topic Alias": 35,
|
||||
"Maximum QoS": 36,
|
||||
"Retain Available": 37,
|
||||
"User Property": 38,
|
||||
"Maximum Packet Size": 39,
|
||||
"Wildcard Subscription Available": 40,
|
||||
"Subscription Identifier Available": 41,
|
||||
"Shared Subscription Available": 42
|
||||
}
|
||||
|
||||
self.properties = {
|
||||
# id: type, packets
|
||||
# payload format indicator
|
||||
1: (self.types.index("Byte"), [PacketTypes.PUBLISH, PacketTypes.WILLMESSAGE]),
|
||||
2: (self.types.index("Four Byte Integer"), [PacketTypes.PUBLISH, PacketTypes.WILLMESSAGE]),
|
||||
3: (self.types.index("UTF-8 Encoded String"), [PacketTypes.PUBLISH, PacketTypes.WILLMESSAGE]),
|
||||
8: (self.types.index("UTF-8 Encoded String"), [PacketTypes.PUBLISH, PacketTypes.WILLMESSAGE]),
|
||||
9: (self.types.index("Binary Data"), [PacketTypes.PUBLISH, PacketTypes.WILLMESSAGE]),
|
||||
11: (self.types.index("Variable Byte Integer"),
|
||||
[PacketTypes.PUBLISH, PacketTypes.SUBSCRIBE]),
|
||||
17: (self.types.index("Four Byte Integer"),
|
||||
[PacketTypes.CONNECT, PacketTypes.CONNACK, PacketTypes.DISCONNECT]),
|
||||
18: (self.types.index("UTF-8 Encoded String"), [PacketTypes.CONNACK]),
|
||||
19: (self.types.index("Two Byte Integer"), [PacketTypes.CONNACK]),
|
||||
21: (self.types.index("UTF-8 Encoded String"),
|
||||
[PacketTypes.CONNECT, PacketTypes.CONNACK, PacketTypes.AUTH]),
|
||||
22: (self.types.index("Binary Data"),
|
||||
[PacketTypes.CONNECT, PacketTypes.CONNACK, PacketTypes.AUTH]),
|
||||
23: (self.types.index("Byte"),
|
||||
[PacketTypes.CONNECT]),
|
||||
24: (self.types.index("Four Byte Integer"), [PacketTypes.WILLMESSAGE]),
|
||||
25: (self.types.index("Byte"), [PacketTypes.CONNECT]),
|
||||
26: (self.types.index("UTF-8 Encoded String"), [PacketTypes.CONNACK]),
|
||||
28: (self.types.index("UTF-8 Encoded String"),
|
||||
[PacketTypes.CONNACK, PacketTypes.DISCONNECT]),
|
||||
31: (self.types.index("UTF-8 Encoded String"),
|
||||
[PacketTypes.CONNACK, PacketTypes.PUBACK, PacketTypes.PUBREC,
|
||||
PacketTypes.PUBREL, PacketTypes.PUBCOMP, PacketTypes.SUBACK,
|
||||
PacketTypes.UNSUBACK, PacketTypes.DISCONNECT, PacketTypes.AUTH]),
|
||||
33: (self.types.index("Two Byte Integer"),
|
||||
[PacketTypes.CONNECT, PacketTypes.CONNACK]),
|
||||
34: (self.types.index("Two Byte Integer"),
|
||||
[PacketTypes.CONNECT, PacketTypes.CONNACK]),
|
||||
35: (self.types.index("Two Byte Integer"), [PacketTypes.PUBLISH]),
|
||||
36: (self.types.index("Byte"), [PacketTypes.CONNACK]),
|
||||
37: (self.types.index("Byte"), [PacketTypes.CONNACK]),
|
||||
38: (self.types.index("UTF-8 String Pair"),
|
||||
[PacketTypes.CONNECT, PacketTypes.CONNACK,
|
||||
PacketTypes.PUBLISH, PacketTypes.PUBACK,
|
||||
PacketTypes.PUBREC, PacketTypes.PUBREL, PacketTypes.PUBCOMP,
|
||||
PacketTypes.SUBSCRIBE, PacketTypes.SUBACK,
|
||||
PacketTypes.UNSUBSCRIBE, PacketTypes.UNSUBACK,
|
||||
PacketTypes.DISCONNECT, PacketTypes.AUTH, PacketTypes.WILLMESSAGE]),
|
||||
39: (self.types.index("Four Byte Integer"),
|
||||
[PacketTypes.CONNECT, PacketTypes.CONNACK]),
|
||||
40: (self.types.index("Byte"), [PacketTypes.CONNACK]),
|
||||
41: (self.types.index("Byte"), [PacketTypes.CONNACK]),
|
||||
42: (self.types.index("Byte"), [PacketTypes.CONNACK]),
|
||||
}
|
||||
|
||||
def allowsMultiple(self, compressedName):
|
||||
return self.getIdentFromName(compressedName) in [11, 38]
|
||||
|
||||
def getIdentFromName(self, compressedName):
|
||||
# return the identifier corresponding to the property name
|
||||
result = -1
|
||||
for name in self.names.keys():
|
||||
if compressedName == name.replace(' ', ''):
|
||||
result = self.names[name]
|
||||
break
|
||||
return result
|
||||
|
||||
def __setattr__(self, name, value):
|
||||
name = name.replace(' ', '')
|
||||
privateVars = ["packetType", "types", "names", "properties"]
|
||||
if name in privateVars:
|
||||
object.__setattr__(self, name, value)
|
||||
else:
|
||||
# the name could have spaces in, or not. Remove spaces before assignment
|
||||
if name not in [aname.replace(' ', '') for aname in self.names.keys()]:
|
||||
raise MQTTException(
|
||||
f"Property name must be one of {self.names.keys()}")
|
||||
# check that this attribute applies to the packet type
|
||||
if self.packetType not in self.properties[self.getIdentFromName(name)][1]:
|
||||
raise MQTTException(f"Property {name} does not apply to packet type {PacketTypes.Names[self.packetType]}")
|
||||
|
||||
# Check for forbidden values
|
||||
if not isinstance(value, list):
|
||||
if name in ["ReceiveMaximum", "TopicAlias"] \
|
||||
and (value < 1 or value > 65535):
|
||||
|
||||
raise MQTTException(f"{name} property value must be in the range 1-65535")
|
||||
elif name in ["TopicAliasMaximum"] \
|
||||
and (value < 0 or value > 65535):
|
||||
|
||||
raise MQTTException(f"{name} property value must be in the range 0-65535")
|
||||
elif name in ["MaximumPacketSize", "SubscriptionIdentifier"] \
|
||||
and (value < 1 or value > 268435455):
|
||||
|
||||
raise MQTTException(f"{name} property value must be in the range 1-268435455")
|
||||
elif name in ["RequestResponseInformation", "RequestProblemInformation", "PayloadFormatIndicator"] \
|
||||
and (value != 0 and value != 1):
|
||||
|
||||
raise MQTTException(
|
||||
f"{name} property value must be 0 or 1")
|
||||
|
||||
if self.allowsMultiple(name):
|
||||
if not isinstance(value, list):
|
||||
value = [value]
|
||||
if hasattr(self, name):
|
||||
value = object.__getattribute__(self, name) + value
|
||||
object.__setattr__(self, name, value)
|
||||
|
||||
def __str__(self):
|
||||
buffer = "["
|
||||
first = True
|
||||
for name in self.names.keys():
|
||||
compressedName = name.replace(' ', '')
|
||||
if hasattr(self, compressedName):
|
||||
if not first:
|
||||
buffer += ", "
|
||||
buffer += f"{compressedName} : {getattr(self, compressedName)}"
|
||||
first = False
|
||||
buffer += "]"
|
||||
return buffer
|
||||
|
||||
def json(self):
|
||||
data = {}
|
||||
for name in self.names.keys():
|
||||
compressedName = name.replace(' ', '')
|
||||
if hasattr(self, compressedName):
|
||||
val = getattr(self, compressedName)
|
||||
if compressedName == 'CorrelationData' and isinstance(val, bytes):
|
||||
data[compressedName] = val.hex()
|
||||
else:
|
||||
data[compressedName] = val
|
||||
return data
|
||||
|
||||
def isEmpty(self):
|
||||
rc = True
|
||||
for name in self.names.keys():
|
||||
compressedName = name.replace(' ', '')
|
||||
if hasattr(self, compressedName):
|
||||
rc = False
|
||||
break
|
||||
return rc
|
||||
|
||||
def clear(self):
|
||||
for name in self.names.keys():
|
||||
compressedName = name.replace(' ', '')
|
||||
if hasattr(self, compressedName):
|
||||
delattr(self, compressedName)
|
||||
|
||||
def writeProperty(self, identifier, type, value):
|
||||
buffer = b""
|
||||
buffer += VariableByteIntegers.encode(identifier) # identifier
|
||||
if type == self.types.index("Byte"): # value
|
||||
buffer += bytes([value])
|
||||
elif type == self.types.index("Two Byte Integer"):
|
||||
buffer += writeInt16(value)
|
||||
elif type == self.types.index("Four Byte Integer"):
|
||||
buffer += writeInt32(value)
|
||||
elif type == self.types.index("Variable Byte Integer"):
|
||||
buffer += VariableByteIntegers.encode(value)
|
||||
elif type == self.types.index("Binary Data"):
|
||||
buffer += writeBytes(value)
|
||||
elif type == self.types.index("UTF-8 Encoded String"):
|
||||
buffer += writeUTF(value)
|
||||
elif type == self.types.index("UTF-8 String Pair"):
|
||||
buffer += writeUTF(value[0]) + writeUTF(value[1])
|
||||
return buffer
|
||||
|
||||
def pack(self):
|
||||
# serialize properties into buffer for sending over network
|
||||
buffer = b""
|
||||
for name in self.names.keys():
|
||||
compressedName = name.replace(' ', '')
|
||||
if hasattr(self, compressedName):
|
||||
identifier = self.getIdentFromName(compressedName)
|
||||
attr_type = self.properties[identifier][0]
|
||||
if self.allowsMultiple(compressedName):
|
||||
for prop in getattr(self, compressedName):
|
||||
buffer += self.writeProperty(identifier,
|
||||
attr_type, prop)
|
||||
else:
|
||||
buffer += self.writeProperty(identifier, attr_type,
|
||||
getattr(self, compressedName))
|
||||
return VariableByteIntegers.encode(len(buffer)) + buffer
|
||||
|
||||
def readProperty(self, buffer, type, propslen):
|
||||
if type == self.types.index("Byte"):
|
||||
value = buffer[0]
|
||||
valuelen = 1
|
||||
elif type == self.types.index("Two Byte Integer"):
|
||||
value = readInt16(buffer)
|
||||
valuelen = 2
|
||||
elif type == self.types.index("Four Byte Integer"):
|
||||
value = readInt32(buffer)
|
||||
valuelen = 4
|
||||
elif type == self.types.index("Variable Byte Integer"):
|
||||
value, valuelen = VariableByteIntegers.decode(buffer)
|
||||
elif type == self.types.index("Binary Data"):
|
||||
value, valuelen = readBytes(buffer)
|
||||
elif type == self.types.index("UTF-8 Encoded String"):
|
||||
value, valuelen = readUTF(buffer, propslen)
|
||||
elif type == self.types.index("UTF-8 String Pair"):
|
||||
value, valuelen = readUTF(buffer, propslen)
|
||||
buffer = buffer[valuelen:] # strip the bytes used by the value
|
||||
value1, valuelen1 = readUTF(buffer, propslen - valuelen)
|
||||
value = (value, value1)
|
||||
valuelen += valuelen1
|
||||
return value, valuelen
|
||||
|
||||
def getNameFromIdent(self, identifier):
|
||||
rc = None
|
||||
for name in self.names:
|
||||
if self.names[name] == identifier:
|
||||
rc = name
|
||||
return rc
|
||||
|
||||
def unpack(self, buffer):
|
||||
self.clear()
|
||||
# deserialize properties into attributes from buffer received from network
|
||||
propslen, VBIlen = VariableByteIntegers.decode(buffer)
|
||||
buffer = buffer[VBIlen:] # strip the bytes used by the VBI
|
||||
propslenleft = propslen
|
||||
while propslenleft > 0: # properties length is 0 if there are none
|
||||
identifier, VBIlen2 = VariableByteIntegers.decode(
|
||||
buffer) # property identifier
|
||||
buffer = buffer[VBIlen2:] # strip the bytes used by the VBI
|
||||
propslenleft -= VBIlen2
|
||||
attr_type = self.properties[identifier][0]
|
||||
value, valuelen = self.readProperty(
|
||||
buffer, attr_type, propslenleft)
|
||||
buffer = buffer[valuelen:] # strip the bytes used by the value
|
||||
propslenleft -= valuelen
|
||||
propname = self.getNameFromIdent(identifier)
|
||||
compressedName = propname.replace(' ', '')
|
||||
if not self.allowsMultiple(compressedName) and hasattr(self, compressedName):
|
||||
raise MQTTException(
|
||||
f"Property '{property}' must not exist more than once")
|
||||
setattr(self, propname, value)
|
||||
return self, propslen + VBIlen
|
||||
@@ -0,0 +1,306 @@
|
||||
# Copyright (c) 2014 Roger Light <[email protected]>
|
||||
#
|
||||
# All rights reserved. This program and the accompanying materials
|
||||
# are made available under the terms of the Eclipse Public License v2.0
|
||||
# and Eclipse Distribution License v1.0 which accompany this distribution.
|
||||
#
|
||||
# The Eclipse Public License is available at
|
||||
# http://www.eclipse.org/legal/epl-v20.html
|
||||
# and the Eclipse Distribution License is available at
|
||||
# http://www.eclipse.org/org/documents/edl-v10.php.
|
||||
#
|
||||
# Contributors:
|
||||
# Roger Light - initial API and implementation
|
||||
|
||||
"""
|
||||
This module provides some helper functions to allow straightforward publishing
|
||||
of messages in a one-shot manner. In other words, they are useful for the
|
||||
situation where you have a single/multiple messages you want to publish to a
|
||||
broker, then disconnect and nothing else is required.
|
||||
"""
|
||||
from __future__ import annotations
|
||||
|
||||
import collections
|
||||
from collections.abc import Iterable
|
||||
from typing import TYPE_CHECKING, Any, List, Tuple, Union
|
||||
|
||||
from paho.mqtt.enums import CallbackAPIVersion, MQTTProtocolVersion
|
||||
from paho.mqtt.properties import Properties
|
||||
from paho.mqtt.reasoncodes import ReasonCode
|
||||
|
||||
from .. import mqtt
|
||||
from . import client as paho
|
||||
|
||||
if TYPE_CHECKING:
|
||||
try:
|
||||
from typing import NotRequired, Required, TypedDict # type: ignore
|
||||
except ImportError:
|
||||
from typing_extensions import NotRequired, Required, TypedDict
|
||||
|
||||
try:
|
||||
from typing import Literal
|
||||
except ImportError:
|
||||
from typing_extensions import Literal # type: ignore
|
||||
|
||||
|
||||
|
||||
class AuthParameter(TypedDict, total=False):
|
||||
username: Required[str]
|
||||
password: NotRequired[str]
|
||||
|
||||
|
||||
class TLSParameter(TypedDict, total=False):
|
||||
ca_certs: Required[str]
|
||||
certfile: NotRequired[str]
|
||||
keyfile: NotRequired[str]
|
||||
tls_version: NotRequired[int]
|
||||
ciphers: NotRequired[str]
|
||||
insecure: NotRequired[bool]
|
||||
|
||||
|
||||
class MessageDict(TypedDict, total=False):
|
||||
topic: Required[str]
|
||||
payload: NotRequired[paho.PayloadType]
|
||||
qos: NotRequired[int]
|
||||
retain: NotRequired[bool]
|
||||
|
||||
MessageTuple = Tuple[str, paho.PayloadType, int, bool]
|
||||
|
||||
MessagesList = List[Union[MessageDict, MessageTuple]]
|
||||
|
||||
|
||||
def _do_publish(client: paho.Client):
|
||||
"""Internal function"""
|
||||
|
||||
message = client._userdata.popleft()
|
||||
|
||||
if isinstance(message, dict):
|
||||
client.publish(**message)
|
||||
elif isinstance(message, (tuple, list)):
|
||||
client.publish(*message)
|
||||
else:
|
||||
raise TypeError('message must be a dict, tuple, or list')
|
||||
|
||||
|
||||
def _on_connect(client: paho.Client, userdata: MessagesList, flags, reason_code, properties):
|
||||
"""Internal v5 callback"""
|
||||
if reason_code == 0:
|
||||
if len(userdata) > 0:
|
||||
_do_publish(client)
|
||||
else:
|
||||
raise mqtt.MQTTException(paho.connack_string(reason_code))
|
||||
|
||||
|
||||
def _on_publish(
|
||||
client: paho.Client, userdata: collections.deque[MessagesList], mid: int, reason_codes: ReasonCode, properties: Properties,
|
||||
) -> None:
|
||||
"""Internal callback"""
|
||||
#pylint: disable=unused-argument
|
||||
|
||||
if len(userdata) == 0:
|
||||
client.disconnect()
|
||||
else:
|
||||
_do_publish(client)
|
||||
|
||||
|
||||
def multiple(
|
||||
msgs: MessagesList,
|
||||
hostname: str = "localhost",
|
||||
port: int = 1883,
|
||||
client_id: str = "",
|
||||
keepalive: int = 60,
|
||||
will: MessageDict | None = None,
|
||||
auth: AuthParameter | None = None,
|
||||
tls: TLSParameter | None = None,
|
||||
protocol: MQTTProtocolVersion = paho.MQTTv311,
|
||||
transport: Literal["tcp", "websockets"] = "tcp",
|
||||
proxy_args: Any | None = None,
|
||||
) -> None:
|
||||
"""Publish multiple messages to a broker, then disconnect cleanly.
|
||||
|
||||
This function creates an MQTT client, connects to a broker and publishes a
|
||||
list of messages. Once the messages have been delivered, it disconnects
|
||||
cleanly from the broker.
|
||||
|
||||
:param msgs: a list of messages to publish. Each message is either a dict or a
|
||||
tuple.
|
||||
|
||||
If a dict, only the topic must be present. Default values will be
|
||||
used for any missing arguments. The dict must be of the form:
|
||||
|
||||
msg = {'topic':"<topic>", 'payload':"<payload>", 'qos':<qos>,
|
||||
'retain':<retain>}
|
||||
topic must be present and may not be empty.
|
||||
If payload is "", None or not present then a zero length payload
|
||||
will be published.
|
||||
If qos is not present, the default of 0 is used.
|
||||
If retain is not present, the default of False is used.
|
||||
|
||||
If a tuple, then it must be of the form:
|
||||
("<topic>", "<payload>", qos, retain)
|
||||
|
||||
:param str hostname: the address of the broker to connect to.
|
||||
Defaults to localhost.
|
||||
|
||||
:param int port: the port to connect to the broker on. Defaults to 1883.
|
||||
|
||||
:param str client_id: the MQTT client id to use. If "" or None, the Paho library will
|
||||
generate a client id automatically.
|
||||
|
||||
:param int keepalive: the keepalive timeout value for the client. Defaults to 60
|
||||
seconds.
|
||||
|
||||
:param will: a dict containing will parameters for the client: will = {'topic':
|
||||
"<topic>", 'payload':"<payload">, 'qos':<qos>, 'retain':<retain>}.
|
||||
Topic is required, all other parameters are optional and will
|
||||
default to None, 0 and False respectively.
|
||||
Defaults to None, which indicates no will should be used.
|
||||
|
||||
:param auth: a dict containing authentication parameters for the client:
|
||||
auth = {'username':"<username>", 'password':"<password>"}
|
||||
Username is required, password is optional and will default to None
|
||||
if not provided.
|
||||
Defaults to None, which indicates no authentication is to be used.
|
||||
|
||||
:param tls: a dict containing TLS configuration parameters for the client:
|
||||
dict = {'ca_certs':"<ca_certs>", 'certfile':"<certfile>",
|
||||
'keyfile':"<keyfile>", 'tls_version':"<tls_version>",
|
||||
'ciphers':"<ciphers">, 'insecure':"<bool>"}
|
||||
ca_certs is required, all other parameters are optional and will
|
||||
default to None if not provided, which results in the client using
|
||||
the default behaviour - see the paho.mqtt.client documentation.
|
||||
Alternatively, tls input can be an SSLContext object, which will be
|
||||
processed using the tls_set_context method.
|
||||
Defaults to None, which indicates that TLS should not be used.
|
||||
|
||||
:param str transport: set to "tcp" to use the default setting of transport which is
|
||||
raw TCP. Set to "websockets" to use WebSockets as the transport.
|
||||
|
||||
:param proxy_args: a dictionary that will be given to the client.
|
||||
"""
|
||||
|
||||
if not isinstance(msgs, Iterable):
|
||||
raise TypeError('msgs must be an iterable')
|
||||
if len(msgs) == 0:
|
||||
raise ValueError('msgs is empty')
|
||||
|
||||
client = paho.Client(
|
||||
CallbackAPIVersion.VERSION2,
|
||||
client_id=client_id,
|
||||
userdata=collections.deque(msgs),
|
||||
protocol=protocol,
|
||||
transport=transport,
|
||||
)
|
||||
|
||||
client.enable_logger()
|
||||
client.on_publish = _on_publish
|
||||
client.on_connect = _on_connect # type: ignore
|
||||
|
||||
if proxy_args is not None:
|
||||
client.proxy_set(**proxy_args)
|
||||
|
||||
if auth:
|
||||
username = auth.get('username')
|
||||
if username:
|
||||
password = auth.get('password')
|
||||
client.username_pw_set(username, password)
|
||||
else:
|
||||
raise KeyError("The 'username' key was not found, this is "
|
||||
"required for auth")
|
||||
|
||||
if will is not None:
|
||||
client.will_set(**will)
|
||||
|
||||
if tls is not None:
|
||||
if isinstance(tls, dict):
|
||||
insecure = tls.pop('insecure', False)
|
||||
# mypy don't get that tls no longer contains the key insecure
|
||||
client.tls_set(**tls) # type: ignore[misc]
|
||||
if insecure:
|
||||
# Must be set *after* the `client.tls_set()` call since it sets
|
||||
# up the SSL context that `client.tls_insecure_set` alters.
|
||||
client.tls_insecure_set(insecure)
|
||||
else:
|
||||
# Assume input is SSLContext object
|
||||
client.tls_set_context(tls)
|
||||
|
||||
client.connect(hostname, port, keepalive)
|
||||
client.loop_forever()
|
||||
|
||||
|
||||
def single(
|
||||
topic: str,
|
||||
payload: paho.PayloadType = None,
|
||||
qos: int = 0,
|
||||
retain: bool = False,
|
||||
hostname: str = "localhost",
|
||||
port: int = 1883,
|
||||
client_id: str = "",
|
||||
keepalive: int = 60,
|
||||
will: MessageDict | None = None,
|
||||
auth: AuthParameter | None = None,
|
||||
tls: TLSParameter | None = None,
|
||||
protocol: MQTTProtocolVersion = paho.MQTTv311,
|
||||
transport: Literal["tcp", "websockets"] = "tcp",
|
||||
proxy_args: Any | None = None,
|
||||
) -> None:
|
||||
"""Publish a single message to a broker, then disconnect cleanly.
|
||||
|
||||
This function creates an MQTT client, connects to a broker and publishes a
|
||||
single message. Once the message has been delivered, it disconnects cleanly
|
||||
from the broker.
|
||||
|
||||
:param str topic: the only required argument must be the topic string to which the
|
||||
payload will be published.
|
||||
|
||||
:param payload: the payload to be published. If "" or None, a zero length payload
|
||||
will be published.
|
||||
|
||||
:param int qos: the qos to use when publishing, default to 0.
|
||||
|
||||
:param bool retain: set the message to be retained (True) or not (False).
|
||||
|
||||
:param str hostname: the address of the broker to connect to.
|
||||
Defaults to localhost.
|
||||
|
||||
:param int port: the port to connect to the broker on. Defaults to 1883.
|
||||
|
||||
:param str client_id: the MQTT client id to use. If "" or None, the Paho library will
|
||||
generate a client id automatically.
|
||||
|
||||
:param int keepalive: the keepalive timeout value for the client. Defaults to 60
|
||||
seconds.
|
||||
|
||||
:param will: a dict containing will parameters for the client: will = {'topic':
|
||||
"<topic>", 'payload':"<payload">, 'qos':<qos>, 'retain':<retain>}.
|
||||
Topic is required, all other parameters are optional and will
|
||||
default to None, 0 and False respectively.
|
||||
Defaults to None, which indicates no will should be used.
|
||||
|
||||
:param auth: a dict containing authentication parameters for the client:
|
||||
Username is required, password is optional and will default to None
|
||||
auth = {'username':"<username>", 'password':"<password>"}
|
||||
if not provided.
|
||||
Defaults to None, which indicates no authentication is to be used.
|
||||
|
||||
:param tls: a dict containing TLS configuration parameters for the client:
|
||||
dict = {'ca_certs':"<ca_certs>", 'certfile':"<certfile>",
|
||||
'keyfile':"<keyfile>", 'tls_version':"<tls_version>",
|
||||
'ciphers':"<ciphers">, 'insecure':"<bool>"}
|
||||
ca_certs is required, all other parameters are optional and will
|
||||
default to None if not provided, which results in the client using
|
||||
the default behaviour - see the paho.mqtt.client documentation.
|
||||
Defaults to None, which indicates that TLS should not be used.
|
||||
Alternatively, tls input can be an SSLContext object, which will be
|
||||
processed using the tls_set_context method.
|
||||
|
||||
:param transport: set to "tcp" to use the default setting of transport which is
|
||||
raw TCP. Set to "websockets" to use WebSockets as the transport.
|
||||
|
||||
:param proxy_args: a dictionary that will be given to the client.
|
||||
"""
|
||||
|
||||
msg: MessageDict = {'topic':topic, 'payload':payload, 'qos':qos, 'retain':retain}
|
||||
|
||||
multiple([msg], hostname, port, client_id, keepalive, will, auth, tls,
|
||||
protocol, transport, proxy_args)
|
||||
@@ -0,0 +1,223 @@
|
||||
# *******************************************************************
|
||||
# Copyright (c) 2017, 2019 IBM Corp.
|
||||
#
|
||||
# All rights reserved. This program and the accompanying materials
|
||||
# are made available under the terms of the Eclipse Public License v2.0
|
||||
# and Eclipse Distribution License v1.0 which accompany this distribution.
|
||||
#
|
||||
# The Eclipse Public License is available at
|
||||
# http://www.eclipse.org/legal/epl-v20.html
|
||||
# and the Eclipse Distribution License is available at
|
||||
# http://www.eclipse.org/org/documents/edl-v10.php.
|
||||
#
|
||||
# Contributors:
|
||||
# Ian Craggs - initial implementation and/or documentation
|
||||
# *******************************************************************
|
||||
|
||||
import functools
|
||||
import warnings
|
||||
from typing import Any
|
||||
|
||||
from .packettypes import PacketTypes
|
||||
|
||||
|
||||
@functools.total_ordering
|
||||
class ReasonCode:
|
||||
"""MQTT version 5.0 reason codes class.
|
||||
|
||||
See ReasonCode.names for a list of possible numeric values along with their
|
||||
names and the packets to which they apply.
|
||||
|
||||
"""
|
||||
|
||||
def __init__(self, packetType: int, aName: str ="Success", identifier: int =-1):
|
||||
"""
|
||||
packetType: the type of the packet, such as PacketTypes.CONNECT that
|
||||
this reason code will be used with. Some reason codes have different
|
||||
names for the same identifier when used a different packet type.
|
||||
|
||||
aName: the String name of the reason code to be created. Ignored
|
||||
if the identifier is set.
|
||||
|
||||
identifier: an integer value of the reason code to be created.
|
||||
|
||||
"""
|
||||
|
||||
self.packetType = packetType
|
||||
self.names = {
|
||||
0: {"Success": [PacketTypes.CONNACK, PacketTypes.PUBACK,
|
||||
PacketTypes.PUBREC, PacketTypes.PUBREL, PacketTypes.PUBCOMP,
|
||||
PacketTypes.UNSUBACK, PacketTypes.AUTH],
|
||||
"Normal disconnection": [PacketTypes.DISCONNECT],
|
||||
"Granted QoS 0": [PacketTypes.SUBACK]},
|
||||
1: {"Granted QoS 1": [PacketTypes.SUBACK]},
|
||||
2: {"Granted QoS 2": [PacketTypes.SUBACK]},
|
||||
4: {"Disconnect with will message": [PacketTypes.DISCONNECT]},
|
||||
16: {"No matching subscribers":
|
||||
[PacketTypes.PUBACK, PacketTypes.PUBREC]},
|
||||
17: {"No subscription found": [PacketTypes.UNSUBACK]},
|
||||
24: {"Continue authentication": [PacketTypes.AUTH]},
|
||||
25: {"Re-authenticate": [PacketTypes.AUTH]},
|
||||
128: {"Unspecified error": [PacketTypes.CONNACK, PacketTypes.PUBACK,
|
||||
PacketTypes.PUBREC, PacketTypes.SUBACK, PacketTypes.UNSUBACK,
|
||||
PacketTypes.DISCONNECT], },
|
||||
129: {"Malformed packet":
|
||||
[PacketTypes.CONNACK, PacketTypes.DISCONNECT]},
|
||||
130: {"Protocol error":
|
||||
[PacketTypes.CONNACK, PacketTypes.DISCONNECT]},
|
||||
131: {"Implementation specific error": [PacketTypes.CONNACK,
|
||||
PacketTypes.PUBACK, PacketTypes.PUBREC, PacketTypes.SUBACK,
|
||||
PacketTypes.UNSUBACK, PacketTypes.DISCONNECT], },
|
||||
132: {"Unsupported protocol version": [PacketTypes.CONNACK]},
|
||||
133: {"Client identifier not valid": [PacketTypes.CONNACK]},
|
||||
134: {"Bad user name or password": [PacketTypes.CONNACK]},
|
||||
135: {"Not authorized": [PacketTypes.CONNACK, PacketTypes.PUBACK,
|
||||
PacketTypes.PUBREC, PacketTypes.SUBACK, PacketTypes.UNSUBACK,
|
||||
PacketTypes.DISCONNECT], },
|
||||
136: {"Server unavailable": [PacketTypes.CONNACK]},
|
||||
137: {"Server busy": [PacketTypes.CONNACK, PacketTypes.DISCONNECT]},
|
||||
138: {"Banned": [PacketTypes.CONNACK]},
|
||||
139: {"Server shutting down": [PacketTypes.DISCONNECT]},
|
||||
140: {"Bad authentication method":
|
||||
[PacketTypes.CONNACK, PacketTypes.DISCONNECT]},
|
||||
141: {"Keep alive timeout": [PacketTypes.DISCONNECT]},
|
||||
142: {"Session taken over": [PacketTypes.DISCONNECT]},
|
||||
143: {"Topic filter invalid":
|
||||
[PacketTypes.SUBACK, PacketTypes.UNSUBACK, PacketTypes.DISCONNECT]},
|
||||
144: {"Topic name invalid":
|
||||
[PacketTypes.CONNACK, PacketTypes.PUBACK,
|
||||
PacketTypes.PUBREC, PacketTypes.DISCONNECT]},
|
||||
145: {"Packet identifier in use":
|
||||
[PacketTypes.PUBACK, PacketTypes.PUBREC,
|
||||
PacketTypes.SUBACK, PacketTypes.UNSUBACK]},
|
||||
146: {"Packet identifier not found":
|
||||
[PacketTypes.PUBREL, PacketTypes.PUBCOMP]},
|
||||
147: {"Receive maximum exceeded": [PacketTypes.DISCONNECT]},
|
||||
148: {"Topic alias invalid": [PacketTypes.DISCONNECT]},
|
||||
149: {"Packet too large": [PacketTypes.CONNACK, PacketTypes.DISCONNECT]},
|
||||
150: {"Message rate too high": [PacketTypes.DISCONNECT]},
|
||||
151: {"Quota exceeded": [PacketTypes.CONNACK, PacketTypes.PUBACK,
|
||||
PacketTypes.PUBREC, PacketTypes.SUBACK, PacketTypes.DISCONNECT], },
|
||||
152: {"Administrative action": [PacketTypes.DISCONNECT]},
|
||||
153: {"Payload format invalid":
|
||||
[PacketTypes.PUBACK, PacketTypes.PUBREC, PacketTypes.DISCONNECT]},
|
||||
154: {"Retain not supported":
|
||||
[PacketTypes.CONNACK, PacketTypes.DISCONNECT]},
|
||||
155: {"QoS not supported":
|
||||
[PacketTypes.CONNACK, PacketTypes.DISCONNECT]},
|
||||
156: {"Use another server":
|
||||
[PacketTypes.CONNACK, PacketTypes.DISCONNECT]},
|
||||
157: {"Server moved":
|
||||
[PacketTypes.CONNACK, PacketTypes.DISCONNECT]},
|
||||
158: {"Shared subscription not supported":
|
||||
[PacketTypes.SUBACK, PacketTypes.DISCONNECT]},
|
||||
159: {"Connection rate exceeded":
|
||||
[PacketTypes.CONNACK, PacketTypes.DISCONNECT]},
|
||||
160: {"Maximum connect time":
|
||||
[PacketTypes.DISCONNECT]},
|
||||
161: {"Subscription identifiers not supported":
|
||||
[PacketTypes.SUBACK, PacketTypes.DISCONNECT]},
|
||||
162: {"Wildcard subscription not supported":
|
||||
[PacketTypes.SUBACK, PacketTypes.DISCONNECT]},
|
||||
}
|
||||
if identifier == -1:
|
||||
if packetType == PacketTypes.DISCONNECT and aName == "Success":
|
||||
aName = "Normal disconnection"
|
||||
self.set(aName)
|
||||
else:
|
||||
self.value = identifier
|
||||
self.getName() # check it's good
|
||||
|
||||
def __getName__(self, packetType, identifier):
|
||||
"""
|
||||
Get the reason code string name for a specific identifier.
|
||||
The name can vary by packet type for the same identifier, which
|
||||
is why the packet type is also required.
|
||||
|
||||
Used when displaying the reason code.
|
||||
"""
|
||||
if identifier not in self.names:
|
||||
raise KeyError(identifier)
|
||||
names = self.names[identifier]
|
||||
namelist = [name for name in names.keys() if packetType in names[name]]
|
||||
if len(namelist) != 1:
|
||||
raise ValueError(f"Expected exactly one name, found {namelist!r}")
|
||||
return namelist[0]
|
||||
|
||||
def getId(self, name):
|
||||
"""
|
||||
Get the numeric id corresponding to a reason code name.
|
||||
|
||||
Used when setting the reason code for a packetType
|
||||
check that only valid codes for the packet are set.
|
||||
"""
|
||||
for code in self.names.keys():
|
||||
if name in self.names[code].keys():
|
||||
if self.packetType in self.names[code][name]:
|
||||
return code
|
||||
raise KeyError(f"Reason code name not found: {name}")
|
||||
|
||||
def set(self, name):
|
||||
self.value = self.getId(name)
|
||||
|
||||
def unpack(self, buffer):
|
||||
c = buffer[0]
|
||||
name = self.__getName__(self.packetType, c)
|
||||
self.value = self.getId(name)
|
||||
return 1
|
||||
|
||||
def getName(self):
|
||||
"""Returns the reason code name corresponding to the numeric value which is set.
|
||||
"""
|
||||
return self.__getName__(self.packetType, self.value)
|
||||
|
||||
def __eq__(self, other):
|
||||
if isinstance(other, int):
|
||||
return self.value == other
|
||||
if isinstance(other, str):
|
||||
return other == str(self)
|
||||
if isinstance(other, ReasonCode):
|
||||
return self.value == other.value
|
||||
return False
|
||||
|
||||
def __lt__(self, other):
|
||||
if isinstance(other, int):
|
||||
return self.value < other
|
||||
if isinstance(other, ReasonCode):
|
||||
return self.value < other.value
|
||||
return NotImplemented
|
||||
|
||||
def __repr__(self):
|
||||
try:
|
||||
packet_name = PacketTypes.Names[self.packetType]
|
||||
except IndexError:
|
||||
packet_name = "Unknown"
|
||||
|
||||
return f"ReasonCode({packet_name}, {self.getName()!r})"
|
||||
|
||||
def __str__(self):
|
||||
return self.getName()
|
||||
|
||||
def json(self):
|
||||
return self.getName()
|
||||
|
||||
def pack(self):
|
||||
return bytearray([self.value])
|
||||
|
||||
@property
|
||||
def is_failure(self) -> bool:
|
||||
return self.value >= 0x80
|
||||
|
||||
|
||||
class _CompatibilityIsInstance(type):
|
||||
def __instancecheck__(self, other: Any) -> bool:
|
||||
return isinstance(other, ReasonCode)
|
||||
|
||||
|
||||
class ReasonCodes(ReasonCode, metaclass=_CompatibilityIsInstance):
|
||||
def __init__(self, *args, **kwargs):
|
||||
warnings.warn("ReasonCodes is deprecated, use ReasonCode (singular) instead",
|
||||
category=DeprecationWarning,
|
||||
stacklevel=2,
|
||||
)
|
||||
super().__init__(*args, **kwargs)
|
||||
@@ -0,0 +1,281 @@
|
||||
# Copyright (c) 2016 Roger Light <[email protected]>
|
||||
#
|
||||
# All rights reserved. This program and the accompanying materials
|
||||
# are made available under the terms of the Eclipse Public License v2.0
|
||||
# and Eclipse Distribution License v1.0 which accompany this distribution.
|
||||
#
|
||||
# The Eclipse Public License is available at
|
||||
# http://www.eclipse.org/legal/epl-v20.html
|
||||
# and the Eclipse Distribution License is available at
|
||||
# http://www.eclipse.org/org/documents/edl-v10.php.
|
||||
#
|
||||
# Contributors:
|
||||
# Roger Light - initial API and implementation
|
||||
|
||||
"""
|
||||
This module provides some helper functions to allow straightforward subscribing
|
||||
to topics and retrieving messages. The two functions are simple(), which
|
||||
returns one or messages matching a set of topics, and callback() which allows
|
||||
you to pass a callback for processing of messages.
|
||||
"""
|
||||
|
||||
from .. import mqtt
|
||||
from . import client as paho
|
||||
|
||||
|
||||
def _on_connect(client, userdata, flags, reason_code, properties):
|
||||
"""Internal callback"""
|
||||
if reason_code != 0:
|
||||
raise mqtt.MQTTException(paho.connack_string(reason_code))
|
||||
|
||||
if isinstance(userdata['topics'], list):
|
||||
for topic in userdata['topics']:
|
||||
client.subscribe(topic, userdata['qos'])
|
||||
else:
|
||||
client.subscribe(userdata['topics'], userdata['qos'])
|
||||
|
||||
|
||||
def _on_message_callback(client, userdata, message):
|
||||
"""Internal callback"""
|
||||
userdata['callback'](client, userdata['userdata'], message)
|
||||
|
||||
|
||||
def _on_message_simple(client, userdata, message):
|
||||
"""Internal callback"""
|
||||
|
||||
if userdata['msg_count'] == 0:
|
||||
return
|
||||
|
||||
# Don't process stale retained messages if 'retained' was false
|
||||
if message.retain and not userdata['retained']:
|
||||
return
|
||||
|
||||
userdata['msg_count'] = userdata['msg_count'] - 1
|
||||
|
||||
if userdata['messages'] is None and userdata['msg_count'] == 0:
|
||||
userdata['messages'] = message
|
||||
client.disconnect()
|
||||
return
|
||||
|
||||
userdata['messages'].append(message)
|
||||
if userdata['msg_count'] == 0:
|
||||
client.disconnect()
|
||||
|
||||
|
||||
def callback(callback, topics, qos=0, userdata=None, hostname="localhost",
|
||||
port=1883, client_id="", keepalive=60, will=None, auth=None,
|
||||
tls=None, protocol=paho.MQTTv311, transport="tcp",
|
||||
clean_session=True, proxy_args=None):
|
||||
"""Subscribe to a list of topics and process them in a callback function.
|
||||
|
||||
This function creates an MQTT client, connects to a broker and subscribes
|
||||
to a list of topics. Incoming messages are processed by the user provided
|
||||
callback. This is a blocking function and will never return.
|
||||
|
||||
:param callback: function with the same signature as `on_message` for
|
||||
processing the messages received.
|
||||
|
||||
:param topics: either a string containing a single topic to subscribe to, or a
|
||||
list of topics to subscribe to.
|
||||
|
||||
:param int qos: the qos to use when subscribing. This is applied to all topics.
|
||||
|
||||
:param userdata: passed to the callback
|
||||
|
||||
:param str hostname: the address of the broker to connect to.
|
||||
Defaults to localhost.
|
||||
|
||||
:param int port: the port to connect to the broker on. Defaults to 1883.
|
||||
|
||||
:param str client_id: the MQTT client id to use. If "" or None, the Paho library will
|
||||
generate a client id automatically.
|
||||
|
||||
:param int keepalive: the keepalive timeout value for the client. Defaults to 60
|
||||
seconds.
|
||||
|
||||
:param will: a dict containing will parameters for the client: will = {'topic':
|
||||
"<topic>", 'payload':"<payload">, 'qos':<qos>, 'retain':<retain>}.
|
||||
Topic is required, all other parameters are optional and will
|
||||
default to None, 0 and False respectively.
|
||||
|
||||
Defaults to None, which indicates no will should be used.
|
||||
|
||||
:param auth: a dict containing authentication parameters for the client:
|
||||
auth = {'username':"<username>", 'password':"<password>"}
|
||||
Username is required, password is optional and will default to None
|
||||
if not provided.
|
||||
Defaults to None, which indicates no authentication is to be used.
|
||||
|
||||
:param tls: a dict containing TLS configuration parameters for the client:
|
||||
dict = {'ca_certs':"<ca_certs>", 'certfile':"<certfile>",
|
||||
'keyfile':"<keyfile>", 'tls_version':"<tls_version>",
|
||||
'ciphers':"<ciphers">, 'insecure':"<bool>"}
|
||||
ca_certs is required, all other parameters are optional and will
|
||||
default to None if not provided, which results in the client using
|
||||
the default behaviour - see the paho.mqtt.client documentation.
|
||||
Alternatively, tls input can be an SSLContext object, which will be
|
||||
processed using the tls_set_context method.
|
||||
Defaults to None, which indicates that TLS should not be used.
|
||||
|
||||
:param str transport: set to "tcp" to use the default setting of transport which is
|
||||
raw TCP. Set to "websockets" to use WebSockets as the transport.
|
||||
|
||||
:param clean_session: a boolean that determines the client type. If True,
|
||||
the broker will remove all information about this client
|
||||
when it disconnects. If False, the client is a persistent
|
||||
client and subscription information and queued messages
|
||||
will be retained when the client disconnects.
|
||||
Defaults to True.
|
||||
|
||||
:param proxy_args: a dictionary that will be given to the client.
|
||||
"""
|
||||
|
||||
if qos < 0 or qos > 2:
|
||||
raise ValueError('qos must be in the range 0-2')
|
||||
|
||||
callback_userdata = {
|
||||
'callback':callback,
|
||||
'topics':topics,
|
||||
'qos':qos,
|
||||
'userdata':userdata}
|
||||
|
||||
client = paho.Client(
|
||||
paho.CallbackAPIVersion.VERSION2,
|
||||
client_id=client_id,
|
||||
userdata=callback_userdata,
|
||||
protocol=protocol,
|
||||
transport=transport,
|
||||
clean_session=clean_session,
|
||||
)
|
||||
client.enable_logger()
|
||||
|
||||
client.on_message = _on_message_callback
|
||||
client.on_connect = _on_connect
|
||||
|
||||
if proxy_args is not None:
|
||||
client.proxy_set(**proxy_args)
|
||||
|
||||
if auth:
|
||||
username = auth.get('username')
|
||||
if username:
|
||||
password = auth.get('password')
|
||||
client.username_pw_set(username, password)
|
||||
else:
|
||||
raise KeyError("The 'username' key was not found, this is "
|
||||
"required for auth")
|
||||
|
||||
if will is not None:
|
||||
client.will_set(**will)
|
||||
|
||||
if tls is not None:
|
||||
if isinstance(tls, dict):
|
||||
insecure = tls.pop('insecure', False)
|
||||
client.tls_set(**tls)
|
||||
if insecure:
|
||||
# Must be set *after* the `client.tls_set()` call since it sets
|
||||
# up the SSL context that `client.tls_insecure_set` alters.
|
||||
client.tls_insecure_set(insecure)
|
||||
else:
|
||||
# Assume input is SSLContext object
|
||||
client.tls_set_context(tls)
|
||||
|
||||
client.connect(hostname, port, keepalive)
|
||||
client.loop_forever()
|
||||
|
||||
|
||||
def simple(topics, qos=0, msg_count=1, retained=True, hostname="localhost",
|
||||
port=1883, client_id="", keepalive=60, will=None, auth=None,
|
||||
tls=None, protocol=paho.MQTTv311, transport="tcp",
|
||||
clean_session=True, proxy_args=None):
|
||||
"""Subscribe to a list of topics and return msg_count messages.
|
||||
|
||||
This function creates an MQTT client, connects to a broker and subscribes
|
||||
to a list of topics. Once "msg_count" messages have been received, it
|
||||
disconnects cleanly from the broker and returns the messages.
|
||||
|
||||
:param topics: either a string containing a single topic to subscribe to, or a
|
||||
list of topics to subscribe to.
|
||||
|
||||
:param int qos: the qos to use when subscribing. This is applied to all topics.
|
||||
|
||||
:param int msg_count: the number of messages to retrieve from the broker.
|
||||
if msg_count == 1 then a single MQTTMessage will be returned.
|
||||
if msg_count > 1 then a list of MQTTMessages will be returned.
|
||||
|
||||
:param bool retained: If set to True, retained messages will be processed the same as
|
||||
non-retained messages. If set to False, retained messages will
|
||||
be ignored. This means that with retained=False and msg_count=1,
|
||||
the function will return the first message received that does
|
||||
not have the retained flag set.
|
||||
|
||||
:param str hostname: the address of the broker to connect to.
|
||||
Defaults to localhost.
|
||||
|
||||
:param int port: the port to connect to the broker on. Defaults to 1883.
|
||||
|
||||
:param str client_id: the MQTT client id to use. If "" or None, the Paho library will
|
||||
generate a client id automatically.
|
||||
|
||||
:param int keepalive: the keepalive timeout value for the client. Defaults to 60
|
||||
seconds.
|
||||
|
||||
:param will: a dict containing will parameters for the client: will = {'topic':
|
||||
"<topic>", 'payload':"<payload">, 'qos':<qos>, 'retain':<retain>}.
|
||||
Topic is required, all other parameters are optional and will
|
||||
default to None, 0 and False respectively.
|
||||
Defaults to None, which indicates no will should be used.
|
||||
|
||||
:param auth: a dict containing authentication parameters for the client:
|
||||
auth = {'username':"<username>", 'password':"<password>"}
|
||||
Username is required, password is optional and will default to None
|
||||
if not provided.
|
||||
Defaults to None, which indicates no authentication is to be used.
|
||||
|
||||
:param tls: a dict containing TLS configuration parameters for the client:
|
||||
dict = {'ca_certs':"<ca_certs>", 'certfile':"<certfile>",
|
||||
'keyfile':"<keyfile>", 'tls_version':"<tls_version>",
|
||||
'ciphers':"<ciphers">, 'insecure':"<bool>"}
|
||||
ca_certs is required, all other parameters are optional and will
|
||||
default to None if not provided, which results in the client using
|
||||
the default behaviour - see the paho.mqtt.client documentation.
|
||||
Alternatively, tls input can be an SSLContext object, which will be
|
||||
processed using the tls_set_context method.
|
||||
Defaults to None, which indicates that TLS should not be used.
|
||||
|
||||
:param protocol: the MQTT protocol version to use. Defaults to MQTTv311.
|
||||
|
||||
:param transport: set to "tcp" to use the default setting of transport which is
|
||||
raw TCP. Set to "websockets" to use WebSockets as the transport.
|
||||
|
||||
:param clean_session: a boolean that determines the client type. If True,
|
||||
the broker will remove all information about this client
|
||||
when it disconnects. If False, the client is a persistent
|
||||
client and subscription information and queued messages
|
||||
will be retained when the client disconnects.
|
||||
Defaults to True. If protocol is MQTTv50, clean_session
|
||||
is ignored.
|
||||
|
||||
:param proxy_args: a dictionary that will be given to the client.
|
||||
"""
|
||||
|
||||
if msg_count < 1:
|
||||
raise ValueError('msg_count must be > 0')
|
||||
|
||||
# Set ourselves up to return a single message if msg_count == 1, or a list
|
||||
# if > 1.
|
||||
if msg_count == 1:
|
||||
messages = None
|
||||
else:
|
||||
messages = []
|
||||
|
||||
# Ignore clean_session if protocol is MQTTv50, otherwise Client will raise
|
||||
if protocol == paho.MQTTv5:
|
||||
clean_session = None
|
||||
|
||||
userdata = {'retained':retained, 'msg_count':msg_count, 'messages':messages}
|
||||
|
||||
callback(_on_message_simple, topics, qos, userdata, hostname, port,
|
||||
client_id, keepalive, will, auth, tls, protocol, transport,
|
||||
clean_session, proxy_args)
|
||||
|
||||
return userdata['messages']
|
||||
@@ -0,0 +1,113 @@
|
||||
"""
|
||||
*******************************************************************
|
||||
Copyright (c) 2017, 2019 IBM Corp.
|
||||
|
||||
All rights reserved. This program and the accompanying materials
|
||||
are made available under the terms of the Eclipse Public License v2.0
|
||||
and Eclipse Distribution License v1.0 which accompany this distribution.
|
||||
|
||||
The Eclipse Public License is available at
|
||||
http://www.eclipse.org/legal/epl-v20.html
|
||||
and the Eclipse Distribution License is available at
|
||||
http://www.eclipse.org/org/documents/edl-v10.php.
|
||||
|
||||
Contributors:
|
||||
Ian Craggs - initial implementation and/or documentation
|
||||
*******************************************************************
|
||||
"""
|
||||
|
||||
|
||||
|
||||
class MQTTException(Exception):
|
||||
pass
|
||||
|
||||
|
||||
class SubscribeOptions:
|
||||
"""The MQTT v5.0 subscribe options class.
|
||||
|
||||
The options are:
|
||||
qos: As in MQTT v3.1.1.
|
||||
noLocal: True or False. If set to True, the subscriber will not receive its own publications.
|
||||
retainAsPublished: True or False. If set to True, the retain flag on received publications will be as set
|
||||
by the publisher.
|
||||
retainHandling: RETAIN_SEND_ON_SUBSCRIBE, RETAIN_SEND_IF_NEW_SUB or RETAIN_DO_NOT_SEND
|
||||
Controls when the broker should send retained messages:
|
||||
- RETAIN_SEND_ON_SUBSCRIBE: on any successful subscribe request
|
||||
- RETAIN_SEND_IF_NEW_SUB: only if the subscribe request is new
|
||||
- RETAIN_DO_NOT_SEND: never send retained messages
|
||||
"""
|
||||
|
||||
# retain handling options
|
||||
RETAIN_SEND_ON_SUBSCRIBE, RETAIN_SEND_IF_NEW_SUB, RETAIN_DO_NOT_SEND = range(
|
||||
0, 3)
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
qos: int = 0,
|
||||
noLocal: bool = False,
|
||||
retainAsPublished: bool = False,
|
||||
retainHandling: int = RETAIN_SEND_ON_SUBSCRIBE,
|
||||
):
|
||||
"""
|
||||
qos: 0, 1 or 2. 0 is the default.
|
||||
noLocal: True or False. False is the default and corresponds to MQTT v3.1.1 behavior.
|
||||
retainAsPublished: True or False. False is the default and corresponds to MQTT v3.1.1 behavior.
|
||||
retainHandling: RETAIN_SEND_ON_SUBSCRIBE, RETAIN_SEND_IF_NEW_SUB or RETAIN_DO_NOT_SEND
|
||||
RETAIN_SEND_ON_SUBSCRIBE is the default and corresponds to MQTT v3.1.1 behavior.
|
||||
"""
|
||||
object.__setattr__(self, "names",
|
||||
["QoS", "noLocal", "retainAsPublished", "retainHandling"])
|
||||
self.QoS = qos # bits 0,1
|
||||
self.noLocal = noLocal # bit 2
|
||||
self.retainAsPublished = retainAsPublished # bit 3
|
||||
self.retainHandling = retainHandling # bits 4 and 5: 0, 1 or 2
|
||||
if self.retainHandling not in (0, 1, 2):
|
||||
raise AssertionError(f"Retain handling should be 0, 1 or 2, not {self.retainHandling}")
|
||||
if self.QoS not in (0, 1, 2):
|
||||
raise AssertionError(f"QoS should be 0, 1 or 2, not {self.QoS}")
|
||||
|
||||
def __setattr__(self, name, value):
|
||||
if name not in self.names:
|
||||
raise MQTTException(
|
||||
f"{name} Attribute name must be one of {self.names}")
|
||||
object.__setattr__(self, name, value)
|
||||
|
||||
def pack(self):
|
||||
if self.retainHandling not in (0, 1, 2):
|
||||
raise AssertionError(f"Retain handling should be 0, 1 or 2, not {self.retainHandling}")
|
||||
if self.QoS not in (0, 1, 2):
|
||||
raise AssertionError(f"QoS should be 0, 1 or 2, not {self.QoS}")
|
||||
noLocal = 1 if self.noLocal else 0
|
||||
retainAsPublished = 1 if self.retainAsPublished else 0
|
||||
data = [(self.retainHandling << 4) | (retainAsPublished << 3) |
|
||||
(noLocal << 2) | self.QoS]
|
||||
return bytes(data)
|
||||
|
||||
def unpack(self, buffer):
|
||||
b0 = buffer[0]
|
||||
self.retainHandling = ((b0 >> 4) & 0x03)
|
||||
self.retainAsPublished = True if ((b0 >> 3) & 0x01) == 1 else False
|
||||
self.noLocal = True if ((b0 >> 2) & 0x01) == 1 else False
|
||||
self.QoS = (b0 & 0x03)
|
||||
if self.retainHandling not in (0, 1, 2):
|
||||
raise AssertionError(f"Retain handling should be 0, 1 or 2, not {self.retainHandling}")
|
||||
if self.QoS not in (0, 1, 2):
|
||||
raise AssertionError(f"QoS should be 0, 1 or 2, not {self.QoS}")
|
||||
return 1
|
||||
|
||||
def __repr__(self):
|
||||
return str(self)
|
||||
|
||||
def __str__(self):
|
||||
return "{QoS="+str(self.QoS)+", noLocal="+str(self.noLocal) +\
|
||||
", retainAsPublished="+str(self.retainAsPublished) +\
|
||||
", retainHandling="+str(self.retainHandling)+"}"
|
||||
|
||||
def json(self):
|
||||
data = {
|
||||
"QoS": self.QoS,
|
||||
"noLocal": self.noLocal,
|
||||
"retainAsPublished": self.retainAsPublished,
|
||||
"retainHandling": self.retainHandling,
|
||||
}
|
||||
return data
|
||||
@@ -0,0 +1 @@
|
||||
pip
|
||||
@@ -0,0 +1,635 @@
|
||||
Metadata-Version: 2.3
|
||||
Name: paho-mqtt
|
||||
Version: 2.1.0
|
||||
Summary: MQTT version 5.0/3.1.1 client class
|
||||
Project-URL: Homepage, http://eclipse.org/paho
|
||||
Author-email: Roger Light <[email protected]>
|
||||
License: EPL-2.0 OR BSD-3-Clause
|
||||
License-File: LICENSE.txt
|
||||
Keywords: paho
|
||||
Classifier: Development Status :: 4 - Beta
|
||||
Classifier: Intended Audience :: Developers
|
||||
Classifier: License :: OSI Approved
|
||||
Classifier: Natural Language :: English
|
||||
Classifier: Operating System :: MacOS :: MacOS X
|
||||
Classifier: Operating System :: Microsoft :: Windows
|
||||
Classifier: Operating System :: POSIX
|
||||
Classifier: Programming Language :: Python
|
||||
Classifier: Programming Language :: Python :: 3
|
||||
Classifier: Programming Language :: Python :: 3.7
|
||||
Classifier: Programming Language :: Python :: 3.8
|
||||
Classifier: Programming Language :: Python :: 3.9
|
||||
Classifier: Programming Language :: Python :: 3.10
|
||||
Classifier: Topic :: Communications
|
||||
Classifier: Topic :: Internet
|
||||
Requires-Python: >=3.7
|
||||
Provides-Extra: proxy
|
||||
Requires-Dist: pysocks; extra == 'proxy'
|
||||
Description-Content-Type: text/x-rst
|
||||
|
||||
Eclipse Paho™ MQTT Python Client
|
||||
================================
|
||||
|
||||
The `full documentation is available here <documentation_>`_.
|
||||
|
||||
**Warning breaking change** - Release 2.0 contains a breaking change; see the `release notes <https://github.com/eclipse/paho.mqtt.python/releases/tag/v2.0.0>`_ and `migration details <https://eclipse.dev/paho/files/paho.mqtt.python/html/migrations.html>`_.
|
||||
|
||||
This document describes the source code for the `Eclipse Paho <http://eclipse.org/paho/>`_ MQTT Python client library, which implements versions 5.0, 3.1.1, and 3.1 of the MQTT protocol.
|
||||
|
||||
This code provides a client class which enables applications to connect to an `MQTT <http://mqtt.org/>`_ broker to publish messages, and to subscribe to topics and receive published messages. It also provides some helper functions to make publishing one off messages to an MQTT server very straightforward.
|
||||
|
||||
It supports Python 3.7+.
|
||||
|
||||
The MQTT protocol is a machine-to-machine (M2M)/"Internet of Things" connectivity protocol. Designed as an extremely lightweight publish/subscribe messaging transport, it is useful for connections with remote locations where a small code footprint is required and/or network bandwidth is at a premium.
|
||||
|
||||
Paho is an `Eclipse Foundation <https://www.eclipse.org/org/foundation/>`_ project.
|
||||
|
||||
Contents
|
||||
--------
|
||||
|
||||
* Installation_
|
||||
* `Known limitations`_
|
||||
* `Usage and API`_
|
||||
* `Getting Started`_
|
||||
* `Client`_
|
||||
* `Network loop`_
|
||||
* `Callbacks`_
|
||||
* `Logger`_
|
||||
* `External event loop support`_
|
||||
* `Global helper functions`_
|
||||
* `Publish`_
|
||||
* `Single`_
|
||||
* `Multiple`_
|
||||
* `Subscribe`_
|
||||
* `Simple`_
|
||||
* `Using Callback`_
|
||||
* `Reporting bugs`_
|
||||
* `More information`_
|
||||
|
||||
|
||||
Installation
|
||||
------------
|
||||
|
||||
The latest stable version is available in the Python Package Index (PyPi) and can be installed using
|
||||
|
||||
::
|
||||
|
||||
pip install paho-mqtt
|
||||
|
||||
Or with ``virtualenv``:
|
||||
|
||||
::
|
||||
|
||||
virtualenv paho-mqtt
|
||||
source paho-mqtt/bin/activate
|
||||
pip install paho-mqtt
|
||||
|
||||
To obtain the full code, including examples and tests, you can clone the git repository:
|
||||
|
||||
::
|
||||
|
||||
git clone https://github.com/eclipse/paho.mqtt.python
|
||||
|
||||
|
||||
Once you have the code, it can be installed from your repository as well:
|
||||
|
||||
::
|
||||
|
||||
cd paho.mqtt.python
|
||||
pip install -e .
|
||||
|
||||
To perform all tests (including MQTT v5 tests), you also need to clone paho.mqtt.testing in paho.mqtt.python folder::
|
||||
|
||||
git clone https://github.com/eclipse/paho.mqtt.testing.git
|
||||
cd paho.mqtt.testing
|
||||
git checkout a4dc694010217b291ee78ee13a6d1db812f9babd
|
||||
|
||||
Known limitations
|
||||
-----------------
|
||||
|
||||
The following are the known unimplemented MQTT features.
|
||||
|
||||
When ``clean_session`` is False, the session is only stored in memory and not persisted. This means that
|
||||
when the client is restarted (not just reconnected, the object is recreated usually because the
|
||||
program was restarted) the session is lost. This results in a possible message loss.
|
||||
|
||||
The following part of the client session is lost:
|
||||
|
||||
* QoS 2 messages which have been received from the server, but have not been completely acknowledged.
|
||||
|
||||
Since the client will blindly acknowledge any PUBCOMP (last message of a QoS 2 transaction), it
|
||||
won't hang but will lose this QoS 2 message.
|
||||
|
||||
* QoS 1 and QoS 2 messages which have been sent to the server, but have not been completely acknowledged.
|
||||
|
||||
This means that messages passed to ``publish()`` may be lost. This could be mitigated by taking care
|
||||
that all messages passed to ``publish()`` have a corresponding ``on_publish()`` call or use `wait_for_publish`.
|
||||
|
||||
It also means that the broker may have the QoS2 message in the session. Since the client starts
|
||||
with an empty session it don't know it and will reuse the mid. This is not yet fixed.
|
||||
|
||||
Also, when ``clean_session`` is True, this library will republish QoS > 0 message across network
|
||||
reconnection. This means that QoS > 0 message won't be lost. But the standard says that
|
||||
we should discard any message for which the publish packet was sent. Our choice means that
|
||||
we are not compliant with the standard and it's possible for QoS 2 to be received twice.
|
||||
|
||||
You should set ``clean_session = False`` if you need the QoS 2 guarantee of only one delivery.
|
||||
|
||||
Usage and API
|
||||
-------------
|
||||
|
||||
Detailed API documentation `is available online <documentation_>`_ or could be built from ``docs/`` and samples are available in the `examples`_ directory.
|
||||
|
||||
The package provides two modules, a full `Client` and few `helpers` for simple publishing or subscribing.
|
||||
|
||||
Getting Started
|
||||
***************
|
||||
|
||||
Here is a very simple example that subscribes to the broker $SYS topic tree and prints out the resulting messages:
|
||||
|
||||
.. code:: python
|
||||
|
||||
import paho.mqtt.client as mqtt
|
||||
|
||||
# The callback for when the client receives a CONNACK response from the server.
|
||||
def on_connect(client, userdata, flags, reason_code, properties):
|
||||
print(f"Connected with result code {reason_code}")
|
||||
# Subscribing in on_connect() means that if we lose the connection and
|
||||
# reconnect then subscriptions will be renewed.
|
||||
client.subscribe("$SYS/#")
|
||||
|
||||
# The callback for when a PUBLISH message is received from the server.
|
||||
def on_message(client, userdata, msg):
|
||||
print(msg.topic+" "+str(msg.payload))
|
||||
|
||||
mqttc = mqtt.Client(mqtt.CallbackAPIVersion.VERSION2)
|
||||
mqttc.on_connect = on_connect
|
||||
mqttc.on_message = on_message
|
||||
|
||||
mqttc.connect("mqtt.eclipseprojects.io", 1883, 60)
|
||||
|
||||
# Blocking call that processes network traffic, dispatches callbacks and
|
||||
# handles reconnecting.
|
||||
# Other loop*() functions are available that give a threaded interface and a
|
||||
# manual interface.
|
||||
mqttc.loop_forever()
|
||||
|
||||
Client
|
||||
******
|
||||
|
||||
You can use the client class as an instance, within a class or by subclassing. The general usage flow is as follows:
|
||||
|
||||
* Create a client instance
|
||||
* Connect to a broker using one of the ``connect*()`` functions
|
||||
* Call one of the ``loop*()`` functions to maintain network traffic flow with the broker
|
||||
* Use ``subscribe()`` to subscribe to a topic and receive messages
|
||||
* Use ``publish()`` to publish messages to the broker
|
||||
* Use ``disconnect()`` to disconnect from the broker
|
||||
|
||||
Callbacks will be called to allow the application to process events as necessary. These callbacks are described below.
|
||||
|
||||
Network loop
|
||||
````````````
|
||||
|
||||
These functions are the driving force behind the client. If they are not
|
||||
called, incoming network data will not be processed and outgoing network data
|
||||
will not be sent. There are four options for managing the
|
||||
network loop. Three are described here, the fourth in "External event loop
|
||||
support" below. Do not mix the different loop functions.
|
||||
|
||||
loop_start() / loop_stop()
|
||||
''''''''''''''''''''''''''
|
||||
|
||||
.. code:: python
|
||||
|
||||
mqttc.loop_start()
|
||||
|
||||
while True:
|
||||
temperature = sensor.blocking_read()
|
||||
mqttc.publish("paho/temperature", temperature)
|
||||
|
||||
mqttc.loop_stop()
|
||||
|
||||
These functions implement a threaded interface to the network loop. Calling
|
||||
`loop_start()` once, before or after ``connect*()``, runs a thread in the
|
||||
background to call `loop()` automatically. This frees up the main thread for
|
||||
other work that may be blocking. This call also handles reconnecting to the
|
||||
broker. Call `loop_stop()` to stop the background thread.
|
||||
The loop is also stopped if you call `disconnect()`.
|
||||
|
||||
loop_forever()
|
||||
''''''''''''''
|
||||
|
||||
.. code:: python
|
||||
|
||||
mqttc.loop_forever(retry_first_connection=False)
|
||||
|
||||
This is a blocking form of the network loop and will not return until the
|
||||
client calls `disconnect()`. It automatically handles reconnecting.
|
||||
|
||||
Except for the first connection attempt when using `connect_async`, use
|
||||
``retry_first_connection=True`` to make it retry the first connection.
|
||||
|
||||
*Warning*: This might lead to situations where the client keeps connecting to an
|
||||
non existing host without failing.
|
||||
|
||||
loop()
|
||||
''''''
|
||||
|
||||
.. code:: python
|
||||
|
||||
run = True
|
||||
while run:
|
||||
rc = mqttc.loop(timeout=1.0)
|
||||
if rc != 0:
|
||||
# need to handle error, possible reconnecting or stopping the application
|
||||
|
||||
Call regularly to process network events. This call waits in ``select()`` until
|
||||
the network socket is available for reading or writing, if appropriate, then
|
||||
handles the incoming/outgoing data. This function blocks for up to ``timeout``
|
||||
seconds. ``timeout`` must not exceed the ``keepalive`` value for the client or
|
||||
your client will be regularly disconnected by the broker.
|
||||
|
||||
Using this kind of loop, require you to handle reconnection strategie.
|
||||
|
||||
|
||||
Callbacks
|
||||
`````````
|
||||
|
||||
The interface to interact with paho-mqtt include various callback that are called by
|
||||
the library when some events occur.
|
||||
|
||||
The callbacks are functions defined in your code, to implement the require action on those events. This could
|
||||
be simply printing received message or much more complex behaviour.
|
||||
|
||||
Callbacks API is versioned, and the selected version is the `CallbackAPIVersion` you provided to `Client`
|
||||
constructor. Currently two version are supported:
|
||||
|
||||
* ``CallbackAPIVersion.VERSION1``: it's the historical version used in paho-mqtt before version 2.0.
|
||||
It's the API used before the introduction of `CallbackAPIVersion`.
|
||||
This version is deprecated and will be removed in paho-mqtt version 3.0.
|
||||
* ``CallbackAPIVersion.VERSION2``: This version is more consistent between protocol MQTT 3.x and MQTT 5.x. It's also
|
||||
much more usable with MQTT 5.x since reason code and properties are always provided when available.
|
||||
It's recommended for all user to upgrade to this version. It's highly recommended for MQTT 5.x user.
|
||||
|
||||
The following callbacks exists:
|
||||
|
||||
* `on_connect()`: called when the CONNACK from the broker is received. The call could be for a refused connection,
|
||||
check the reason_code to see if the connection is successful or rejected.
|
||||
* `on_connect_fail()`: called by `loop_forever()` and `loop_start()` when the TCP connection failed to establish.
|
||||
This callback is not called when using `connect()` or `reconnect()` directly. It's only called following
|
||||
an automatic (re)connection made by `loop_start()` and `loop_forever()`
|
||||
* `on_disconnect()`: called when the connection is closed.
|
||||
* `on_message()`: called when a MQTT message is received from the broker.
|
||||
* `on_publish()`: called when an MQTT message was sent to the broker. Depending on QoS level the callback is called
|
||||
at different moment:
|
||||
|
||||
* For QoS == 0, it's called as soon as the message is sent over the network. This could be before the corresponding ``publish()`` return.
|
||||
* For QoS == 1, it's called when the corresponding PUBACK is received from the broker
|
||||
* For QoS == 2, it's called when the corresponding PUBCOMP is received from the broker
|
||||
* `on_subscribe()`: called when the SUBACK is received from the broker
|
||||
* `on_unsubscribe()`: called when the UNSUBACK is received from the broker
|
||||
* `on_log()`: called when the library log a message
|
||||
* `on_socket_open`, `on_socket_close`, `on_socket_register_write`, `on_socket_unregister_write`: callbacks used for external loop support. See below for details.
|
||||
|
||||
For the signature of each callback, see the `online documentation <documentation_>`_.
|
||||
|
||||
Subscriber example
|
||||
''''''''''''''''''
|
||||
|
||||
.. code:: python
|
||||
|
||||
import paho.mqtt.client as mqtt
|
||||
|
||||
def on_subscribe(client, userdata, mid, reason_code_list, properties):
|
||||
# Since we subscribed only for a single channel, reason_code_list contains
|
||||
# a single entry
|
||||
if reason_code_list[0].is_failure:
|
||||
print(f"Broker rejected you subscription: {reason_code_list[0]}")
|
||||
else:
|
||||
print(f"Broker granted the following QoS: {reason_code_list[0].value}")
|
||||
|
||||
def on_unsubscribe(client, userdata, mid, reason_code_list, properties):
|
||||
# Be careful, the reason_code_list is only present in MQTTv5.
|
||||
# In MQTTv3 it will always be empty
|
||||
if len(reason_code_list) == 0 or not reason_code_list[0].is_failure:
|
||||
print("unsubscribe succeeded (if SUBACK is received in MQTTv3 it success)")
|
||||
else:
|
||||
print(f"Broker replied with failure: {reason_code_list[0]}")
|
||||
client.disconnect()
|
||||
|
||||
def on_message(client, userdata, message):
|
||||
# userdata is the structure we choose to provide, here it's a list()
|
||||
userdata.append(message.payload)
|
||||
# We only want to process 10 messages
|
||||
if len(userdata) >= 10:
|
||||
client.unsubscribe("$SYS/#")
|
||||
|
||||
def on_connect(client, userdata, flags, reason_code, properties):
|
||||
if reason_code.is_failure:
|
||||
print(f"Failed to connect: {reason_code}. loop_forever() will retry connection")
|
||||
else:
|
||||
# we should always subscribe from on_connect callback to be sure
|
||||
# our subscribed is persisted across reconnections.
|
||||
client.subscribe("$SYS/#")
|
||||
|
||||
mqttc = mqtt.Client(mqtt.CallbackAPIVersion.VERSION2)
|
||||
mqttc.on_connect = on_connect
|
||||
mqttc.on_message = on_message
|
||||
mqttc.on_subscribe = on_subscribe
|
||||
mqttc.on_unsubscribe = on_unsubscribe
|
||||
|
||||
mqttc.user_data_set([])
|
||||
mqttc.connect("mqtt.eclipseprojects.io")
|
||||
mqttc.loop_forever()
|
||||
print(f"Received the following message: {mqttc.user_data_get()}")
|
||||
|
||||
publisher example
|
||||
'''''''''''''''''
|
||||
|
||||
.. code:: python
|
||||
|
||||
import time
|
||||
import paho.mqtt.client as mqtt
|
||||
|
||||
def on_publish(client, userdata, mid, reason_code, properties):
|
||||
# reason_code and properties will only be present in MQTTv5. It's always unset in MQTTv3
|
||||
try:
|
||||
userdata.remove(mid)
|
||||
except KeyError:
|
||||
print("on_publish() is called with a mid not present in unacked_publish")
|
||||
print("This is due to an unavoidable race-condition:")
|
||||
print("* publish() return the mid of the message sent.")
|
||||
print("* mid from publish() is added to unacked_publish by the main thread")
|
||||
print("* on_publish() is called by the loop_start thread")
|
||||
print("While unlikely (because on_publish() will be called after a network round-trip),")
|
||||
print(" this is a race-condition that COULD happen")
|
||||
print("")
|
||||
print("The best solution to avoid race-condition is using the msg_info from publish()")
|
||||
print("We could also try using a list of acknowledged mid rather than removing from pending list,")
|
||||
print("but remember that mid could be re-used !")
|
||||
|
||||
unacked_publish = set()
|
||||
mqttc = mqtt.Client(mqtt.CallbackAPIVersion.VERSION2)
|
||||
mqttc.on_publish = on_publish
|
||||
|
||||
mqttc.user_data_set(unacked_publish)
|
||||
mqttc.connect("mqtt.eclipseprojects.io")
|
||||
mqttc.loop_start()
|
||||
|
||||
# Our application produce some messages
|
||||
msg_info = mqttc.publish("paho/test/topic", "my message", qos=1)
|
||||
unacked_publish.add(msg_info.mid)
|
||||
|
||||
msg_info2 = mqttc.publish("paho/test/topic", "my message2", qos=1)
|
||||
unacked_publish.add(msg_info2.mid)
|
||||
|
||||
# Wait for all message to be published
|
||||
while len(unacked_publish):
|
||||
time.sleep(0.1)
|
||||
|
||||
# Due to race-condition described above, the following way to wait for all publish is safer
|
||||
msg_info.wait_for_publish()
|
||||
msg_info2.wait_for_publish()
|
||||
|
||||
mqttc.disconnect()
|
||||
mqttc.loop_stop()
|
||||
|
||||
|
||||
Logger
|
||||
``````
|
||||
|
||||
The Client emit some log message that could be useful during troubleshooting. The easiest way to
|
||||
enable logs is the call `enable_logger()`. It's possible to provide a custom logger or let the
|
||||
default logger being used.
|
||||
|
||||
Example:
|
||||
|
||||
.. code:: python
|
||||
|
||||
import logging
|
||||
import paho.mqtt.client as mqtt
|
||||
|
||||
logging.basicConfig(level=logging.DEBUG)
|
||||
|
||||
mqttc = mqtt.Client(mqtt.CallbackAPIVersion.VERSION2)
|
||||
mqttc.enable_logger()
|
||||
|
||||
mqttc.connect("mqtt.eclipseprojects.io", 1883, 60)
|
||||
mqttc.loop_start()
|
||||
|
||||
# Do additional action needed, publish, subscribe, ...
|
||||
[...]
|
||||
|
||||
It's also possible to define a on_log callback that will receive a copy of all log messages. Example:
|
||||
|
||||
.. code:: python
|
||||
|
||||
import paho.mqtt.client as mqtt
|
||||
|
||||
def on_log(client, userdata, paho_log_level, messages):
|
||||
if paho_log_level == mqtt.LogLevel.MQTT_LOG_ERR:
|
||||
print(message)
|
||||
|
||||
mqttc = mqtt.Client(mqtt.CallbackAPIVersion.VERSION2)
|
||||
mqttc.on_log = on_log
|
||||
|
||||
mqttc.connect("mqtt.eclipseprojects.io", 1883, 60)
|
||||
mqttc.loop_start()
|
||||
|
||||
# Do additional action needed, publish, subscribe, ...
|
||||
[...]
|
||||
|
||||
|
||||
The correspondence with Paho logging levels and standard ones is the following:
|
||||
|
||||
==================== ===============
|
||||
Paho logging
|
||||
==================== ===============
|
||||
``MQTT_LOG_ERR`` ``logging.ERROR``
|
||||
``MQTT_LOG_WARNING`` ``logging.WARNING``
|
||||
``MQTT_LOG_NOTICE`` ``logging.INFO`` *(no direct equivalent)*
|
||||
``MQTT_LOG_INFO`` ``logging.INFO``
|
||||
``MQTT_LOG_DEBUG`` ``logging.DEBUG``
|
||||
==================== ===============
|
||||
|
||||
|
||||
External event loop support
|
||||
```````````````````````````
|
||||
|
||||
To support other network loop like asyncio (see examples_), the library expose some
|
||||
method and callback to support those use-case.
|
||||
|
||||
The following loop method exists:
|
||||
|
||||
* `loop_read`: should be called when the socket is ready for reading.
|
||||
* `loop_write`: should be called when the socket is ready for writing AND the library want to write data.
|
||||
* `loop_misc`: should be called every few seconds to handle message retrying and pings.
|
||||
|
||||
In pseudo code, it give the following:
|
||||
|
||||
.. code:: python
|
||||
|
||||
while run:
|
||||
if need_read:
|
||||
mqttc.loop_read()
|
||||
if need_write:
|
||||
mqttc.loop_write()
|
||||
mqttc.loop_misc()
|
||||
|
||||
if not need_read and not need_write:
|
||||
# But don't wait more than few seconds, loop_misc() need to be called regularly
|
||||
wait_for_change_in_need_read_or_write()
|
||||
updated_need_read_and_write()
|
||||
|
||||
The tricky part is implementing the update of need_read / need_write and wait for condition change. To support
|
||||
this, the following method exists:
|
||||
|
||||
* `socket()`: which return the socket object when the TCP connection is open.
|
||||
This call is particularly useful for select_ based loops. See ``examples/loop_select.py``.
|
||||
* `want_write()`: return true if there is data waiting to be written. This is close to the
|
||||
``need_writew`` of above pseudo-code, but you should also check whether the socket is ready for writing.
|
||||
* callbacks ``on_socket_*``:
|
||||
|
||||
* `on_socket_open`: called when the socket is opened.
|
||||
* `on_socket_close`: called when the socket is about to be closed.
|
||||
* `on_socket_register_write`: called when there is data the client want to write on the socket
|
||||
* `on_socket_unregister_write`: called when there is no more data to write on the socket.
|
||||
|
||||
Callbacks are particularly useful for event loops where you register or unregister a socket
|
||||
for reading+writing. See ``examples/loop_asyncio.py`` for an example.
|
||||
|
||||
.. _select: https://docs.python.org/3/library/select.html#select.select
|
||||
|
||||
The callbacks are always called in this order:
|
||||
|
||||
- `on_socket_open`
|
||||
- Zero or more times:
|
||||
|
||||
- `on_socket_register_write`
|
||||
- `on_socket_unregister_write`
|
||||
|
||||
- `on_socket_close`
|
||||
|
||||
Global helper functions
|
||||
```````````````````````
|
||||
|
||||
The client module also offers some global helper functions.
|
||||
|
||||
``topic_matches_sub(sub, topic)`` can be used to check whether a ``topic``
|
||||
matches a ``subscription``.
|
||||
|
||||
For example:
|
||||
|
||||
the topic ``foo/bar`` would match the subscription ``foo/#`` or ``+/bar``
|
||||
|
||||
the topic ``non/matching`` would not match the subscription ``non/+/+``
|
||||
|
||||
|
||||
Publish
|
||||
*******
|
||||
|
||||
This module provides some helper functions to allow straightforward publishing
|
||||
of messages in a one-shot manner. In other words, they are useful for the
|
||||
situation where you have a single/multiple messages you want to publish to a
|
||||
broker, then disconnect with nothing else required.
|
||||
|
||||
The two functions provided are `single()` and `multiple()`.
|
||||
|
||||
Both functions include support for MQTT v5.0, but do not currently let you
|
||||
set any properties on connection or when sending messages.
|
||||
|
||||
Single
|
||||
``````
|
||||
|
||||
Publish a single message to a broker, then disconnect cleanly.
|
||||
|
||||
Example:
|
||||
|
||||
.. code:: python
|
||||
|
||||
import paho.mqtt.publish as publish
|
||||
|
||||
publish.single("paho/test/topic", "payload", hostname="mqtt.eclipseprojects.io")
|
||||
|
||||
Multiple
|
||||
````````
|
||||
|
||||
Publish multiple messages to a broker, then disconnect cleanly.
|
||||
|
||||
Example:
|
||||
|
||||
.. code:: python
|
||||
|
||||
from paho.mqtt.enums import MQTTProtocolVersion
|
||||
import paho.mqtt.publish as publish
|
||||
|
||||
msgs = [{'topic':"paho/test/topic", 'payload':"multiple 1"},
|
||||
("paho/test/topic", "multiple 2", 0, False)]
|
||||
publish.multiple(msgs, hostname="mqtt.eclipseprojects.io", protocol=MQTTProtocolVersion.MQTTv5)
|
||||
|
||||
|
||||
Subscribe
|
||||
*********
|
||||
|
||||
This module provides some helper functions to allow straightforward subscribing
|
||||
and processing of messages.
|
||||
|
||||
The two functions provided are `simple()` and `callback()`.
|
||||
|
||||
Both functions include support for MQTT v5.0, but do not currently let you
|
||||
set any properties on connection or when subscribing.
|
||||
|
||||
Simple
|
||||
``````
|
||||
|
||||
Subscribe to a set of topics and return the messages received. This is a
|
||||
blocking function.
|
||||
|
||||
Example:
|
||||
|
||||
.. code:: python
|
||||
|
||||
import paho.mqtt.subscribe as subscribe
|
||||
|
||||
msg = subscribe.simple("paho/test/topic", hostname="mqtt.eclipseprojects.io")
|
||||
print("%s %s" % (msg.topic, msg.payload))
|
||||
|
||||
Using Callback
|
||||
``````````````
|
||||
|
||||
Subscribe to a set of topics and process the messages received using a user
|
||||
provided callback.
|
||||
|
||||
Example:
|
||||
|
||||
.. code:: python
|
||||
|
||||
import paho.mqtt.subscribe as subscribe
|
||||
|
||||
def on_message_print(client, userdata, message):
|
||||
print("%s %s" % (message.topic, message.payload))
|
||||
userdata["message_count"] += 1
|
||||
if userdata["message_count"] >= 5:
|
||||
# it's possible to stop the program by disconnecting
|
||||
client.disconnect()
|
||||
|
||||
subscribe.callback(on_message_print, "paho/test/topic", hostname="mqtt.eclipseprojects.io", userdata={"message_count": 0})
|
||||
|
||||
|
||||
Reporting bugs
|
||||
--------------
|
||||
|
||||
Please report bugs in the issues tracker at https://github.com/eclipse/paho.mqtt.python/issues.
|
||||
|
||||
More information
|
||||
----------------
|
||||
|
||||
Discussion of the Paho clients takes place on the `Eclipse paho-dev mailing list <https://dev.eclipse.org/mailman/listinfo/paho-dev>`_.
|
||||
|
||||
General questions about the MQTT protocol itself (not this library) are discussed in the `MQTT Google Group <https://groups.google.com/forum/?fromgroups#!forum/mqtt>`_.
|
||||
|
||||
There is much more information available via the `MQTT community site <http://mqtt.org/>`_.
|
||||
|
||||
.. _examples: https://github.com/eclipse/paho.mqtt.python/tree/master/examples
|
||||
.. _documentation: https://eclipse.dev/paho/files/paho.mqtt.python/html/client.html
|
||||
@@ -0,0 +1,29 @@
|
||||
paho/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
||||
paho/__pycache__/__init__.cpython-311.pyc,,
|
||||
paho/mqtt/__init__.py,sha256=D0jPAtaZau0deGs4-DBSNj_wvBmCGRLtI-AUtfAxJzU,65
|
||||
paho/mqtt/__pycache__/__init__.cpython-311.pyc,,
|
||||
paho/mqtt/__pycache__/client.cpython-311.pyc,,
|
||||
paho/mqtt/__pycache__/enums.cpython-311.pyc,,
|
||||
paho/mqtt/__pycache__/matcher.cpython-311.pyc,,
|
||||
paho/mqtt/__pycache__/packettypes.cpython-311.pyc,,
|
||||
paho/mqtt/__pycache__/properties.cpython-311.pyc,,
|
||||
paho/mqtt/__pycache__/publish.cpython-311.pyc,,
|
||||
paho/mqtt/__pycache__/reasoncodes.cpython-311.pyc,,
|
||||
paho/mqtt/__pycache__/subscribe.cpython-311.pyc,,
|
||||
paho/mqtt/__pycache__/subscribeoptions.cpython-311.pyc,,
|
||||
paho/mqtt/client.py,sha256=Wj8Pc7NEVBgoWGqQ95pr7suOQ5bYuBBkvCkgwahTYYo,202624
|
||||
paho/mqtt/enums.py,sha256=4iGMsOtVUXHK_cOfDJxncBDbq1eluGbm3HaiI1jPq8I,2977
|
||||
paho/mqtt/matcher.py,sha256=VIbFAQoaKrPArQf_qNT_BM1FMJKxW38Ok27R3w2G-B0,2783
|
||||
paho/mqtt/packettypes.py,sha256=CNSNDyHGsPGhCrk9CBUnpNXxA0nEnzEaVg4Krb6RoOQ,1453
|
||||
paho/mqtt/properties.py,sha256=JEuKvHJtliHvN7py-iMLWdQ0jsxpiWbaIOkCfvU6hyQ,17369
|
||||
paho/mqtt/publish.py,sha256=4imGVhhbrqHUVNmfiwgQ1BPPj3HWWvXcjx5DQIj_Oig,11576
|
||||
paho/mqtt/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
||||
paho/mqtt/reasoncodes.py,sha256=x12KK6-kSO0-KFNanoGDuNzHHJx6zpNm6PAGyrzuSXk,9648
|
||||
paho/mqtt/subscribe.py,sha256=KAkgTewUu5of4sd7hsAriB0l6_gMQLIYxfJrOvQg6ds,11667
|
||||
paho/mqtt/subscribeoptions.py,sha256=bWGVKG3qdc9IPlqpbRSbL84c0gK2Bbi7Mgp6k5G3GdM,4846
|
||||
paho_mqtt-2.1.0.dist-info/INSTALLER,sha256=zuuue4knoyJ-UwPPXg8fezS7VCrXJQrAP7zeNuwvFQg,4
|
||||
paho_mqtt-2.1.0.dist-info/METADATA,sha256=rcfCP_Qax2rFWJZAIt11AsqacMMkA4WeLCKD4He_ojA,23463
|
||||
paho_mqtt-2.1.0.dist-info/RECORD,,
|
||||
paho_mqtt-2.1.0.dist-info/REQUESTED,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
||||
paho_mqtt-2.1.0.dist-info/WHEEL,sha256=zEMcRr9Kr03x1ozGwg5v9NQBKn3kndp6LSoSlVg-jhU,87
|
||||
paho_mqtt-2.1.0.dist-info/licenses/LICENSE.txt,sha256=ZkCLBJJJw72wuh7ShfVCLOZ-Nx1AFRvr1NgGr0VP_nw,156
|
||||
@@ -0,0 +1,4 @@
|
||||
Wheel-Version: 1.0
|
||||
Generator: hatchling 1.24.2
|
||||
Root-Is-Purelib: true
|
||||
Tag: py3-none-any
|
||||
@@ -0,0 +1,3 @@
|
||||
This project is dual licensed under the Eclipse Public License 2.0 and the
|
||||
Eclipse Distribution License 1.0 as described in the epl-v20 and edl-v10 files.
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
pip
|
||||
@@ -0,0 +1,20 @@
|
||||
Copyright (c) 2008-present The pip developers (see AUTHORS.txt file)
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining
|
||||
a copy of this software and associated documentation files (the
|
||||
"Software"), to deal in the Software without restriction, including
|
||||
without limitation the rights to use, copy, modify, merge, publish,
|
||||
distribute, sublicense, and/or sell copies of the Software, and to
|
||||
permit persons to whom the Software is furnished to do so, subject to
|
||||
the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be
|
||||
included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
||||
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
||||
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
||||
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
@@ -0,0 +1,88 @@
|
||||
Metadata-Version: 2.1
|
||||
Name: pip
|
||||
Version: 23.0.1
|
||||
Summary: The PyPA recommended tool for installing Python packages.
|
||||
Home-page: https://pip.pypa.io/
|
||||
Author: The pip developers
|
||||
Author-email: [email protected]
|
||||
License: MIT
|
||||
Project-URL: Documentation, https://pip.pypa.io
|
||||
Project-URL: Source, https://github.com/pypa/pip
|
||||
Project-URL: Changelog, https://pip.pypa.io/en/stable/news/
|
||||
Classifier: Development Status :: 5 - Production/Stable
|
||||
Classifier: Intended Audience :: Developers
|
||||
Classifier: License :: OSI Approved :: MIT License
|
||||
Classifier: Topic :: Software Development :: Build Tools
|
||||
Classifier: Programming Language :: Python
|
||||
Classifier: Programming Language :: Python :: 3
|
||||
Classifier: Programming Language :: Python :: 3 :: Only
|
||||
Classifier: Programming Language :: Python :: 3.7
|
||||
Classifier: Programming Language :: Python :: 3.8
|
||||
Classifier: Programming Language :: Python :: 3.9
|
||||
Classifier: Programming Language :: Python :: 3.10
|
||||
Classifier: Programming Language :: Python :: 3.11
|
||||
Classifier: Programming Language :: Python :: Implementation :: CPython
|
||||
Classifier: Programming Language :: Python :: Implementation :: PyPy
|
||||
Requires-Python: >=3.7
|
||||
License-File: LICENSE.txt
|
||||
|
||||
pip - The Python Package Installer
|
||||
==================================
|
||||
|
||||
.. image:: https://img.shields.io/pypi/v/pip.svg
|
||||
:target: https://pypi.org/project/pip/
|
||||
|
||||
.. image:: https://readthedocs.org/projects/pip/badge/?version=latest
|
||||
:target: https://pip.pypa.io/en/latest
|
||||
|
||||
pip is the `package installer`_ for Python. You can use pip to install packages from the `Python Package Index`_ and other indexes.
|
||||
|
||||
Please take a look at our documentation for how to install and use pip:
|
||||
|
||||
* `Installation`_
|
||||
* `Usage`_
|
||||
|
||||
We release updates regularly, with a new version every 3 months. Find more details in our documentation:
|
||||
|
||||
* `Release notes`_
|
||||
* `Release process`_
|
||||
|
||||
In pip 20.3, we've `made a big improvement to the heart of pip`_; `learn more`_. We want your input, so `sign up for our user experience research studies`_ to help us do it right.
|
||||
|
||||
**Note**: pip 21.0, in January 2021, removed Python 2 support, per pip's `Python 2 support policy`_. Please migrate to Python 3.
|
||||
|
||||
If you find bugs, need help, or want to talk to the developers, please use our mailing lists or chat rooms:
|
||||
|
||||
* `Issue tracking`_
|
||||
* `Discourse channel`_
|
||||
* `User IRC`_
|
||||
|
||||
If you want to get involved head over to GitHub to get the source code, look at our development documentation and feel free to jump on the developer mailing lists and chat rooms:
|
||||
|
||||
* `GitHub page`_
|
||||
* `Development documentation`_
|
||||
* `Development IRC`_
|
||||
|
||||
Code of Conduct
|
||||
---------------
|
||||
|
||||
Everyone interacting in the pip project's codebases, issue trackers, chat
|
||||
rooms, and mailing lists is expected to follow the `PSF Code of Conduct`_.
|
||||
|
||||
.. _package installer: https://packaging.python.org/guides/tool-recommendations/
|
||||
.. _Python Package Index: https://pypi.org
|
||||
.. _Installation: https://pip.pypa.io/en/stable/installation/
|
||||
.. _Usage: https://pip.pypa.io/en/stable/
|
||||
.. _Release notes: https://pip.pypa.io/en/stable/news.html
|
||||
.. _Release process: https://pip.pypa.io/en/latest/development/release-process/
|
||||
.. _GitHub page: https://github.com/pypa/pip
|
||||
.. _Development documentation: https://pip.pypa.io/en/latest/development
|
||||
.. _made a big improvement to the heart of pip: https://pyfound.blogspot.com/2020/11/pip-20-3-new-resolver.html
|
||||
.. _learn more: https://pip.pypa.io/en/latest/user_guide/#changes-to-the-pip-dependency-resolver-in-20-3-2020
|
||||
.. _sign up for our user experience research studies: https://pyfound.blogspot.com/2020/03/new-pip-resolver-to-roll-out-this-year.html
|
||||
.. _Python 2 support policy: https://pip.pypa.io/en/latest/development/release-process/#python-2-support
|
||||
.. _Issue tracking: https://github.com/pypa/pip/issues
|
||||
.. _Discourse channel: https://discuss.python.org/c/packaging
|
||||
.. _User IRC: https://kiwiirc.com/nextclient/#ircs://irc.libera.chat:+6697/pypa
|
||||
.. _Development IRC: https://kiwiirc.com/nextclient/#ircs://irc.libera.chat:+6697/pypa-dev
|
||||
.. _PSF Code of Conduct: https://github.com/pypa/.github/blob/main/CODE_OF_CONDUCT.md
|
||||
@@ -0,0 +1,996 @@
|
||||
../../../bin/pip,sha256=VSXb2wM19-AbpbRja1vOR-NdDGPI8HabRDhAs4-WrFE,249
|
||||
../../../bin/pip3,sha256=VSXb2wM19-AbpbRja1vOR-NdDGPI8HabRDhAs4-WrFE,249
|
||||
../../../bin/pip3.11,sha256=VSXb2wM19-AbpbRja1vOR-NdDGPI8HabRDhAs4-WrFE,249
|
||||
pip-23.0.1.dist-info/INSTALLER,sha256=zuuue4knoyJ-UwPPXg8fezS7VCrXJQrAP7zeNuwvFQg,4
|
||||
pip-23.0.1.dist-info/LICENSE.txt,sha256=Y0MApmnUmurmWxLGxIySTFGkzfPR_whtw0VtyLyqIQQ,1093
|
||||
pip-23.0.1.dist-info/METADATA,sha256=POh89utz-H1e0K-xDY9CL9gs-x0MjH-AWxbhJG3aaVE,4072
|
||||
pip-23.0.1.dist-info/RECORD,,
|
||||
pip-23.0.1.dist-info/REQUESTED,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
||||
pip-23.0.1.dist-info/WHEEL,sha256=2wepM1nk4DS4eFpYrW1TTqPcoGNfHhhO_i5m4cOimbo,92
|
||||
pip-23.0.1.dist-info/entry_points.txt,sha256=xg35gOct0aY8S3ftLtweJ0uw3KBAIVyW4k-0Jx1rkNE,125
|
||||
pip-23.0.1.dist-info/top_level.txt,sha256=zuuue4knoyJ-UwPPXg8fezS7VCrXJQrAP7zeNuwvFQg,4
|
||||
pip/__init__.py,sha256=5yroedzc2dKKbcynDrHX8vBoLxqU27KmFvvHmdqQN9w,357
|
||||
pip/__main__.py,sha256=mXwWDftNLMKfwVqKFWGE_uuBZvGSIiUELhLkeysIuZc,1198
|
||||
pip/__pip-runner__.py,sha256=EnrfKmKMzWAdqg_JicLCOP9Y95Ux7zHh4ObvqLtQcjo,1444
|
||||
pip/__pycache__/__init__.cpython-311.pyc,,
|
||||
pip/__pycache__/__main__.cpython-311.pyc,,
|
||||
pip/__pycache__/__pip-runner__.cpython-311.pyc,,
|
||||
pip/_internal/__init__.py,sha256=nnFCuxrPMgALrIDxSoy-H6Zj4W4UY60D-uL1aJyq0pc,573
|
||||
pip/_internal/__pycache__/__init__.cpython-311.pyc,,
|
||||
pip/_internal/__pycache__/build_env.cpython-311.pyc,,
|
||||
pip/_internal/__pycache__/cache.cpython-311.pyc,,
|
||||
pip/_internal/__pycache__/configuration.cpython-311.pyc,,
|
||||
pip/_internal/__pycache__/exceptions.cpython-311.pyc,,
|
||||
pip/_internal/__pycache__/main.cpython-311.pyc,,
|
||||
pip/_internal/__pycache__/pyproject.cpython-311.pyc,,
|
||||
pip/_internal/__pycache__/self_outdated_check.cpython-311.pyc,,
|
||||
pip/_internal/__pycache__/wheel_builder.cpython-311.pyc,,
|
||||
pip/_internal/build_env.py,sha256=1ESpqw0iupS_K7phZK5zshVE5Czy9BtGLFU4W6Enva8,10243
|
||||
pip/_internal/cache.py,sha256=C3n78VnBga9rjPXZqht_4A4d-T25poC7K0qBM7FHDhU,10734
|
||||
pip/_internal/cli/__init__.py,sha256=FkHBgpxxb-_gd6r1FjnNhfMOzAUYyXoXKJ6abijfcFU,132
|
||||
pip/_internal/cli/__pycache__/__init__.cpython-311.pyc,,
|
||||
pip/_internal/cli/__pycache__/autocompletion.cpython-311.pyc,,
|
||||
pip/_internal/cli/__pycache__/base_command.cpython-311.pyc,,
|
||||
pip/_internal/cli/__pycache__/cmdoptions.cpython-311.pyc,,
|
||||
pip/_internal/cli/__pycache__/command_context.cpython-311.pyc,,
|
||||
pip/_internal/cli/__pycache__/main.cpython-311.pyc,,
|
||||
pip/_internal/cli/__pycache__/main_parser.cpython-311.pyc,,
|
||||
pip/_internal/cli/__pycache__/parser.cpython-311.pyc,,
|
||||
pip/_internal/cli/__pycache__/progress_bars.cpython-311.pyc,,
|
||||
pip/_internal/cli/__pycache__/req_command.cpython-311.pyc,,
|
||||
pip/_internal/cli/__pycache__/spinners.cpython-311.pyc,,
|
||||
pip/_internal/cli/__pycache__/status_codes.cpython-311.pyc,,
|
||||
pip/_internal/cli/autocompletion.py,sha256=wY2JPZY2Eji1vhR7bVo-yCBPJ9LCy6P80iOAhZD1Vi8,6676
|
||||
pip/_internal/cli/base_command.py,sha256=t1D5x40Hfn9HnPnMt-iSxvqL14nht2olBCacW74pc-k,7842
|
||||
pip/_internal/cli/cmdoptions.py,sha256=0AFz3vHEZeUUOpE4Ze0sBKmsS1OOd3aaWX3Fr2ov9BU,29496
|
||||
pip/_internal/cli/command_context.py,sha256=RHgIPwtObh5KhMrd3YZTkl8zbVG-6Okml7YbFX4Ehg0,774
|
||||
pip/_internal/cli/main.py,sha256=ioJ8IVlb2K1qLOxR-tXkee9lURhYV89CDM71MKag7YY,2472
|
||||
pip/_internal/cli/main_parser.py,sha256=laDpsuBDl6kyfywp9eMMA9s84jfH2TJJn-vmL0GG90w,4338
|
||||
pip/_internal/cli/parser.py,sha256=tWP-K1uSxnJyXu3WE0kkH3niAYRBeuUaxeydhzOdhL4,10817
|
||||
pip/_internal/cli/progress_bars.py,sha256=So4mPoSjXkXiSHiTzzquH3VVyVD_njXlHJSExYPXAow,1968
|
||||
pip/_internal/cli/req_command.py,sha256=ypTutLv4j_efxC2f6C6aCQufxre-zaJdi5m_tWlLeBk,18172
|
||||
pip/_internal/cli/spinners.py,sha256=hIJ83GerdFgFCdobIA23Jggetegl_uC4Sp586nzFbPE,5118
|
||||
pip/_internal/cli/status_codes.py,sha256=sEFHUaUJbqv8iArL3HAtcztWZmGOFX01hTesSytDEh0,116
|
||||
pip/_internal/commands/__init__.py,sha256=5oRO9O3dM2vGuh0bFw4HOVletryrz5HHMmmPWwJrH9U,3882
|
||||
pip/_internal/commands/__pycache__/__init__.cpython-311.pyc,,
|
||||
pip/_internal/commands/__pycache__/cache.cpython-311.pyc,,
|
||||
pip/_internal/commands/__pycache__/check.cpython-311.pyc,,
|
||||
pip/_internal/commands/__pycache__/completion.cpython-311.pyc,,
|
||||
pip/_internal/commands/__pycache__/configuration.cpython-311.pyc,,
|
||||
pip/_internal/commands/__pycache__/debug.cpython-311.pyc,,
|
||||
pip/_internal/commands/__pycache__/download.cpython-311.pyc,,
|
||||
pip/_internal/commands/__pycache__/freeze.cpython-311.pyc,,
|
||||
pip/_internal/commands/__pycache__/hash.cpython-311.pyc,,
|
||||
pip/_internal/commands/__pycache__/help.cpython-311.pyc,,
|
||||
pip/_internal/commands/__pycache__/index.cpython-311.pyc,,
|
||||
pip/_internal/commands/__pycache__/inspect.cpython-311.pyc,,
|
||||
pip/_internal/commands/__pycache__/install.cpython-311.pyc,,
|
||||
pip/_internal/commands/__pycache__/list.cpython-311.pyc,,
|
||||
pip/_internal/commands/__pycache__/search.cpython-311.pyc,,
|
||||
pip/_internal/commands/__pycache__/show.cpython-311.pyc,,
|
||||
pip/_internal/commands/__pycache__/uninstall.cpython-311.pyc,,
|
||||
pip/_internal/commands/__pycache__/wheel.cpython-311.pyc,,
|
||||
pip/_internal/commands/cache.py,sha256=muaT0mbL-ZUpn6AaushVAipzTiMwE4nV2BLbJBwt_KQ,7582
|
||||
pip/_internal/commands/check.py,sha256=0gjXR7j36xJT5cs2heYU_dfOfpnFfzX8OoPNNoKhqdM,1685
|
||||
pip/_internal/commands/completion.py,sha256=H0TJvGrdsoleuIyQKzJbicLFppYx2OZA0BLNpQDeFjI,4129
|
||||
pip/_internal/commands/configuration.py,sha256=NB5uf8HIX8-li95YLoZO09nALIWlLCHDF5aifSKcBn8,9815
|
||||
pip/_internal/commands/debug.py,sha256=AesEID-4gPFDWTwPiPaGZuD4twdT-imaGuMR5ZfSn8s,6591
|
||||
pip/_internal/commands/download.py,sha256=LwKEyYMG2L67nQRyGo8hQdNEeMU2bmGWqJfcB8JDXas,5289
|
||||
pip/_internal/commands/freeze.py,sha256=PaJJB9mT_3vHeZ3mbFL_m1fzTYL-_Or3kDtXwTdZZ-A,2968
|
||||
pip/_internal/commands/hash.py,sha256=EVVOuvGtoPEdFi8SNnmdqlCQrhCxV-kJsdwtdcCnXGQ,1703
|
||||
pip/_internal/commands/help.py,sha256=gcc6QDkcgHMOuAn5UxaZwAStsRBrnGSn_yxjS57JIoM,1132
|
||||
pip/_internal/commands/index.py,sha256=cGQVSA5dAs7caQ9sz4kllYvaI4ZpGiq1WhCgaImXNSA,4793
|
||||
pip/_internal/commands/inspect.py,sha256=2wSPt9yfr3r6g-s2S5L6PvRtaHNVyb4TuodMStJ39cw,3188
|
||||
pip/_internal/commands/install.py,sha256=3vT9tnHOV-p6dPMaKDqzivqmcq_kPAI-jVkxOEwN5C4,32389
|
||||
pip/_internal/commands/list.py,sha256=gI4BWR-6IVMFY3Ucwf9YGwxvCwXyTV5kVTDzJdKWqu0,12440
|
||||
pip/_internal/commands/search.py,sha256=sbBZiARRc050QquOKcCvOr2K3XLsoYebLKZGRi__iUI,5697
|
||||
pip/_internal/commands/show.py,sha256=t5jia4zcYJRJZy4U_Von7zMl03hJmmcofj6oDNTnj7Y,6419
|
||||
pip/_internal/commands/uninstall.py,sha256=OIqO9tqadY8kM4HwhFf1Q62fUIp7v8KDrTRo8yWMz7Y,3886
|
||||
pip/_internal/commands/wheel.py,sha256=mbFJd4dmUfrVFJkQbK8n2zHyRcD3AI91f7EUo9l3KYg,7396
|
||||
pip/_internal/configuration.py,sha256=uBKTus43pDIO6IzT2mLWQeROmHhtnoabhniKNjPYvD0,13529
|
||||
pip/_internal/distributions/__init__.py,sha256=Hq6kt6gXBgjNit5hTTWLAzeCNOKoB-N0pGYSqehrli8,858
|
||||
pip/_internal/distributions/__pycache__/__init__.cpython-311.pyc,,
|
||||
pip/_internal/distributions/__pycache__/base.cpython-311.pyc,,
|
||||
pip/_internal/distributions/__pycache__/installed.cpython-311.pyc,,
|
||||
pip/_internal/distributions/__pycache__/sdist.cpython-311.pyc,,
|
||||
pip/_internal/distributions/__pycache__/wheel.cpython-311.pyc,,
|
||||
pip/_internal/distributions/base.py,sha256=jrF1Vi7eGyqFqMHrieh1PIOrGU7KeCxhYPZnbvtmvGY,1221
|
||||
pip/_internal/distributions/installed.py,sha256=NI2OgsgH9iBq9l5vB-56vOg5YsybOy-AU4VE5CSCO2I,729
|
||||
pip/_internal/distributions/sdist.py,sha256=SQBdkatXSigKGG_SaD0U0p1Jwdfrg26UCNcHgkXZfdA,6494
|
||||
pip/_internal/distributions/wheel.py,sha256=m-J4XO-gvFerlYsFzzSXYDvrx8tLZlJFTCgDxctn8ig,1164
|
||||
pip/_internal/exceptions.py,sha256=cU4dz7x-1uFGrf2A1_Np9tKcy599bRJKRJkikgARxW4,24244
|
||||
pip/_internal/index/__init__.py,sha256=vpt-JeTZefh8a-FC22ZeBSXFVbuBcXSGiILhQZJaNpQ,30
|
||||
pip/_internal/index/__pycache__/__init__.cpython-311.pyc,,
|
||||
pip/_internal/index/__pycache__/collector.cpython-311.pyc,,
|
||||
pip/_internal/index/__pycache__/package_finder.cpython-311.pyc,,
|
||||
pip/_internal/index/__pycache__/sources.cpython-311.pyc,,
|
||||
pip/_internal/index/collector.py,sha256=3OmYZ3tCoRPGOrELSgQWG-03M-bQHa2-VCA3R_nJAaU,16504
|
||||
pip/_internal/index/package_finder.py,sha256=rrUw4vj7QE_eMt022jw--wQiKznMaUgVBkJ1UCrVUxo,37873
|
||||
pip/_internal/index/sources.py,sha256=SVyPitv08-Qalh2_Bk5diAJ9GAA_d-a93koouQodAG0,6557
|
||||
pip/_internal/locations/__init__.py,sha256=Dh8LJWG8LRlDK4JIj9sfRF96TREzE--N_AIlx7Tqoe4,15365
|
||||
pip/_internal/locations/__pycache__/__init__.cpython-311.pyc,,
|
||||
pip/_internal/locations/__pycache__/_distutils.cpython-311.pyc,,
|
||||
pip/_internal/locations/__pycache__/_sysconfig.cpython-311.pyc,,
|
||||
pip/_internal/locations/__pycache__/base.cpython-311.pyc,,
|
||||
pip/_internal/locations/_distutils.py,sha256=cmi6h63xYNXhQe7KEWEMaANjHFy5yQOPt_1_RCWyXMY,6100
|
||||
pip/_internal/locations/_sysconfig.py,sha256=jyNVtUfMIf0mtyY-Xp1m9yQ8iwECozSVVFmjkN9a2yw,7680
|
||||
pip/_internal/locations/base.py,sha256=RQiPi1d4FVM2Bxk04dQhXZ2PqkeljEL2fZZ9SYqIQ78,2556
|
||||
pip/_internal/main.py,sha256=r-UnUe8HLo5XFJz8inTcOOTiu_sxNhgHb6VwlGUllOI,340
|
||||
pip/_internal/metadata/__init__.py,sha256=84j1dPJaIoz5Q2ZTPi0uB1iaDAHiUNfKtYSGQCfFKpo,4280
|
||||
pip/_internal/metadata/__pycache__/__init__.cpython-311.pyc,,
|
||||
pip/_internal/metadata/__pycache__/_json.cpython-311.pyc,,
|
||||
pip/_internal/metadata/__pycache__/base.cpython-311.pyc,,
|
||||
pip/_internal/metadata/__pycache__/pkg_resources.cpython-311.pyc,,
|
||||
pip/_internal/metadata/_json.py,sha256=BTkWfFDrWFwuSodImjtbAh8wCL3isecbnjTb5E6UUDI,2595
|
||||
pip/_internal/metadata/base.py,sha256=vIwIo1BtoqegehWMAXhNrpLGYBq245rcaCNkBMPnTU8,25277
|
||||
pip/_internal/metadata/importlib/__init__.py,sha256=9ZVO8BoE7NEZPmoHp5Ap_NJo0HgNIezXXg-TFTtt3Z4,107
|
||||
pip/_internal/metadata/importlib/__pycache__/__init__.cpython-311.pyc,,
|
||||
pip/_internal/metadata/importlib/__pycache__/_compat.cpython-311.pyc,,
|
||||
pip/_internal/metadata/importlib/__pycache__/_dists.cpython-311.pyc,,
|
||||
pip/_internal/metadata/importlib/__pycache__/_envs.cpython-311.pyc,,
|
||||
pip/_internal/metadata/importlib/_compat.py,sha256=GAe_prIfCE4iUylrnr_2dJRlkkBVRUbOidEoID7LPoE,1882
|
||||
pip/_internal/metadata/importlib/_dists.py,sha256=BUV8y6D0PePZrEN3vfJL-m1FDqZ6YPRgAiBeBinHhNg,8181
|
||||
pip/_internal/metadata/importlib/_envs.py,sha256=7BxanCh3T7arusys__O2ZHJdnmDhQXFmfU7x1-jB5xI,7457
|
||||
pip/_internal/metadata/pkg_resources.py,sha256=WjwiNdRsvxqxL4MA5Tb5a_q3Q3sUhdpbZF8wGLtPMI0,9773
|
||||
pip/_internal/models/__init__.py,sha256=3DHUd_qxpPozfzouoqa9g9ts1Czr5qaHfFxbnxriepM,63
|
||||
pip/_internal/models/__pycache__/__init__.cpython-311.pyc,,
|
||||
pip/_internal/models/__pycache__/candidate.cpython-311.pyc,,
|
||||
pip/_internal/models/__pycache__/direct_url.cpython-311.pyc,,
|
||||
pip/_internal/models/__pycache__/format_control.cpython-311.pyc,,
|
||||
pip/_internal/models/__pycache__/index.cpython-311.pyc,,
|
||||
pip/_internal/models/__pycache__/installation_report.cpython-311.pyc,,
|
||||
pip/_internal/models/__pycache__/link.cpython-311.pyc,,
|
||||
pip/_internal/models/__pycache__/scheme.cpython-311.pyc,,
|
||||
pip/_internal/models/__pycache__/search_scope.cpython-311.pyc,,
|
||||
pip/_internal/models/__pycache__/selection_prefs.cpython-311.pyc,,
|
||||
pip/_internal/models/__pycache__/target_python.cpython-311.pyc,,
|
||||
pip/_internal/models/__pycache__/wheel.cpython-311.pyc,,
|
||||
pip/_internal/models/candidate.py,sha256=6pcABsaR7CfIHlbJbr2_kMkVJFL_yrYjTx6SVWUnCPQ,990
|
||||
pip/_internal/models/direct_url.py,sha256=f3WiKUwWPdBkT1xm7DlolS32ZAMYh3jbkkVH-BUON5A,6626
|
||||
pip/_internal/models/format_control.py,sha256=DJpMYjxeYKKQdwNcML2_F0vtAh-qnKTYe-CpTxQe-4g,2520
|
||||
pip/_internal/models/index.py,sha256=tYnL8oxGi4aSNWur0mG8DAP7rC6yuha_MwJO8xw0crI,1030
|
||||
pip/_internal/models/installation_report.py,sha256=Hymmzv9-e3WhtewYm2NIOeMyAB6lXp736mpYqb9scZ0,2617
|
||||
pip/_internal/models/link.py,sha256=nfybVSpXgVHeU0MkC8hMkN2IgMup8Pdaudg74_sQEC8,18602
|
||||
pip/_internal/models/scheme.py,sha256=3EFQp_ICu_shH1-TBqhl0QAusKCPDFOlgHFeN4XowWs,738
|
||||
pip/_internal/models/search_scope.py,sha256=iGPQQ6a4Lau8oGQ_FWj8aRLik8A21o03SMO5KnSt-Cg,4644
|
||||
pip/_internal/models/selection_prefs.py,sha256=KZdi66gsR-_RUXUr9uejssk3rmTHrQVJWeNA2sV-VSY,1907
|
||||
pip/_internal/models/target_python.py,sha256=qKpZox7J8NAaPmDs5C_aniwfPDxzvpkrCKqfwndG87k,3858
|
||||
pip/_internal/models/wheel.py,sha256=YqazoIZyma_Q1ejFa1C7NHKQRRWlvWkdK96VRKmDBeI,3600
|
||||
pip/_internal/network/__init__.py,sha256=jf6Tt5nV_7zkARBrKojIXItgejvoegVJVKUbhAa5Ioc,50
|
||||
pip/_internal/network/__pycache__/__init__.cpython-311.pyc,,
|
||||
pip/_internal/network/__pycache__/auth.cpython-311.pyc,,
|
||||
pip/_internal/network/__pycache__/cache.cpython-311.pyc,,
|
||||
pip/_internal/network/__pycache__/download.cpython-311.pyc,,
|
||||
pip/_internal/network/__pycache__/lazy_wheel.cpython-311.pyc,,
|
||||
pip/_internal/network/__pycache__/session.cpython-311.pyc,,
|
||||
pip/_internal/network/__pycache__/utils.cpython-311.pyc,,
|
||||
pip/_internal/network/__pycache__/xmlrpc.cpython-311.pyc,,
|
||||
pip/_internal/network/auth.py,sha256=MQVP0k4hUXk8ReYEfsGQ5t7_TS7cNHQuaHJuBlJLHxU,16507
|
||||
pip/_internal/network/cache.py,sha256=hgXftU-eau4MWxHSLquTMzepYq5BPC2zhCkhN3glBy8,2145
|
||||
pip/_internal/network/download.py,sha256=HvDDq9bVqaN3jcS3DyVJHP7uTqFzbShdkf7NFSoHfkw,6096
|
||||
pip/_internal/network/lazy_wheel.py,sha256=PbPyuleNhtEq6b2S7rufoGXZWMD15FAGL4XeiAQ8FxA,7638
|
||||
pip/_internal/network/session.py,sha256=BpDOJ7_Xw5VkgPYWsePzcaqOfcyRZcB2AW7W0HGBST0,18443
|
||||
pip/_internal/network/utils.py,sha256=6A5SrUJEEUHxbGtbscwU2NpCyz-3ztiDlGWHpRRhsJ8,4073
|
||||
pip/_internal/network/xmlrpc.py,sha256=AzQgG4GgS152_cqmGr_Oz2MIXsCal-xfsis7fA7nmU0,1791
|
||||
pip/_internal/operations/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
||||
pip/_internal/operations/__pycache__/__init__.cpython-311.pyc,,
|
||||
pip/_internal/operations/__pycache__/check.cpython-311.pyc,,
|
||||
pip/_internal/operations/__pycache__/freeze.cpython-311.pyc,,
|
||||
pip/_internal/operations/__pycache__/prepare.cpython-311.pyc,,
|
||||
pip/_internal/operations/build/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
||||
pip/_internal/operations/build/__pycache__/__init__.cpython-311.pyc,,
|
||||
pip/_internal/operations/build/__pycache__/build_tracker.cpython-311.pyc,,
|
||||
pip/_internal/operations/build/__pycache__/metadata.cpython-311.pyc,,
|
||||
pip/_internal/operations/build/__pycache__/metadata_editable.cpython-311.pyc,,
|
||||
pip/_internal/operations/build/__pycache__/metadata_legacy.cpython-311.pyc,,
|
||||
pip/_internal/operations/build/__pycache__/wheel.cpython-311.pyc,,
|
||||
pip/_internal/operations/build/__pycache__/wheel_editable.cpython-311.pyc,,
|
||||
pip/_internal/operations/build/__pycache__/wheel_legacy.cpython-311.pyc,,
|
||||
pip/_internal/operations/build/build_tracker.py,sha256=vf81EwomN3xe9G8qRJED0VGqNikmRQRQoobNsxi5Xrs,4133
|
||||
pip/_internal/operations/build/metadata.py,sha256=9S0CUD8U3QqZeXp-Zyt8HxwU90lE4QrnYDgrqZDzBnc,1422
|
||||
pip/_internal/operations/build/metadata_editable.py,sha256=VLL7LvntKE8qxdhUdEJhcotFzUsOSI8NNS043xULKew,1474
|
||||
pip/_internal/operations/build/metadata_legacy.py,sha256=o-eU21As175hDC7dluM1fJJ_FqokTIShyWpjKaIpHZw,2198
|
||||
pip/_internal/operations/build/wheel.py,sha256=sT12FBLAxDC6wyrDorh8kvcZ1jG5qInCRWzzP-UkJiQ,1075
|
||||
pip/_internal/operations/build/wheel_editable.py,sha256=yOtoH6zpAkoKYEUtr8FhzrYnkNHQaQBjWQ2HYae1MQg,1417
|
||||
pip/_internal/operations/build/wheel_legacy.py,sha256=C9j6rukgQI1n_JeQLoZGuDdfUwzCXShyIdPTp6edbMQ,3064
|
||||
pip/_internal/operations/check.py,sha256=WsN7z0_QSgJjw0JsWWcqOHj4wWTaFv0J7mxgUByDCOg,5122
|
||||
pip/_internal/operations/freeze.py,sha256=mwTZ2uML8aQgo3k8MR79a7SZmmmvdAJqdyaknKbavmg,9784
|
||||
pip/_internal/operations/install/__init__.py,sha256=mX7hyD2GNBO2mFGokDQ30r_GXv7Y_PLdtxcUv144e-s,51
|
||||
pip/_internal/operations/install/__pycache__/__init__.cpython-311.pyc,,
|
||||
pip/_internal/operations/install/__pycache__/editable_legacy.cpython-311.pyc,,
|
||||
pip/_internal/operations/install/__pycache__/legacy.cpython-311.pyc,,
|
||||
pip/_internal/operations/install/__pycache__/wheel.cpython-311.pyc,,
|
||||
pip/_internal/operations/install/editable_legacy.py,sha256=ee4kfJHNuzTdKItbfAsNOSEwq_vD7DRPGkBdK48yBhU,1354
|
||||
pip/_internal/operations/install/legacy.py,sha256=cHdcHebyzf8w7OaOLwcsTNSMSSV8WBoAPFLay_9CjE8,4105
|
||||
pip/_internal/operations/install/wheel.py,sha256=CxzEg2wTPX4SxNTPIx0ozTqF1X7LhpCyP3iM2FjcKUE,27407
|
||||
pip/_internal/operations/prepare.py,sha256=BeYXrLFpRoV5XBnRXQHxRA2plyC36kK9Pms5D9wjCo4,25091
|
||||
pip/_internal/pyproject.py,sha256=QqSZR5AGwtf3HTa8NdbDq2yj9T2r9S2h9gnU4aX2Kvg,6987
|
||||
pip/_internal/req/__init__.py,sha256=rUQ9d_Sh3E5kNYqX9pkN0D06YL-LrtcbJQ-LiIonq08,2807
|
||||
pip/_internal/req/__pycache__/__init__.cpython-311.pyc,,
|
||||
pip/_internal/req/__pycache__/constructors.cpython-311.pyc,,
|
||||
pip/_internal/req/__pycache__/req_file.cpython-311.pyc,,
|
||||
pip/_internal/req/__pycache__/req_install.cpython-311.pyc,,
|
||||
pip/_internal/req/__pycache__/req_set.cpython-311.pyc,,
|
||||
pip/_internal/req/__pycache__/req_uninstall.cpython-311.pyc,,
|
||||
pip/_internal/req/constructors.py,sha256=ypjtq1mOQ3d2mFkFPMf_6Mr8SLKeHQk3tUKHA1ddG0U,16611
|
||||
pip/_internal/req/req_file.py,sha256=N6lPO3c0to_G73YyGAnk7VUYmed5jV4Qxgmt1xtlXVg,17646
|
||||
pip/_internal/req/req_install.py,sha256=X4WNQlTtvkeATwWdSiJcNLihwbYI_EnGDgE99p-Aa00,35763
|
||||
pip/_internal/req/req_set.py,sha256=j3esG0s6SzoVReX9rWn4rpYNtyET_fwxbwJPRimvRxo,2858
|
||||
pip/_internal/req/req_uninstall.py,sha256=ZFQfgSNz6H1BMsgl87nQNr2iaQCcbFcmXpW8rKVQcic,24045
|
||||
pip/_internal/resolution/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
||||
pip/_internal/resolution/__pycache__/__init__.cpython-311.pyc,,
|
||||
pip/_internal/resolution/__pycache__/base.cpython-311.pyc,,
|
||||
pip/_internal/resolution/base.py,sha256=qlmh325SBVfvG6Me9gc5Nsh5sdwHBwzHBq6aEXtKsLA,583
|
||||
pip/_internal/resolution/legacy/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
||||
pip/_internal/resolution/legacy/__pycache__/__init__.cpython-311.pyc,,
|
||||
pip/_internal/resolution/legacy/__pycache__/resolver.cpython-311.pyc,,
|
||||
pip/_internal/resolution/legacy/resolver.py,sha256=9em8D5TcSsEN4xZM1WreaRShOnyM4LlvhMSHpUPsocE,24129
|
||||
pip/_internal/resolution/resolvelib/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
||||
pip/_internal/resolution/resolvelib/__pycache__/__init__.cpython-311.pyc,,
|
||||
pip/_internal/resolution/resolvelib/__pycache__/base.cpython-311.pyc,,
|
||||
pip/_internal/resolution/resolvelib/__pycache__/candidates.cpython-311.pyc,,
|
||||
pip/_internal/resolution/resolvelib/__pycache__/factory.cpython-311.pyc,,
|
||||
pip/_internal/resolution/resolvelib/__pycache__/found_candidates.cpython-311.pyc,,
|
||||
pip/_internal/resolution/resolvelib/__pycache__/provider.cpython-311.pyc,,
|
||||
pip/_internal/resolution/resolvelib/__pycache__/reporter.cpython-311.pyc,,
|
||||
pip/_internal/resolution/resolvelib/__pycache__/requirements.cpython-311.pyc,,
|
||||
pip/_internal/resolution/resolvelib/__pycache__/resolver.cpython-311.pyc,,
|
||||
pip/_internal/resolution/resolvelib/base.py,sha256=u1O4fkvCO4mhmu5i32xrDv9AX5NgUci_eYVyBDQhTIM,5220
|
||||
pip/_internal/resolution/resolvelib/candidates.py,sha256=6kQZeMzwibnL4lO6bW0hUQQjNEvXfADdFphRRkRvOtc,18963
|
||||
pip/_internal/resolution/resolvelib/factory.py,sha256=OnjkLIgyk5Tol7uOOqapA1D4qiRHWmPU18DF1yN5N8o,27878
|
||||
pip/_internal/resolution/resolvelib/found_candidates.py,sha256=hvL3Hoa9VaYo-qEOZkBi2Iqw251UDxPz-uMHVaWmLpE,5705
|
||||
pip/_internal/resolution/resolvelib/provider.py,sha256=Vd4jW_NnyifB-HMkPYtZIO70M3_RM0MbL5YV6XyBM-w,9914
|
||||
pip/_internal/resolution/resolvelib/reporter.py,sha256=3ZVVYrs5PqvLFJkGLcuXoMK5mTInFzl31xjUpDBpZZk,2526
|
||||
pip/_internal/resolution/resolvelib/requirements.py,sha256=B1ndvKPSuyyyTEXt9sKhbwminViSWnBrJa7qO2ln4Z0,5455
|
||||
pip/_internal/resolution/resolvelib/resolver.py,sha256=nYZ9bTFXj5c1ILKnkSgU7tUCTYyo5V5J-J0sKoA7Wzg,11533
|
||||
pip/_internal/self_outdated_check.py,sha256=pnqBuKKZQ8OxKP0MaUUiDHl3AtyoMJHHG4rMQ7YcYXY,8167
|
||||
pip/_internal/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
||||
pip/_internal/utils/__pycache__/__init__.cpython-311.pyc,,
|
||||
pip/_internal/utils/__pycache__/_log.cpython-311.pyc,,
|
||||
pip/_internal/utils/__pycache__/appdirs.cpython-311.pyc,,
|
||||
pip/_internal/utils/__pycache__/compat.cpython-311.pyc,,
|
||||
pip/_internal/utils/__pycache__/compatibility_tags.cpython-311.pyc,,
|
||||
pip/_internal/utils/__pycache__/datetime.cpython-311.pyc,,
|
||||
pip/_internal/utils/__pycache__/deprecation.cpython-311.pyc,,
|
||||
pip/_internal/utils/__pycache__/direct_url_helpers.cpython-311.pyc,,
|
||||
pip/_internal/utils/__pycache__/distutils_args.cpython-311.pyc,,
|
||||
pip/_internal/utils/__pycache__/egg_link.cpython-311.pyc,,
|
||||
pip/_internal/utils/__pycache__/encoding.cpython-311.pyc,,
|
||||
pip/_internal/utils/__pycache__/entrypoints.cpython-311.pyc,,
|
||||
pip/_internal/utils/__pycache__/filesystem.cpython-311.pyc,,
|
||||
pip/_internal/utils/__pycache__/filetypes.cpython-311.pyc,,
|
||||
pip/_internal/utils/__pycache__/glibc.cpython-311.pyc,,
|
||||
pip/_internal/utils/__pycache__/hashes.cpython-311.pyc,,
|
||||
pip/_internal/utils/__pycache__/inject_securetransport.cpython-311.pyc,,
|
||||
pip/_internal/utils/__pycache__/logging.cpython-311.pyc,,
|
||||
pip/_internal/utils/__pycache__/misc.cpython-311.pyc,,
|
||||
pip/_internal/utils/__pycache__/models.cpython-311.pyc,,
|
||||
pip/_internal/utils/__pycache__/packaging.cpython-311.pyc,,
|
||||
pip/_internal/utils/__pycache__/setuptools_build.cpython-311.pyc,,
|
||||
pip/_internal/utils/__pycache__/subprocess.cpython-311.pyc,,
|
||||
pip/_internal/utils/__pycache__/temp_dir.cpython-311.pyc,,
|
||||
pip/_internal/utils/__pycache__/unpacking.cpython-311.pyc,,
|
||||
pip/_internal/utils/__pycache__/urls.cpython-311.pyc,,
|
||||
pip/_internal/utils/__pycache__/virtualenv.cpython-311.pyc,,
|
||||
pip/_internal/utils/__pycache__/wheel.cpython-311.pyc,,
|
||||
pip/_internal/utils/_log.py,sha256=-jHLOE_THaZz5BFcCnoSL9EYAtJ0nXem49s9of4jvKw,1015
|
||||
pip/_internal/utils/appdirs.py,sha256=swgcTKOm3daLeXTW6v5BUS2Ti2RvEnGRQYH_yDXklAo,1665
|
||||
pip/_internal/utils/compat.py,sha256=ACyBfLgj3_XG-iA5omEDrXqDM0cQKzi8h8HRBInzG6Q,1884
|
||||
pip/_internal/utils/compatibility_tags.py,sha256=ydin8QG8BHqYRsPY4OL6cmb44CbqXl1T0xxS97VhHkk,5377
|
||||
pip/_internal/utils/datetime.py,sha256=m21Y3wAtQc-ji6Veb6k_M5g6A0ZyFI4egchTdnwh-pQ,242
|
||||
pip/_internal/utils/deprecation.py,sha256=OLc7GzDwPob9y8jscDYCKUNBV-9CWwqFplBOJPLOpBM,5764
|
||||
pip/_internal/utils/direct_url_helpers.py,sha256=6F1tc2rcKaCZmgfVwsE6ObIe_Pux23mUVYA-2D9wCFc,3206
|
||||
pip/_internal/utils/distutils_args.py,sha256=bYUt4wfFJRaeGO4VHia6FNaA8HlYXMcKuEq1zYijY5g,1115
|
||||
pip/_internal/utils/egg_link.py,sha256=ZryCchR_yQSCsdsMkCpxQjjLbQxObA5GDtLG0RR5mGc,2118
|
||||
pip/_internal/utils/encoding.py,sha256=qqsXDtiwMIjXMEiIVSaOjwH5YmirCaK-dIzb6-XJsL0,1169
|
||||
pip/_internal/utils/entrypoints.py,sha256=YlhLTRl2oHBAuqhc-zmL7USS67TPWVHImjeAQHreZTQ,3064
|
||||
pip/_internal/utils/filesystem.py,sha256=RhMIXUaNVMGjc3rhsDahWQ4MavvEQDdqXqgq-F6fpw8,5122
|
||||
pip/_internal/utils/filetypes.py,sha256=i8XAQ0eFCog26Fw9yV0Yb1ygAqKYB1w9Cz9n0fj8gZU,716
|
||||
pip/_internal/utils/glibc.py,sha256=tDfwVYnJCOC0BNVpItpy8CGLP9BjkxFHdl0mTS0J7fc,3110
|
||||
pip/_internal/utils/hashes.py,sha256=1WhkVNIHNfuYLafBHThIjVKGplxFJXSlQtuG2mXNlJI,4831
|
||||
pip/_internal/utils/inject_securetransport.py,sha256=o-QRVMGiENrTJxw3fAhA7uxpdEdw6M41TjHYtSVRrcg,795
|
||||
pip/_internal/utils/logging.py,sha256=U2q0i1n8hPS2gQh8qcocAg5dovGAa_bR24akmXMzrk4,11632
|
||||
pip/_internal/utils/misc.py,sha256=lX22zJrsk-Q00ghAHB81yHpc_8q7Hp5Vto4k7QDzLfg,23220
|
||||
pip/_internal/utils/models.py,sha256=5GoYU586SrxURMvDn_jBMJInitviJg4O5-iOU-6I0WY,1193
|
||||
pip/_internal/utils/packaging.py,sha256=5Wm6_x7lKrlqVjPI5MBN_RurcRHwVYoQ7Ksrs84de7s,2108
|
||||
pip/_internal/utils/setuptools_build.py,sha256=4i3CuS34yNrkePnZ73rR47pyDzpZBo-SX9V5PNDSSHY,5662
|
||||
pip/_internal/utils/subprocess.py,sha256=0EMhgfPGFk8FZn6Qq7Hp9PN6YHuQNWiVby4DXcTCON4,9200
|
||||
pip/_internal/utils/temp_dir.py,sha256=aCX489gRa4Nu0dMKRFyGhV6maJr60uEynu5uCbKR4Qg,7702
|
||||
pip/_internal/utils/unpacking.py,sha256=SBb2iV1crb89MDRTEKY86R4A_UOWApTQn9VQVcMDOlE,8821
|
||||
pip/_internal/utils/urls.py,sha256=AhaesUGl-9it6uvG6fsFPOr9ynFpGaTMk4t5XTX7Z_Q,1759
|
||||
pip/_internal/utils/virtualenv.py,sha256=S6f7csYorRpiD6cvn3jISZYc3I8PJC43H5iMFpRAEDU,3456
|
||||
pip/_internal/utils/wheel.py,sha256=lXOgZyTlOm5HmK8tw5iw0A3_5A6wRzsXHOaQkIvvloU,4549
|
||||
pip/_internal/vcs/__init__.py,sha256=UAqvzpbi0VbZo3Ub6skEeZAw-ooIZR-zX_WpCbxyCoU,596
|
||||
pip/_internal/vcs/__pycache__/__init__.cpython-311.pyc,,
|
||||
pip/_internal/vcs/__pycache__/bazaar.cpython-311.pyc,,
|
||||
pip/_internal/vcs/__pycache__/git.cpython-311.pyc,,
|
||||
pip/_internal/vcs/__pycache__/mercurial.cpython-311.pyc,,
|
||||
pip/_internal/vcs/__pycache__/subversion.cpython-311.pyc,,
|
||||
pip/_internal/vcs/__pycache__/versioncontrol.cpython-311.pyc,,
|
||||
pip/_internal/vcs/bazaar.py,sha256=j0oin0fpGRHcCFCxEcpPCQoFEvA-DMLULKdGP8Nv76o,3519
|
||||
pip/_internal/vcs/git.py,sha256=mjhwudCx9WlLNkxZ6_kOKmueF0rLoU2i1xeASKF6yiQ,18116
|
||||
pip/_internal/vcs/mercurial.py,sha256=Bzbd518Jsx-EJI0IhIobiQqiRsUv5TWYnrmRIFWE0Gw,5238
|
||||
pip/_internal/vcs/subversion.py,sha256=vhZs8L-TNggXqM1bbhl-FpbxE3TrIB6Tgnx8fh3S2HE,11729
|
||||
pip/_internal/vcs/versioncontrol.py,sha256=KUOc-hN51em9jrqxKwUR3JnkgSE-xSOqMiiJcSaL6B8,22811
|
||||
pip/_internal/wheel_builder.py,sha256=8cObBCu4mIsMJqZM7xXI9DO3vldiAnRNa1Gt6izPPTs,13079
|
||||
pip/_vendor/__init__.py,sha256=fNxOSVD0auElsD8fN9tuq5psfgMQ-RFBtD4X5gjlRkg,4966
|
||||
pip/_vendor/__pycache__/__init__.cpython-311.pyc,,
|
||||
pip/_vendor/__pycache__/six.cpython-311.pyc,,
|
||||
pip/_vendor/__pycache__/typing_extensions.cpython-311.pyc,,
|
||||
pip/_vendor/cachecontrol/__init__.py,sha256=hrxlv3q7upsfyMw8k3gQ9vagBax1pYHSGGqYlZ0Zk0M,465
|
||||
pip/_vendor/cachecontrol/__pycache__/__init__.cpython-311.pyc,,
|
||||
pip/_vendor/cachecontrol/__pycache__/_cmd.cpython-311.pyc,,
|
||||
pip/_vendor/cachecontrol/__pycache__/adapter.cpython-311.pyc,,
|
||||
pip/_vendor/cachecontrol/__pycache__/cache.cpython-311.pyc,,
|
||||
pip/_vendor/cachecontrol/__pycache__/compat.cpython-311.pyc,,
|
||||
pip/_vendor/cachecontrol/__pycache__/controller.cpython-311.pyc,,
|
||||
pip/_vendor/cachecontrol/__pycache__/filewrapper.cpython-311.pyc,,
|
||||
pip/_vendor/cachecontrol/__pycache__/heuristics.cpython-311.pyc,,
|
||||
pip/_vendor/cachecontrol/__pycache__/serialize.cpython-311.pyc,,
|
||||
pip/_vendor/cachecontrol/__pycache__/wrapper.cpython-311.pyc,,
|
||||
pip/_vendor/cachecontrol/_cmd.py,sha256=lxUXqfNTVx84zf6tcWbkLZHA6WVBRtJRpfeA9ZqhaAY,1379
|
||||
pip/_vendor/cachecontrol/adapter.py,sha256=ew9OYEQHEOjvGl06ZsuX8W3DAvHWsQKHwWAxISyGug8,5033
|
||||
pip/_vendor/cachecontrol/cache.py,sha256=Tty45fOjH40fColTGkqKQvQQmbYsMpk-nCyfLcv2vG4,1535
|
||||
pip/_vendor/cachecontrol/caches/__init__.py,sha256=h-1cUmOz6mhLsjTjOrJ8iPejpGdLCyG4lzTftfGZvLg,242
|
||||
pip/_vendor/cachecontrol/caches/__pycache__/__init__.cpython-311.pyc,,
|
||||
pip/_vendor/cachecontrol/caches/__pycache__/file_cache.cpython-311.pyc,,
|
||||
pip/_vendor/cachecontrol/caches/__pycache__/redis_cache.cpython-311.pyc,,
|
||||
pip/_vendor/cachecontrol/caches/file_cache.py,sha256=GpexcE29LoY4MaZwPUTcUBZaDdcsjqyLxZFznk8Hbr4,5271
|
||||
pip/_vendor/cachecontrol/caches/redis_cache.py,sha256=mp-QWonP40I3xJGK3XVO-Gs9a3UjzlqqEmp9iLJH9F4,1033
|
||||
pip/_vendor/cachecontrol/compat.py,sha256=LNx7vqBndYdHU8YuJt53ab_8rzMGTXVrvMb7CZJkxG0,778
|
||||
pip/_vendor/cachecontrol/controller.py,sha256=bAYrt7x_VH4toNpI066LQxbHpYGpY1MxxmZAhspplvw,16416
|
||||
pip/_vendor/cachecontrol/filewrapper.py,sha256=X4BAQOO26GNOR7nH_fhTzAfeuct2rBQcx_15MyFBpcs,3946
|
||||
pip/_vendor/cachecontrol/heuristics.py,sha256=8kAyuZLSCyEIgQr6vbUwfhpqg9ows4mM0IV6DWazevI,4154
|
||||
pip/_vendor/cachecontrol/serialize.py,sha256=_U1NU_C-SDgFzkbAxAsPDgMTHeTWZZaHCQnZN_jh0U8,7105
|
||||
pip/_vendor/cachecontrol/wrapper.py,sha256=X3-KMZ20Ho3VtqyVaXclpeQpFzokR5NE8tZSfvKVaB8,774
|
||||
pip/_vendor/certifi/__init__.py,sha256=bK_nm9bLJzNvWZc2oZdiTwg2KWD4HSPBWGaM0zUDvMw,94
|
||||
pip/_vendor/certifi/__main__.py,sha256=1k3Cr95vCxxGRGDljrW3wMdpZdL3Nhf0u1n-k2qdsCY,255
|
||||
pip/_vendor/certifi/__pycache__/__init__.cpython-311.pyc,,
|
||||
pip/_vendor/certifi/__pycache__/__main__.cpython-311.pyc,,
|
||||
pip/_vendor/certifi/__pycache__/core.cpython-311.pyc,,
|
||||
pip/_vendor/certifi/cacert.pem,sha256=LBHDzgj_xA05AxnHK8ENT5COnGNElNZe0svFUHMf1SQ,275233
|
||||
pip/_vendor/certifi/core.py,sha256=DNTl8b_B6C4vO3Vc9_q2uvwHpNnBQoy5onDC4McImxc,4531
|
||||
pip/_vendor/chardet/__init__.py,sha256=57R-HSxj0PWmILMN0GFmUNqEMfrEVSamXyjD-W6_fbs,4797
|
||||
pip/_vendor/chardet/__pycache__/__init__.cpython-311.pyc,,
|
||||
pip/_vendor/chardet/__pycache__/big5freq.cpython-311.pyc,,
|
||||
pip/_vendor/chardet/__pycache__/big5prober.cpython-311.pyc,,
|
||||
pip/_vendor/chardet/__pycache__/chardistribution.cpython-311.pyc,,
|
||||
pip/_vendor/chardet/__pycache__/charsetgroupprober.cpython-311.pyc,,
|
||||
pip/_vendor/chardet/__pycache__/charsetprober.cpython-311.pyc,,
|
||||
pip/_vendor/chardet/__pycache__/codingstatemachine.cpython-311.pyc,,
|
||||
pip/_vendor/chardet/__pycache__/codingstatemachinedict.cpython-311.pyc,,
|
||||
pip/_vendor/chardet/__pycache__/cp949prober.cpython-311.pyc,,
|
||||
pip/_vendor/chardet/__pycache__/enums.cpython-311.pyc,,
|
||||
pip/_vendor/chardet/__pycache__/escprober.cpython-311.pyc,,
|
||||
pip/_vendor/chardet/__pycache__/escsm.cpython-311.pyc,,
|
||||
pip/_vendor/chardet/__pycache__/eucjpprober.cpython-311.pyc,,
|
||||
pip/_vendor/chardet/__pycache__/euckrfreq.cpython-311.pyc,,
|
||||
pip/_vendor/chardet/__pycache__/euckrprober.cpython-311.pyc,,
|
||||
pip/_vendor/chardet/__pycache__/euctwfreq.cpython-311.pyc,,
|
||||
pip/_vendor/chardet/__pycache__/euctwprober.cpython-311.pyc,,
|
||||
pip/_vendor/chardet/__pycache__/gb2312freq.cpython-311.pyc,,
|
||||
pip/_vendor/chardet/__pycache__/gb2312prober.cpython-311.pyc,,
|
||||
pip/_vendor/chardet/__pycache__/hebrewprober.cpython-311.pyc,,
|
||||
pip/_vendor/chardet/__pycache__/jisfreq.cpython-311.pyc,,
|
||||
pip/_vendor/chardet/__pycache__/johabfreq.cpython-311.pyc,,
|
||||
pip/_vendor/chardet/__pycache__/johabprober.cpython-311.pyc,,
|
||||
pip/_vendor/chardet/__pycache__/jpcntx.cpython-311.pyc,,
|
||||
pip/_vendor/chardet/__pycache__/langbulgarianmodel.cpython-311.pyc,,
|
||||
pip/_vendor/chardet/__pycache__/langgreekmodel.cpython-311.pyc,,
|
||||
pip/_vendor/chardet/__pycache__/langhebrewmodel.cpython-311.pyc,,
|
||||
pip/_vendor/chardet/__pycache__/langhungarianmodel.cpython-311.pyc,,
|
||||
pip/_vendor/chardet/__pycache__/langrussianmodel.cpython-311.pyc,,
|
||||
pip/_vendor/chardet/__pycache__/langthaimodel.cpython-311.pyc,,
|
||||
pip/_vendor/chardet/__pycache__/langturkishmodel.cpython-311.pyc,,
|
||||
pip/_vendor/chardet/__pycache__/latin1prober.cpython-311.pyc,,
|
||||
pip/_vendor/chardet/__pycache__/macromanprober.cpython-311.pyc,,
|
||||
pip/_vendor/chardet/__pycache__/mbcharsetprober.cpython-311.pyc,,
|
||||
pip/_vendor/chardet/__pycache__/mbcsgroupprober.cpython-311.pyc,,
|
||||
pip/_vendor/chardet/__pycache__/mbcssm.cpython-311.pyc,,
|
||||
pip/_vendor/chardet/__pycache__/resultdict.cpython-311.pyc,,
|
||||
pip/_vendor/chardet/__pycache__/sbcharsetprober.cpython-311.pyc,,
|
||||
pip/_vendor/chardet/__pycache__/sbcsgroupprober.cpython-311.pyc,,
|
||||
pip/_vendor/chardet/__pycache__/sjisprober.cpython-311.pyc,,
|
||||
pip/_vendor/chardet/__pycache__/universaldetector.cpython-311.pyc,,
|
||||
pip/_vendor/chardet/__pycache__/utf1632prober.cpython-311.pyc,,
|
||||
pip/_vendor/chardet/__pycache__/utf8prober.cpython-311.pyc,,
|
||||
pip/_vendor/chardet/__pycache__/version.cpython-311.pyc,,
|
||||
pip/_vendor/chardet/big5freq.py,sha256=ltcfP-3PjlNHCoo5e4a7C4z-2DhBTXRfY6jbMbB7P30,31274
|
||||
pip/_vendor/chardet/big5prober.py,sha256=lPMfwCX6v2AaPgvFh_cSWZcgLDbWiFCHLZ_p9RQ9uxE,1763
|
||||
pip/_vendor/chardet/chardistribution.py,sha256=13B8XUG4oXDuLdXvfbIWwLFeR-ZU21AqTS1zcdON8bU,10032
|
||||
pip/_vendor/chardet/charsetgroupprober.py,sha256=UKK3SaIZB2PCdKSIS0gnvMtLR9JJX62M-fZJu3OlWyg,3915
|
||||
pip/_vendor/chardet/charsetprober.py,sha256=L3t8_wIOov8em-vZWOcbkdsrwe43N6_gqNh5pH7WPd4,5420
|
||||
pip/_vendor/chardet/cli/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
||||
pip/_vendor/chardet/cli/__pycache__/__init__.cpython-311.pyc,,
|
||||
pip/_vendor/chardet/cli/__pycache__/chardetect.cpython-311.pyc,,
|
||||
pip/_vendor/chardet/cli/chardetect.py,sha256=zibMVg5RpKb-ME9_7EYG4ZM2Sf07NHcQzZ12U-rYJho,3242
|
||||
pip/_vendor/chardet/codingstatemachine.py,sha256=K7k69sw3jY5DmTXoSJQVsUtFIQKYPQVOSJJhBuGv_yE,3732
|
||||
pip/_vendor/chardet/codingstatemachinedict.py,sha256=0GY3Hi2qIZvDrOOJ3AtqppM1RsYxr_66ER4EHjuMiMc,542
|
||||
pip/_vendor/chardet/cp949prober.py,sha256=0jKRV7fECuWI16rNnks0ZECKA1iZYCIEaP8A1ZvjUSI,1860
|
||||
pip/_vendor/chardet/enums.py,sha256=TzECiZoCKNMqgwU76cPCeKWFBqaWvAdLMev5_bCkhY8,1683
|
||||
pip/_vendor/chardet/escprober.py,sha256=Kho48X65xE0scFylIdeJjM2bcbvRvv0h0WUbMWrJD3A,4006
|
||||
pip/_vendor/chardet/escsm.py,sha256=AqyXpA2FQFD7k-buBty_7itGEYkhmVa8X09NLRul3QM,12176
|
||||
pip/_vendor/chardet/eucjpprober.py,sha256=5KYaM9fsxkRYzw1b5k0fL-j_-ezIw-ij9r97a9MHxLY,3934
|
||||
pip/_vendor/chardet/euckrfreq.py,sha256=3mHuRvXfsq_QcQysDQFb8qSudvTiol71C6Ic2w57tKM,13566
|
||||
pip/_vendor/chardet/euckrprober.py,sha256=hiFT6wM174GIwRvqDsIcuOc-dDsq2uPKMKbyV8-1Xnc,1753
|
||||
pip/_vendor/chardet/euctwfreq.py,sha256=2alILE1Lh5eqiFJZjzRkMQXolNJRHY5oBQd-vmZYFFM,36913
|
||||
pip/_vendor/chardet/euctwprober.py,sha256=NxbpNdBtU0VFI0bKfGfDkpP7S2_8_6FlO87dVH0ogws,1753
|
||||
pip/_vendor/chardet/gb2312freq.py,sha256=49OrdXzD-HXqwavkqjo8Z7gvs58hONNzDhAyMENNkvY,20735
|
||||
pip/_vendor/chardet/gb2312prober.py,sha256=KPEBueaSLSvBpFeINMu0D6TgHcR90e5PaQawifzF4o0,1759
|
||||
pip/_vendor/chardet/hebrewprober.py,sha256=96T_Lj_OmW-fK7JrSHojYjyG3fsGgbzkoTNleZ3kfYE,14537
|
||||
pip/_vendor/chardet/jisfreq.py,sha256=mm8tfrwqhpOd3wzZKS4NJqkYBQVcDfTM2JiQ5aW932E,25796
|
||||
pip/_vendor/chardet/johabfreq.py,sha256=dBpOYG34GRX6SL8k_LbS9rxZPMjLjoMlgZ03Pz5Hmqc,42498
|
||||
pip/_vendor/chardet/johabprober.py,sha256=O1Qw9nVzRnun7vZp4UZM7wvJSv9W941mEU9uDMnY3DU,1752
|
||||
pip/_vendor/chardet/jpcntx.py,sha256=uhHrYWkLxE_rF5OkHKInm0HUsrjgKHHVQvtt3UcvotA,27055
|
||||
pip/_vendor/chardet/langbulgarianmodel.py,sha256=vmbvYFP8SZkSxoBvLkFqKiH1sjma5ihk3PTpdy71Rr4,104562
|
||||
pip/_vendor/chardet/langgreekmodel.py,sha256=JfB7bupjjJH2w3X_mYnQr9cJA_7EuITC2cRW13fUjeI,98484
|
||||
pip/_vendor/chardet/langhebrewmodel.py,sha256=3HXHaLQPNAGcXnJjkIJfozNZLTvTJmf4W5Awi6zRRKc,98196
|
||||
pip/_vendor/chardet/langhungarianmodel.py,sha256=WxbeQIxkv8YtApiNqxQcvj-tMycsoI4Xy-fwkDHpP_Y,101363
|
||||
pip/_vendor/chardet/langrussianmodel.py,sha256=s395bTZ87ESTrZCOdgXbEjZ9P1iGPwCl_8xSsac_DLY,128035
|
||||
pip/_vendor/chardet/langthaimodel.py,sha256=7bJlQitRpTnVGABmbSznHnJwOHDy3InkTvtFUx13WQI,102774
|
||||
pip/_vendor/chardet/langturkishmodel.py,sha256=XY0eGdTIy4eQ9Xg1LVPZacb-UBhHBR-cq0IpPVHowKc,95372
|
||||
pip/_vendor/chardet/latin1prober.py,sha256=p15EEmFbmQUwbKLC7lOJVGHEZwcG45ubEZYTGu01J5g,5380
|
||||
pip/_vendor/chardet/macromanprober.py,sha256=9anfzmY6TBfUPDyBDOdY07kqmTHpZ1tK0jL-p1JWcOY,6077
|
||||
pip/_vendor/chardet/mbcharsetprober.py,sha256=Wr04WNI4F3X_VxEverNG-H25g7u-MDDKlNt-JGj-_uU,3715
|
||||
pip/_vendor/chardet/mbcsgroupprober.py,sha256=iRpaNBjV0DNwYPu_z6TiHgRpwYahiM7ztI_4kZ4Uz9A,2131
|
||||
pip/_vendor/chardet/mbcssm.py,sha256=hUtPvDYgWDaA2dWdgLsshbwRfm3Q5YRlRogdmeRUNQw,30391
|
||||
pip/_vendor/chardet/metadata/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
||||
pip/_vendor/chardet/metadata/__pycache__/__init__.cpython-311.pyc,,
|
||||
pip/_vendor/chardet/metadata/__pycache__/languages.cpython-311.pyc,,
|
||||
pip/_vendor/chardet/metadata/languages.py,sha256=FhvBIdZFxRQ-dTwkb_0madRKgVBCaUMQz9I5xqjE5iQ,13560
|
||||
pip/_vendor/chardet/resultdict.py,sha256=ez4FRvN5KaSosJeJ2WzUyKdDdg35HDy_SSLPXKCdt5M,402
|
||||
pip/_vendor/chardet/sbcharsetprober.py,sha256=-nd3F90i7GpXLjehLVHqVBE0KlWzGvQUPETLBNn4o6U,6400
|
||||
pip/_vendor/chardet/sbcsgroupprober.py,sha256=gcgI0fOfgw_3YTClpbra_MNxwyEyJ3eUXraoLHYb59E,4137
|
||||
pip/_vendor/chardet/sjisprober.py,sha256=aqQufMzRw46ZpFlzmYaYeT2-nzmKb-hmcrApppJ862k,4007
|
||||
pip/_vendor/chardet/universaldetector.py,sha256=xYBrg4x0dd9WnT8qclfADVD9ondrUNkqPmvte1pa520,14848
|
||||
pip/_vendor/chardet/utf1632prober.py,sha256=pw1epGdMj1hDGiCu1AHqqzOEfjX8MVdiW7O1BlT8-eQ,8505
|
||||
pip/_vendor/chardet/utf8prober.py,sha256=8m08Ub5490H4jQ6LYXvFysGtgKoKsHUd2zH_i8_TnVw,2812
|
||||
pip/_vendor/chardet/version.py,sha256=lGtJcxGM44Qz4Cbk4rbbmrKxnNr1-97U25TameLehZw,244
|
||||
pip/_vendor/colorama/__init__.py,sha256=wePQA4U20tKgYARySLEC047ucNX-g8pRLpYBuiHlLb8,266
|
||||
pip/_vendor/colorama/__pycache__/__init__.cpython-311.pyc,,
|
||||
pip/_vendor/colorama/__pycache__/ansi.cpython-311.pyc,,
|
||||
pip/_vendor/colorama/__pycache__/ansitowin32.cpython-311.pyc,,
|
||||
pip/_vendor/colorama/__pycache__/initialise.cpython-311.pyc,,
|
||||
pip/_vendor/colorama/__pycache__/win32.cpython-311.pyc,,
|
||||
pip/_vendor/colorama/__pycache__/winterm.cpython-311.pyc,,
|
||||
pip/_vendor/colorama/ansi.py,sha256=Top4EeEuaQdBWdteKMEcGOTeKeF19Q-Wo_6_Cj5kOzQ,2522
|
||||
pip/_vendor/colorama/ansitowin32.py,sha256=vPNYa3OZbxjbuFyaVo0Tmhmy1FZ1lKMWCnT7odXpItk,11128
|
||||
pip/_vendor/colorama/initialise.py,sha256=-hIny86ClXo39ixh5iSCfUIa2f_h_bgKRDW7gqs-KLU,3325
|
||||
pip/_vendor/colorama/tests/__init__.py,sha256=MkgPAEzGQd-Rq0w0PZXSX2LadRWhUECcisJY8lSrm4Q,75
|
||||
pip/_vendor/colorama/tests/__pycache__/__init__.cpython-311.pyc,,
|
||||
pip/_vendor/colorama/tests/__pycache__/ansi_test.cpython-311.pyc,,
|
||||
pip/_vendor/colorama/tests/__pycache__/ansitowin32_test.cpython-311.pyc,,
|
||||
pip/_vendor/colorama/tests/__pycache__/initialise_test.cpython-311.pyc,,
|
||||
pip/_vendor/colorama/tests/__pycache__/isatty_test.cpython-311.pyc,,
|
||||
pip/_vendor/colorama/tests/__pycache__/utils.cpython-311.pyc,,
|
||||
pip/_vendor/colorama/tests/__pycache__/winterm_test.cpython-311.pyc,,
|
||||
pip/_vendor/colorama/tests/ansi_test.py,sha256=FeViDrUINIZcr505PAxvU4AjXz1asEiALs9GXMhwRaE,2839
|
||||
pip/_vendor/colorama/tests/ansitowin32_test.py,sha256=RN7AIhMJ5EqDsYaCjVo-o4u8JzDD4ukJbmevWKS70rY,10678
|
||||
pip/_vendor/colorama/tests/initialise_test.py,sha256=BbPy-XfyHwJ6zKozuQOvNvQZzsx9vdb_0bYXn7hsBTc,6741
|
||||
pip/_vendor/colorama/tests/isatty_test.py,sha256=Pg26LRpv0yQDB5Ac-sxgVXG7hsA1NYvapFgApZfYzZg,1866
|
||||
pip/_vendor/colorama/tests/utils.py,sha256=1IIRylG39z5-dzq09R_ngufxyPZxgldNbrxKxUGwGKE,1079
|
||||
pip/_vendor/colorama/tests/winterm_test.py,sha256=qoWFPEjym5gm2RuMwpf3pOis3a5r_PJZFCzK254JL8A,3709
|
||||
pip/_vendor/colorama/win32.py,sha256=YQOKwMTwtGBbsY4dL5HYTvwTeP9wIQra5MvPNddpxZs,6181
|
||||
pip/_vendor/colorama/winterm.py,sha256=XCQFDHjPi6AHYNdZwy0tA02H-Jh48Jp-HvCjeLeLp3U,7134
|
||||
pip/_vendor/distlib/__init__.py,sha256=acgfseOC55dNrVAzaBKpUiH3Z6V7Q1CaxsiQ3K7pC-E,581
|
||||
pip/_vendor/distlib/__pycache__/__init__.cpython-311.pyc,,
|
||||
pip/_vendor/distlib/__pycache__/compat.cpython-311.pyc,,
|
||||
pip/_vendor/distlib/__pycache__/database.cpython-311.pyc,,
|
||||
pip/_vendor/distlib/__pycache__/index.cpython-311.pyc,,
|
||||
pip/_vendor/distlib/__pycache__/locators.cpython-311.pyc,,
|
||||
pip/_vendor/distlib/__pycache__/manifest.cpython-311.pyc,,
|
||||
pip/_vendor/distlib/__pycache__/markers.cpython-311.pyc,,
|
||||
pip/_vendor/distlib/__pycache__/metadata.cpython-311.pyc,,
|
||||
pip/_vendor/distlib/__pycache__/resources.cpython-311.pyc,,
|
||||
pip/_vendor/distlib/__pycache__/scripts.cpython-311.pyc,,
|
||||
pip/_vendor/distlib/__pycache__/util.cpython-311.pyc,,
|
||||
pip/_vendor/distlib/__pycache__/version.cpython-311.pyc,,
|
||||
pip/_vendor/distlib/__pycache__/wheel.cpython-311.pyc,,
|
||||
pip/_vendor/distlib/compat.py,sha256=tfoMrj6tujk7G4UC2owL6ArgDuCKabgBxuJRGZSmpko,41259
|
||||
pip/_vendor/distlib/database.py,sha256=o_mw0fAr93NDAHHHfqG54Y1Hi9Rkfrp2BX15XWZYK50,51697
|
||||
pip/_vendor/distlib/index.py,sha256=HFiDG7LMoaBs829WuotrfIwcErOOExUOR_AeBtw_TCU,20834
|
||||
pip/_vendor/distlib/locators.py,sha256=wNzG-zERzS_XGls-nBPVVyLRHa2skUlkn0-5n0trMWA,51991
|
||||
pip/_vendor/distlib/manifest.py,sha256=nQEhYmgoreaBZzyFzwYsXxJARu3fo4EkunU163U16iE,14811
|
||||
pip/_vendor/distlib/markers.py,sha256=TpHHHLgkzyT7YHbwj-2i6weRaq-Ivy2-MUnrDkjau-U,5058
|
||||
pip/_vendor/distlib/metadata.py,sha256=g_DIiu8nBXRzA-mWPRpatHGbmFZqaFoss7z9TG7QSUU,39801
|
||||
pip/_vendor/distlib/resources.py,sha256=LwbPksc0A1JMbi6XnuPdMBUn83X7BPuFNWqPGEKI698,10820
|
||||
pip/_vendor/distlib/scripts.py,sha256=BmkTKmiTk4m2cj-iueliatwz3ut_9SsABBW51vnQnZU,18102
|
||||
pip/_vendor/distlib/util.py,sha256=31dPXn3Rfat0xZLeVoFpuniyhe6vsbl9_QN-qd9Lhlk,66262
|
||||
pip/_vendor/distlib/version.py,sha256=WG__LyAa2GwmA6qSoEJtvJE8REA1LZpbSizy8WvhJLk,23513
|
||||
pip/_vendor/distlib/wheel.py,sha256=Rgqs658VsJ3R2845qwnZD8XQryV2CzWw2mghwLvxxsI,43898
|
||||
pip/_vendor/distro/__init__.py,sha256=2fHjF-SfgPvjyNZ1iHh_wjqWdR_Yo5ODHwZC0jLBPhc,981
|
||||
pip/_vendor/distro/__main__.py,sha256=bu9d3TifoKciZFcqRBuygV3GSuThnVD_m2IK4cz96Vs,64
|
||||
pip/_vendor/distro/__pycache__/__init__.cpython-311.pyc,,
|
||||
pip/_vendor/distro/__pycache__/__main__.cpython-311.pyc,,
|
||||
pip/_vendor/distro/__pycache__/distro.cpython-311.pyc,,
|
||||
pip/_vendor/distro/distro.py,sha256=UZO1LjIhtFCMdlbiz39gj3raV-Amf3SBwzGzfApiMHw,49330
|
||||
pip/_vendor/idna/__init__.py,sha256=KJQN1eQBr8iIK5SKrJ47lXvxG0BJ7Lm38W4zT0v_8lk,849
|
||||
pip/_vendor/idna/__pycache__/__init__.cpython-311.pyc,,
|
||||
pip/_vendor/idna/__pycache__/codec.cpython-311.pyc,,
|
||||
pip/_vendor/idna/__pycache__/compat.cpython-311.pyc,,
|
||||
pip/_vendor/idna/__pycache__/core.cpython-311.pyc,,
|
||||
pip/_vendor/idna/__pycache__/idnadata.cpython-311.pyc,,
|
||||
pip/_vendor/idna/__pycache__/intranges.cpython-311.pyc,,
|
||||
pip/_vendor/idna/__pycache__/package_data.cpython-311.pyc,,
|
||||
pip/_vendor/idna/__pycache__/uts46data.cpython-311.pyc,,
|
||||
pip/_vendor/idna/codec.py,sha256=6ly5odKfqrytKT9_7UrlGklHnf1DSK2r9C6cSM4sa28,3374
|
||||
pip/_vendor/idna/compat.py,sha256=0_sOEUMT4CVw9doD3vyRhX80X19PwqFoUBs7gWsFME4,321
|
||||
pip/_vendor/idna/core.py,sha256=1JxchwKzkxBSn7R_oCE12oBu3eVux0VzdxolmIad24M,12950
|
||||
pip/_vendor/idna/idnadata.py,sha256=xUjqKqiJV8Ho_XzBpAtv5JFoVPSupK-SUXvtjygUHqw,44375
|
||||
pip/_vendor/idna/intranges.py,sha256=YBr4fRYuWH7kTKS2tXlFjM24ZF1Pdvcir-aywniInqg,1881
|
||||
pip/_vendor/idna/package_data.py,sha256=C_jHJzmX8PI4xq0jpzmcTMxpb5lDsq4o5VyxQzlVrZE,21
|
||||
pip/_vendor/idna/uts46data.py,sha256=zvjZU24s58_uAS850Mcd0NnD0X7_gCMAMjzWNIeUJdc,206539
|
||||
pip/_vendor/msgpack/__init__.py,sha256=NryGaKLDk_Egd58ZxXpnuI7OWO27AXz7S6CBFRM3sAY,1132
|
||||
pip/_vendor/msgpack/__pycache__/__init__.cpython-311.pyc,,
|
||||
pip/_vendor/msgpack/__pycache__/exceptions.cpython-311.pyc,,
|
||||
pip/_vendor/msgpack/__pycache__/ext.cpython-311.pyc,,
|
||||
pip/_vendor/msgpack/__pycache__/fallback.cpython-311.pyc,,
|
||||
pip/_vendor/msgpack/exceptions.py,sha256=dCTWei8dpkrMsQDcjQk74ATl9HsIBH0ybt8zOPNqMYc,1081
|
||||
pip/_vendor/msgpack/ext.py,sha256=TuldJPkYu8Wo_Xh0tFGL2l06-gY88NSR8tOje9fo2Wg,6080
|
||||
pip/_vendor/msgpack/fallback.py,sha256=OORDn86-fHBPlu-rPlMdM10KzkH6S_Rx9CHN1b7o4cg,34557
|
||||
pip/_vendor/packaging/__about__.py,sha256=ugASIO2w1oUyH8_COqQ2X_s0rDhjbhQC3yJocD03h2c,661
|
||||
pip/_vendor/packaging/__init__.py,sha256=b9Kk5MF7KxhhLgcDmiUWukN-LatWFxPdNug0joPhHSk,497
|
||||
pip/_vendor/packaging/__pycache__/__about__.cpython-311.pyc,,
|
||||
pip/_vendor/packaging/__pycache__/__init__.cpython-311.pyc,,
|
||||
pip/_vendor/packaging/__pycache__/_manylinux.cpython-311.pyc,,
|
||||
pip/_vendor/packaging/__pycache__/_musllinux.cpython-311.pyc,,
|
||||
pip/_vendor/packaging/__pycache__/_structures.cpython-311.pyc,,
|
||||
pip/_vendor/packaging/__pycache__/markers.cpython-311.pyc,,
|
||||
pip/_vendor/packaging/__pycache__/requirements.cpython-311.pyc,,
|
||||
pip/_vendor/packaging/__pycache__/specifiers.cpython-311.pyc,,
|
||||
pip/_vendor/packaging/__pycache__/tags.cpython-311.pyc,,
|
||||
pip/_vendor/packaging/__pycache__/utils.cpython-311.pyc,,
|
||||
pip/_vendor/packaging/__pycache__/version.cpython-311.pyc,,
|
||||
pip/_vendor/packaging/_manylinux.py,sha256=XcbiXB-qcjv3bcohp6N98TMpOP4_j3m-iOA8ptK2GWY,11488
|
||||
pip/_vendor/packaging/_musllinux.py,sha256=_KGgY_qc7vhMGpoqss25n2hiLCNKRtvz9mCrS7gkqyc,4378
|
||||
pip/_vendor/packaging/_structures.py,sha256=q3eVNmbWJGG_S0Dit_S3Ao8qQqz_5PYTXFAKBZe5yr4,1431
|
||||
pip/_vendor/packaging/markers.py,sha256=AJBOcY8Oq0kYc570KuuPTkvuqjAlhufaE2c9sCUbm64,8487
|
||||
pip/_vendor/packaging/requirements.py,sha256=NtDlPBtojpn1IUC85iMjPNsUmufjpSlwnNA-Xb4m5NA,4676
|
||||
pip/_vendor/packaging/specifiers.py,sha256=LRQ0kFsHrl5qfcFNEEJrIFYsnIHQUJXY9fIsakTrrqE,30110
|
||||
pip/_vendor/packaging/tags.py,sha256=lmsnGNiJ8C4D_Pf9PbM0qgbZvD9kmB9lpZBQUZa3R_Y,15699
|
||||
pip/_vendor/packaging/utils.py,sha256=dJjeat3BS-TYn1RrUFVwufUMasbtzLfYRoy_HXENeFQ,4200
|
||||
pip/_vendor/packaging/version.py,sha256=_fLRNrFrxYcHVfyo8vk9j8s6JM8N_xsSxVFr6RJyco8,14665
|
||||
pip/_vendor/pkg_resources/__init__.py,sha256=NnpQ3g6BCHzpMgOR_OLBmYtniY4oOzdKpwqghfq_6ug,108287
|
||||
pip/_vendor/pkg_resources/__pycache__/__init__.cpython-311.pyc,,
|
||||
pip/_vendor/pkg_resources/__pycache__/py31compat.cpython-311.pyc,,
|
||||
pip/_vendor/pkg_resources/py31compat.py,sha256=CRk8fkiPRDLsbi5pZcKsHI__Pbmh_94L8mr9Qy9Ab2U,562
|
||||
pip/_vendor/platformdirs/__init__.py,sha256=9iY4Z8iJDZB0djln6zHHwrPVWpB54TCygcnh--MujU0,12936
|
||||
pip/_vendor/platformdirs/__main__.py,sha256=ZmsnTxEOxtTvwa-Y_Vfab_JN3X4XCVeN8X0yyy9-qnc,1176
|
||||
pip/_vendor/platformdirs/__pycache__/__init__.cpython-311.pyc,,
|
||||
pip/_vendor/platformdirs/__pycache__/__main__.cpython-311.pyc,,
|
||||
pip/_vendor/platformdirs/__pycache__/android.cpython-311.pyc,,
|
||||
pip/_vendor/platformdirs/__pycache__/api.cpython-311.pyc,,
|
||||
pip/_vendor/platformdirs/__pycache__/macos.cpython-311.pyc,,
|
||||
pip/_vendor/platformdirs/__pycache__/unix.cpython-311.pyc,,
|
||||
pip/_vendor/platformdirs/__pycache__/version.cpython-311.pyc,,
|
||||
pip/_vendor/platformdirs/__pycache__/windows.cpython-311.pyc,,
|
||||
pip/_vendor/platformdirs/android.py,sha256=GKizhyS7ESRiU67u8UnBJLm46goau9937EchXWbPBlk,4068
|
||||
pip/_vendor/platformdirs/api.py,sha256=MXKHXOL3eh_-trSok-JUTjAR_zjmmKF3rjREVABjP8s,4910
|
||||
pip/_vendor/platformdirs/macos.py,sha256=-3UXQewbT0yMhMdkzRXfXGAntmLIH7Qt4a9Hlf8I5_Y,2655
|
||||
pip/_vendor/platformdirs/unix.py,sha256=P-WQjSSieE38DXjMDa1t4XHnKJQ5idEaKT0PyXwm8KQ,6911
|
||||
pip/_vendor/platformdirs/version.py,sha256=qaN-fw_htIgKUVXoAuAEVgKxQu3tZ9qE2eiKkWIS7LA,160
|
||||
pip/_vendor/platformdirs/windows.py,sha256=LOrXLgI0CjQldDo2zhOZYGYZ6g4e_cJOCB_pF9aMRWQ,6596
|
||||
pip/_vendor/pygments/__init__.py,sha256=5oLcMLXD0cTG8YcHBPITtK1fS0JBASILEvEnWkTezgE,2999
|
||||
pip/_vendor/pygments/__main__.py,sha256=p0_rz3JZmNZMNZBOqDojaEx1cr9wmA9FQZX_TYl74lQ,353
|
||||
pip/_vendor/pygments/__pycache__/__init__.cpython-311.pyc,,
|
||||
pip/_vendor/pygments/__pycache__/__main__.cpython-311.pyc,,
|
||||
pip/_vendor/pygments/__pycache__/cmdline.cpython-311.pyc,,
|
||||
pip/_vendor/pygments/__pycache__/console.cpython-311.pyc,,
|
||||
pip/_vendor/pygments/__pycache__/filter.cpython-311.pyc,,
|
||||
pip/_vendor/pygments/__pycache__/formatter.cpython-311.pyc,,
|
||||
pip/_vendor/pygments/__pycache__/lexer.cpython-311.pyc,,
|
||||
pip/_vendor/pygments/__pycache__/modeline.cpython-311.pyc,,
|
||||
pip/_vendor/pygments/__pycache__/plugin.cpython-311.pyc,,
|
||||
pip/_vendor/pygments/__pycache__/regexopt.cpython-311.pyc,,
|
||||
pip/_vendor/pygments/__pycache__/scanner.cpython-311.pyc,,
|
||||
pip/_vendor/pygments/__pycache__/sphinxext.cpython-311.pyc,,
|
||||
pip/_vendor/pygments/__pycache__/style.cpython-311.pyc,,
|
||||
pip/_vendor/pygments/__pycache__/token.cpython-311.pyc,,
|
||||
pip/_vendor/pygments/__pycache__/unistring.cpython-311.pyc,,
|
||||
pip/_vendor/pygments/__pycache__/util.cpython-311.pyc,,
|
||||
pip/_vendor/pygments/cmdline.py,sha256=rc0fah4eknRqFgn1wKNEwkq0yWnSqYOGaA4PaIeOxVY,23685
|
||||
pip/_vendor/pygments/console.py,sha256=hQfqCFuOlGk7DW2lPQYepsw-wkOH1iNt9ylNA1eRymM,1697
|
||||
pip/_vendor/pygments/filter.py,sha256=NglMmMPTRRv-zuRSE_QbWid7JXd2J4AvwjCW2yWALXU,1938
|
||||
pip/_vendor/pygments/filters/__init__.py,sha256=b5YuXB9rampSy2-cMtKxGQoMDfrG4_DcvVwZrzTlB6w,40386
|
||||
pip/_vendor/pygments/filters/__pycache__/__init__.cpython-311.pyc,,
|
||||
pip/_vendor/pygments/formatter.py,sha256=6-TS2Y8pUMeWIUolWwr1O8ruC-U6HydWDwOdbAiJgJQ,2917
|
||||
pip/_vendor/pygments/formatters/__init__.py,sha256=YTqGeHS17fNXCLMZpf7oCxBCKLB9YLsZ8IAsjGhawyg,4810
|
||||
pip/_vendor/pygments/formatters/__pycache__/__init__.cpython-311.pyc,,
|
||||
pip/_vendor/pygments/formatters/__pycache__/_mapping.cpython-311.pyc,,
|
||||
pip/_vendor/pygments/formatters/__pycache__/bbcode.cpython-311.pyc,,
|
||||
pip/_vendor/pygments/formatters/__pycache__/groff.cpython-311.pyc,,
|
||||
pip/_vendor/pygments/formatters/__pycache__/html.cpython-311.pyc,,
|
||||
pip/_vendor/pygments/formatters/__pycache__/img.cpython-311.pyc,,
|
||||
pip/_vendor/pygments/formatters/__pycache__/irc.cpython-311.pyc,,
|
||||
pip/_vendor/pygments/formatters/__pycache__/latex.cpython-311.pyc,,
|
||||
pip/_vendor/pygments/formatters/__pycache__/other.cpython-311.pyc,,
|
||||
pip/_vendor/pygments/formatters/__pycache__/pangomarkup.cpython-311.pyc,,
|
||||
pip/_vendor/pygments/formatters/__pycache__/rtf.cpython-311.pyc,,
|
||||
pip/_vendor/pygments/formatters/__pycache__/svg.cpython-311.pyc,,
|
||||
pip/_vendor/pygments/formatters/__pycache__/terminal.cpython-311.pyc,,
|
||||
pip/_vendor/pygments/formatters/__pycache__/terminal256.cpython-311.pyc,,
|
||||
pip/_vendor/pygments/formatters/_mapping.py,sha256=fCZgvsM6UEuZUG7J6lr47eVss5owKd_JyaNbDfxeqmQ,4104
|
||||
pip/_vendor/pygments/formatters/bbcode.py,sha256=JrL4ITjN-KzPcuQpPMBf1pm33eW2sDUNr8WzSoAJsJA,3314
|
||||
pip/_vendor/pygments/formatters/groff.py,sha256=xrOFoLbafSA9uHsSLRogy79_Zc4GWJ8tMK2hCdTJRsw,5086
|
||||
pip/_vendor/pygments/formatters/html.py,sha256=QNt9prPgxmbKx2M-nfDwoR1bIg06-sNouQuWnE434Wc,35441
|
||||
pip/_vendor/pygments/formatters/img.py,sha256=h75Y7IRZLZxDEIwyoOsdRLTwm7kLVPbODKkgEiJ0iKI,21938
|
||||
pip/_vendor/pygments/formatters/irc.py,sha256=iwk5tDJOxbCV64SCmOFyvk__x6RD60ay0nUn7ko9n7U,5871
|
||||
pip/_vendor/pygments/formatters/latex.py,sha256=thPbytJCIs2AUXsO3NZwqKtXJ-upOlcXP4CXsx94G4w,19351
|
||||
pip/_vendor/pygments/formatters/other.py,sha256=PczqK1Rms43lz6iucOLPeBMxIncPKOGBt-195w1ynII,5073
|
||||
pip/_vendor/pygments/formatters/pangomarkup.py,sha256=ZZzMsKJKXrsDniFeMTkIpe7aQ4VZYRHu0idWmSiUJ2U,2212
|
||||
pip/_vendor/pygments/formatters/rtf.py,sha256=abrKlWjipBkQvhIICxtjYTUNv6WME0iJJObFvqVuudE,5014
|
||||
pip/_vendor/pygments/formatters/svg.py,sha256=6MM9YyO8NhU42RTQfTWBiagWMnsf9iG5gwhqSriHORE,7335
|
||||
pip/_vendor/pygments/formatters/terminal.py,sha256=NpEGvwkC6LgMLQTjVzGrJXji3XcET1sb5JCunSCzoRo,4674
|
||||
pip/_vendor/pygments/formatters/terminal256.py,sha256=4v4OVizvsxtwWBpIy_Po30zeOzE5oJg_mOc1-rCjMDk,11753
|
||||
pip/_vendor/pygments/lexer.py,sha256=ZPB_TGn_qzrXodRFwEdPzzJk6LZBo9BlfSy3lacc6zg,32005
|
||||
pip/_vendor/pygments/lexers/__init__.py,sha256=8d80-XfL5UKDCC1wRD1a_ZBZDkZ2HOe7Zul8SsnNYFE,11174
|
||||
pip/_vendor/pygments/lexers/__pycache__/__init__.cpython-311.pyc,,
|
||||
pip/_vendor/pygments/lexers/__pycache__/_mapping.cpython-311.pyc,,
|
||||
pip/_vendor/pygments/lexers/__pycache__/python.cpython-311.pyc,,
|
||||
pip/_vendor/pygments/lexers/_mapping.py,sha256=zEiCV5FPiBioMJQJjw9kk7IJ5Y9GwknS4VJPYlcNchs,70232
|
||||
pip/_vendor/pygments/lexers/python.py,sha256=gZROs9iNSOA18YyVghP1cUCD0OwYZ04a6PCwgSOCeSA,53376
|
||||
pip/_vendor/pygments/modeline.py,sha256=gIbMSYrjSWPk0oATz7W9vMBYkUyTK2OcdVyKjioDRvA,986
|
||||
pip/_vendor/pygments/plugin.py,sha256=5rPxEoB_89qQMpOs0nI4KyLOzAHNlbQiwEMOKxqNmv8,2591
|
||||
pip/_vendor/pygments/regexopt.py,sha256=c6xcXGpGgvCET_3VWawJJqAnOp0QttFpQEdOPNY2Py0,3072
|
||||
pip/_vendor/pygments/scanner.py,sha256=F2T2G6cpkj-yZtzGQr-sOBw5w5-96UrJWveZN6va2aM,3092
|
||||
pip/_vendor/pygments/sphinxext.py,sha256=F8L0211sPnXaiWutN0lkSUajWBwlgDMIEFFAbMWOvZY,4630
|
||||
pip/_vendor/pygments/style.py,sha256=RRnussX1YiK9Z7HipIvKorImxu3-HnkdpPCO4u925T0,6257
|
||||
pip/_vendor/pygments/styles/__init__.py,sha256=iZDZ7PBKb55SpGlE1--cx9cbmWx5lVTH4bXO87t2Vok,3419
|
||||
pip/_vendor/pygments/styles/__pycache__/__init__.cpython-311.pyc,,
|
||||
pip/_vendor/pygments/token.py,sha256=vA2yNHGJBHfq4jNQSah7C9DmIOp34MmYHPA8P-cYAHI,6184
|
||||
pip/_vendor/pygments/unistring.py,sha256=gP3gK-6C4oAFjjo9HvoahsqzuV4Qz0jl0E0OxfDerHI,63187
|
||||
pip/_vendor/pygments/util.py,sha256=KgwpWWC3By5AiNwxGTI7oI9aXupH2TyZWukafBJe0Mg,9110
|
||||
pip/_vendor/pyparsing/__init__.py,sha256=ZPdI7pPo4IYXcABw-51AcqOzsxVvDtqnQbyn_qYWZvo,9171
|
||||
pip/_vendor/pyparsing/__pycache__/__init__.cpython-311.pyc,,
|
||||
pip/_vendor/pyparsing/__pycache__/actions.cpython-311.pyc,,
|
||||
pip/_vendor/pyparsing/__pycache__/common.cpython-311.pyc,,
|
||||
pip/_vendor/pyparsing/__pycache__/core.cpython-311.pyc,,
|
||||
pip/_vendor/pyparsing/__pycache__/exceptions.cpython-311.pyc,,
|
||||
pip/_vendor/pyparsing/__pycache__/helpers.cpython-311.pyc,,
|
||||
pip/_vendor/pyparsing/__pycache__/results.cpython-311.pyc,,
|
||||
pip/_vendor/pyparsing/__pycache__/testing.cpython-311.pyc,,
|
||||
pip/_vendor/pyparsing/__pycache__/unicode.cpython-311.pyc,,
|
||||
pip/_vendor/pyparsing/__pycache__/util.cpython-311.pyc,,
|
||||
pip/_vendor/pyparsing/actions.py,sha256=wU9i32e0y1ymxKE3OUwSHO-SFIrt1h_wv6Ws0GQjpNU,6426
|
||||
pip/_vendor/pyparsing/common.py,sha256=lFL97ooIeR75CmW5hjURZqwDCTgruqltcTCZ-ulLO2Q,12936
|
||||
pip/_vendor/pyparsing/core.py,sha256=AzTm1KFT1FIhiw2zvXZJmrpQoAwB0wOmeDCiR6SYytw,213344
|
||||
pip/_vendor/pyparsing/diagram/__init__.py,sha256=KW0PV_TvWKnL7jysz0pQbZ24nzWWu2ZfNaeyUIIywIg,23685
|
||||
pip/_vendor/pyparsing/diagram/__pycache__/__init__.cpython-311.pyc,,
|
||||
pip/_vendor/pyparsing/exceptions.py,sha256=3LbSafD32NYb1Tzt85GHNkhEAU1eZkTtNSk24cPMemo,9023
|
||||
pip/_vendor/pyparsing/helpers.py,sha256=QpUOjW0-psvueMwWb9bQpU2noqKCv98_wnw1VSzSdVo,39129
|
||||
pip/_vendor/pyparsing/results.py,sha256=HgNvWVXBdQP-Q6PtJfoCEeOJk2nwEvG-2KVKC5sGA30,25341
|
||||
pip/_vendor/pyparsing/testing.py,sha256=7tu4Abp4uSeJV0N_yEPRmmNUhpd18ZQP3CrX41DM814,13402
|
||||
pip/_vendor/pyparsing/unicode.py,sha256=fwuhMj30SQ165Cv7HJpu-rSxGbRm93kN9L4Ei7VGc1Y,10787
|
||||
pip/_vendor/pyparsing/util.py,sha256=kq772O5YSeXOSdP-M31EWpbH_ayj7BMHImBYo9xPD5M,6805
|
||||
pip/_vendor/pyproject_hooks/__init__.py,sha256=kCehmy0UaBa9oVMD7ZIZrnswfnP3LXZ5lvnNJAL5JBM,491
|
||||
pip/_vendor/pyproject_hooks/__pycache__/__init__.cpython-311.pyc,,
|
||||
pip/_vendor/pyproject_hooks/__pycache__/_compat.cpython-311.pyc,,
|
||||
pip/_vendor/pyproject_hooks/__pycache__/_impl.cpython-311.pyc,,
|
||||
pip/_vendor/pyproject_hooks/_compat.py,sha256=by6evrYnqkisiM-MQcvOKs5bgDMzlOSgZqRHNqf04zE,138
|
||||
pip/_vendor/pyproject_hooks/_impl.py,sha256=61GJxzQip0IInhuO69ZI5GbNQ82XEDUB_1Gg5_KtUoc,11920
|
||||
pip/_vendor/pyproject_hooks/_in_process/__init__.py,sha256=9gQATptbFkelkIy0OfWFEACzqxXJMQDWCH9rBOAZVwQ,546
|
||||
pip/_vendor/pyproject_hooks/_in_process/__pycache__/__init__.cpython-311.pyc,,
|
||||
pip/_vendor/pyproject_hooks/_in_process/__pycache__/_in_process.cpython-311.pyc,,
|
||||
pip/_vendor/pyproject_hooks/_in_process/_in_process.py,sha256=m2b34c917IW5o-Q_6TYIHlsK9lSUlNiyrITTUH_zwew,10927
|
||||
pip/_vendor/requests/__init__.py,sha256=64HgJ8cke-XyNrj1ErwNq0F9SqyAThUTh5lV6m7-YkI,5178
|
||||
pip/_vendor/requests/__pycache__/__init__.cpython-311.pyc,,
|
||||
pip/_vendor/requests/__pycache__/__version__.cpython-311.pyc,,
|
||||
pip/_vendor/requests/__pycache__/_internal_utils.cpython-311.pyc,,
|
||||
pip/_vendor/requests/__pycache__/adapters.cpython-311.pyc,,
|
||||
pip/_vendor/requests/__pycache__/api.cpython-311.pyc,,
|
||||
pip/_vendor/requests/__pycache__/auth.cpython-311.pyc,,
|
||||
pip/_vendor/requests/__pycache__/certs.cpython-311.pyc,,
|
||||
pip/_vendor/requests/__pycache__/compat.cpython-311.pyc,,
|
||||
pip/_vendor/requests/__pycache__/cookies.cpython-311.pyc,,
|
||||
pip/_vendor/requests/__pycache__/exceptions.cpython-311.pyc,,
|
||||
pip/_vendor/requests/__pycache__/help.cpython-311.pyc,,
|
||||
pip/_vendor/requests/__pycache__/hooks.cpython-311.pyc,,
|
||||
pip/_vendor/requests/__pycache__/models.cpython-311.pyc,,
|
||||
pip/_vendor/requests/__pycache__/packages.cpython-311.pyc,,
|
||||
pip/_vendor/requests/__pycache__/sessions.cpython-311.pyc,,
|
||||
pip/_vendor/requests/__pycache__/status_codes.cpython-311.pyc,,
|
||||
pip/_vendor/requests/__pycache__/structures.cpython-311.pyc,,
|
||||
pip/_vendor/requests/__pycache__/utils.cpython-311.pyc,,
|
||||
pip/_vendor/requests/__version__.py,sha256=h48zn-oFukaXrYHocdadp_hIszWyd_PGrS8Eiii6aoc,435
|
||||
pip/_vendor/requests/_internal_utils.py,sha256=aSPlF4uDhtfKxEayZJJ7KkAxtormeTfpwKSBSwtmAUw,1397
|
||||
pip/_vendor/requests/adapters.py,sha256=GFEz5koZaMZD86v0SHXKVB5SE9MgslEjkCQzldkNwVM,21443
|
||||
pip/_vendor/requests/api.py,sha256=dyvkDd5itC9z2g0wHl_YfD1yf6YwpGWLO7__8e21nks,6377
|
||||
pip/_vendor/requests/auth.py,sha256=h-HLlVx9j8rKV5hfSAycP2ApOSglTz77R0tz7qCbbEE,10187
|
||||
pip/_vendor/requests/certs.py,sha256=PVPooB0jP5hkZEULSCwC074532UFbR2Ptgu0I5zwmCs,575
|
||||
pip/_vendor/requests/compat.py,sha256=IhK9quyX0RRuWTNcg6d2JGSAOUbM6mym2p_2XjLTwf4,1286
|
||||
pip/_vendor/requests/cookies.py,sha256=kD3kNEcCj-mxbtf5fJsSaT86eGoEYpD3X0CSgpzl7BM,18560
|
||||
pip/_vendor/requests/exceptions.py,sha256=FA-_kVwBZ2jhXauRctN_ewHVK25b-fj0Azyz1THQ0Kk,3823
|
||||
pip/_vendor/requests/help.py,sha256=FnAAklv8MGm_qb2UilDQgS6l0cUttiCFKUjx0zn2XNA,3879
|
||||
pip/_vendor/requests/hooks.py,sha256=CiuysiHA39V5UfcCBXFIx83IrDpuwfN9RcTUgv28ftQ,733
|
||||
pip/_vendor/requests/models.py,sha256=dDZ-iThotky-Noq9yy97cUEJhr3wnY6mv-xR_ePg_lk,35288
|
||||
pip/_vendor/requests/packages.py,sha256=njJmVifY4aSctuW3PP5EFRCxjEwMRDO6J_feG2dKWsI,695
|
||||
pip/_vendor/requests/sessions.py,sha256=KUqJcRRLovNefUs7ScOXSUVCcfSayTFWtbiJ7gOSlTI,30180
|
||||
pip/_vendor/requests/status_codes.py,sha256=FvHmT5uH-_uimtRz5hH9VCbt7VV-Nei2J9upbej6j8g,4235
|
||||
pip/_vendor/requests/structures.py,sha256=-IbmhVz06S-5aPSZuUthZ6-6D9XOjRuTXHOabY041XM,2912
|
||||
pip/_vendor/requests/utils.py,sha256=0gzSOcx9Ya4liAbHnHuwt4jM78lzCZZoDFgkmsInNUg,33240
|
||||
pip/_vendor/resolvelib/__init__.py,sha256=UL-B2BDI0_TRIqkfGwLHKLxY-LjBlomz7941wDqzB1I,537
|
||||
pip/_vendor/resolvelib/__pycache__/__init__.cpython-311.pyc,,
|
||||
pip/_vendor/resolvelib/__pycache__/providers.cpython-311.pyc,,
|
||||
pip/_vendor/resolvelib/__pycache__/reporters.cpython-311.pyc,,
|
||||
pip/_vendor/resolvelib/__pycache__/resolvers.cpython-311.pyc,,
|
||||
pip/_vendor/resolvelib/__pycache__/structs.cpython-311.pyc,,
|
||||
pip/_vendor/resolvelib/compat/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
||||
pip/_vendor/resolvelib/compat/__pycache__/__init__.cpython-311.pyc,,
|
||||
pip/_vendor/resolvelib/compat/__pycache__/collections_abc.cpython-311.pyc,,
|
||||
pip/_vendor/resolvelib/compat/collections_abc.py,sha256=uy8xUZ-NDEw916tugUXm8HgwCGiMO0f-RcdnpkfXfOs,156
|
||||
pip/_vendor/resolvelib/providers.py,sha256=roVmFBItQJ0TkhNua65h8LdNny7rmeqVEXZu90QiP4o,5872
|
||||
pip/_vendor/resolvelib/reporters.py,sha256=fW91NKf-lK8XN7i6Yd_rczL5QeOT3sc6AKhpaTEnP3E,1583
|
||||
pip/_vendor/resolvelib/resolvers.py,sha256=2wYzVGBGerbmcIpH8cFmgSKgLSETz8jmwBMGjCBMHG4,17592
|
||||
pip/_vendor/resolvelib/structs.py,sha256=IVIYof6sA_N4ZEiE1C1UhzTX495brCNnyCdgq6CYq28,4794
|
||||
pip/_vendor/rich/__init__.py,sha256=dRxjIL-SbFVY0q3IjSMrfgBTHrm1LZDgLOygVBwiYZc,6090
|
||||
pip/_vendor/rich/__main__.py,sha256=TT8sb9PTnsnKhhrGuHkLN0jdN0dtKhtPkEr9CidDbPM,8478
|
||||
pip/_vendor/rich/__pycache__/__init__.cpython-311.pyc,,
|
||||
pip/_vendor/rich/__pycache__/__main__.cpython-311.pyc,,
|
||||
pip/_vendor/rich/__pycache__/_cell_widths.cpython-311.pyc,,
|
||||
pip/_vendor/rich/__pycache__/_emoji_codes.cpython-311.pyc,,
|
||||
pip/_vendor/rich/__pycache__/_emoji_replace.cpython-311.pyc,,
|
||||
pip/_vendor/rich/__pycache__/_export_format.cpython-311.pyc,,
|
||||
pip/_vendor/rich/__pycache__/_extension.cpython-311.pyc,,
|
||||
pip/_vendor/rich/__pycache__/_inspect.cpython-311.pyc,,
|
||||
pip/_vendor/rich/__pycache__/_log_render.cpython-311.pyc,,
|
||||
pip/_vendor/rich/__pycache__/_loop.cpython-311.pyc,,
|
||||
pip/_vendor/rich/__pycache__/_null_file.cpython-311.pyc,,
|
||||
pip/_vendor/rich/__pycache__/_palettes.cpython-311.pyc,,
|
||||
pip/_vendor/rich/__pycache__/_pick.cpython-311.pyc,,
|
||||
pip/_vendor/rich/__pycache__/_ratio.cpython-311.pyc,,
|
||||
pip/_vendor/rich/__pycache__/_spinners.cpython-311.pyc,,
|
||||
pip/_vendor/rich/__pycache__/_stack.cpython-311.pyc,,
|
||||
pip/_vendor/rich/__pycache__/_timer.cpython-311.pyc,,
|
||||
pip/_vendor/rich/__pycache__/_win32_console.cpython-311.pyc,,
|
||||
pip/_vendor/rich/__pycache__/_windows.cpython-311.pyc,,
|
||||
pip/_vendor/rich/__pycache__/_windows_renderer.cpython-311.pyc,,
|
||||
pip/_vendor/rich/__pycache__/_wrap.cpython-311.pyc,,
|
||||
pip/_vendor/rich/__pycache__/abc.cpython-311.pyc,,
|
||||
pip/_vendor/rich/__pycache__/align.cpython-311.pyc,,
|
||||
pip/_vendor/rich/__pycache__/ansi.cpython-311.pyc,,
|
||||
pip/_vendor/rich/__pycache__/bar.cpython-311.pyc,,
|
||||
pip/_vendor/rich/__pycache__/box.cpython-311.pyc,,
|
||||
pip/_vendor/rich/__pycache__/cells.cpython-311.pyc,,
|
||||
pip/_vendor/rich/__pycache__/color.cpython-311.pyc,,
|
||||
pip/_vendor/rich/__pycache__/color_triplet.cpython-311.pyc,,
|
||||
pip/_vendor/rich/__pycache__/columns.cpython-311.pyc,,
|
||||
pip/_vendor/rich/__pycache__/console.cpython-311.pyc,,
|
||||
pip/_vendor/rich/__pycache__/constrain.cpython-311.pyc,,
|
||||
pip/_vendor/rich/__pycache__/containers.cpython-311.pyc,,
|
||||
pip/_vendor/rich/__pycache__/control.cpython-311.pyc,,
|
||||
pip/_vendor/rich/__pycache__/default_styles.cpython-311.pyc,,
|
||||
pip/_vendor/rich/__pycache__/diagnose.cpython-311.pyc,,
|
||||
pip/_vendor/rich/__pycache__/emoji.cpython-311.pyc,,
|
||||
pip/_vendor/rich/__pycache__/errors.cpython-311.pyc,,
|
||||
pip/_vendor/rich/__pycache__/file_proxy.cpython-311.pyc,,
|
||||
pip/_vendor/rich/__pycache__/filesize.cpython-311.pyc,,
|
||||
pip/_vendor/rich/__pycache__/highlighter.cpython-311.pyc,,
|
||||
pip/_vendor/rich/__pycache__/json.cpython-311.pyc,,
|
||||
pip/_vendor/rich/__pycache__/jupyter.cpython-311.pyc,,
|
||||
pip/_vendor/rich/__pycache__/layout.cpython-311.pyc,,
|
||||
pip/_vendor/rich/__pycache__/live.cpython-311.pyc,,
|
||||
pip/_vendor/rich/__pycache__/live_render.cpython-311.pyc,,
|
||||
pip/_vendor/rich/__pycache__/logging.cpython-311.pyc,,
|
||||
pip/_vendor/rich/__pycache__/markup.cpython-311.pyc,,
|
||||
pip/_vendor/rich/__pycache__/measure.cpython-311.pyc,,
|
||||
pip/_vendor/rich/__pycache__/padding.cpython-311.pyc,,
|
||||
pip/_vendor/rich/__pycache__/pager.cpython-311.pyc,,
|
||||
pip/_vendor/rich/__pycache__/palette.cpython-311.pyc,,
|
||||
pip/_vendor/rich/__pycache__/panel.cpython-311.pyc,,
|
||||
pip/_vendor/rich/__pycache__/pretty.cpython-311.pyc,,
|
||||
pip/_vendor/rich/__pycache__/progress.cpython-311.pyc,,
|
||||
pip/_vendor/rich/__pycache__/progress_bar.cpython-311.pyc,,
|
||||
pip/_vendor/rich/__pycache__/prompt.cpython-311.pyc,,
|
||||
pip/_vendor/rich/__pycache__/protocol.cpython-311.pyc,,
|
||||
pip/_vendor/rich/__pycache__/region.cpython-311.pyc,,
|
||||
pip/_vendor/rich/__pycache__/repr.cpython-311.pyc,,
|
||||
pip/_vendor/rich/__pycache__/rule.cpython-311.pyc,,
|
||||
pip/_vendor/rich/__pycache__/scope.cpython-311.pyc,,
|
||||
pip/_vendor/rich/__pycache__/screen.cpython-311.pyc,,
|
||||
pip/_vendor/rich/__pycache__/segment.cpython-311.pyc,,
|
||||
pip/_vendor/rich/__pycache__/spinner.cpython-311.pyc,,
|
||||
pip/_vendor/rich/__pycache__/status.cpython-311.pyc,,
|
||||
pip/_vendor/rich/__pycache__/style.cpython-311.pyc,,
|
||||
pip/_vendor/rich/__pycache__/styled.cpython-311.pyc,,
|
||||
pip/_vendor/rich/__pycache__/syntax.cpython-311.pyc,,
|
||||
pip/_vendor/rich/__pycache__/table.cpython-311.pyc,,
|
||||
pip/_vendor/rich/__pycache__/terminal_theme.cpython-311.pyc,,
|
||||
pip/_vendor/rich/__pycache__/text.cpython-311.pyc,,
|
||||
pip/_vendor/rich/__pycache__/theme.cpython-311.pyc,,
|
||||
pip/_vendor/rich/__pycache__/themes.cpython-311.pyc,,
|
||||
pip/_vendor/rich/__pycache__/traceback.cpython-311.pyc,,
|
||||
pip/_vendor/rich/__pycache__/tree.cpython-311.pyc,,
|
||||
pip/_vendor/rich/_cell_widths.py,sha256=2n4EiJi3X9sqIq0O16kUZ_zy6UYMd3xFfChlKfnW1Hc,10096
|
||||
pip/_vendor/rich/_emoji_codes.py,sha256=hu1VL9nbVdppJrVoijVshRlcRRe_v3dju3Mmd2sKZdY,140235
|
||||
pip/_vendor/rich/_emoji_replace.py,sha256=n-kcetsEUx2ZUmhQrfeMNc-teeGhpuSQ5F8VPBsyvDo,1064
|
||||
pip/_vendor/rich/_export_format.py,sha256=nHArqOljIlYn6NruhWsAsh-fHo7oJC3y9BDJyAa-QYQ,2114
|
||||
pip/_vendor/rich/_extension.py,sha256=Xt47QacCKwYruzjDi-gOBq724JReDj9Cm9xUi5fr-34,265
|
||||
pip/_vendor/rich/_inspect.py,sha256=oZJGw31e64dwXSCmrDnvZbwVb1ZKhWfU8wI3VWohjJk,9695
|
||||
pip/_vendor/rich/_log_render.py,sha256=1ByI0PA1ZpxZY3CGJOK54hjlq4X-Bz_boIjIqCd8Kns,3225
|
||||
pip/_vendor/rich/_loop.py,sha256=hV_6CLdoPm0va22Wpw4zKqM0RYsz3TZxXj0PoS-9eDQ,1236
|
||||
pip/_vendor/rich/_null_file.py,sha256=cTaTCU_xuDXGGa9iqK-kZ0uddZCSvM-RgM2aGMuMiHs,1643
|
||||
pip/_vendor/rich/_palettes.py,sha256=cdev1JQKZ0JvlguV9ipHgznTdnvlIzUFDBb0It2PzjI,7063
|
||||
pip/_vendor/rich/_pick.py,sha256=evDt8QN4lF5CiwrUIXlOJCntitBCOsI3ZLPEIAVRLJU,423
|
||||
pip/_vendor/rich/_ratio.py,sha256=2lLSliL025Y-YMfdfGbutkQDevhcyDqc-DtUYW9mU70,5472
|
||||
pip/_vendor/rich/_spinners.py,sha256=U2r1_g_1zSjsjiUdAESc2iAMc3i4ri_S8PYP6kQ5z1I,19919
|
||||
pip/_vendor/rich/_stack.py,sha256=-C8OK7rxn3sIUdVwxZBBpeHhIzX0eI-VM3MemYfaXm0,351
|
||||
pip/_vendor/rich/_timer.py,sha256=zelxbT6oPFZnNrwWPpc1ktUeAT-Vc4fuFcRZLQGLtMI,417
|
||||
pip/_vendor/rich/_win32_console.py,sha256=P0vxI2fcndym1UU1S37XAzQzQnkyY7YqAKmxm24_gug,22820
|
||||
pip/_vendor/rich/_windows.py,sha256=dvNl9TmfPzNVxiKk5WDFihErZ5796g2UC9-KGGyfXmk,1926
|
||||
pip/_vendor/rich/_windows_renderer.py,sha256=t74ZL3xuDCP3nmTp9pH1L5LiI2cakJuQRQleHCJerlk,2783
|
||||
pip/_vendor/rich/_wrap.py,sha256=xfV_9t0Sg6rzimmrDru8fCVmUlalYAcHLDfrJZnbbwQ,1840
|
||||
pip/_vendor/rich/abc.py,sha256=ON-E-ZqSSheZ88VrKX2M3PXpFbGEUUZPMa_Af0l-4f0,890
|
||||
pip/_vendor/rich/align.py,sha256=FV6_GS-8uhIyViMng3hkIWSFaTgMohK1Oqyjl8I8mGE,10368
|
||||
pip/_vendor/rich/ansi.py,sha256=THex7-qjc82-ZRtmDPAYlVEObYOEE_ARB1692Fk-JHs,6819
|
||||
pip/_vendor/rich/bar.py,sha256=a7UD303BccRCrEhGjfMElpv5RFYIinaAhAuqYqhUvmw,3264
|
||||
pip/_vendor/rich/box.py,sha256=FJ6nI3jD7h2XNFU138bJUt2HYmWOlRbltoCEuIAZhew,9842
|
||||
pip/_vendor/rich/cells.py,sha256=zMjFI15wCpgjLR14lHdfFMVC6qMDi5OsKIB0PYZBBMk,4503
|
||||
pip/_vendor/rich/color.py,sha256=GTITgffj47On3YK1v_I5T2CPZJGSnyWipPID_YkYXqw,18015
|
||||
pip/_vendor/rich/color_triplet.py,sha256=3lhQkdJbvWPoLDO-AnYImAWmJvV5dlgYNCVZ97ORaN4,1054
|
||||
pip/_vendor/rich/columns.py,sha256=HUX0KcMm9dsKNi11fTbiM_h2iDtl8ySCaVcxlalEzq8,7131
|
||||
pip/_vendor/rich/console.py,sha256=w3tJfrILZpS359wrNqaldGmyk3PEhEmV8Pg2g2GjXWI,97992
|
||||
pip/_vendor/rich/constrain.py,sha256=1VIPuC8AgtKWrcncQrjBdYqA3JVWysu6jZo1rrh7c7Q,1288
|
||||
pip/_vendor/rich/containers.py,sha256=aKgm5UDHn5Nmui6IJaKdsZhbHClh_X7D-_Wg8Ehrr7s,5497
|
||||
pip/_vendor/rich/control.py,sha256=DSkHTUQLorfSERAKE_oTAEUFefZnZp4bQb4q8rHbKws,6630
|
||||
pip/_vendor/rich/default_styles.py,sha256=WqVh-RPNEsx0Wxf3fhS_fCn-wVqgJ6Qfo-Zg7CoCsLE,7954
|
||||
pip/_vendor/rich/diagnose.py,sha256=an6uouwhKPAlvQhYpNNpGq9EJysfMIOvvCbO3oSoR24,972
|
||||
pip/_vendor/rich/emoji.py,sha256=omTF9asaAnsM4yLY94eR_9dgRRSm1lHUszX20D1yYCQ,2501
|
||||
pip/_vendor/rich/errors.py,sha256=5pP3Kc5d4QJ_c0KFsxrfyhjiPVe7J1zOqSFbFAzcV-Y,642
|
||||
pip/_vendor/rich/file_proxy.py,sha256=4gCbGRXg0rW35Plaf0UVvj3dfENHuzc_n8I_dBqxI7o,1616
|
||||
pip/_vendor/rich/filesize.py,sha256=9fTLAPCAwHmBXdRv7KZU194jSgNrRb6Wx7RIoBgqeKY,2508
|
||||
pip/_vendor/rich/highlighter.py,sha256=3WW6PACGlq0e3YDjfqiMBQ0dYZwu7pcoFYUgJy01nb0,9585
|
||||
pip/_vendor/rich/json.py,sha256=TmeFm96Utaov-Ff5miavBPNo51HRooM8S78HEwrYEjA,5053
|
||||
pip/_vendor/rich/jupyter.py,sha256=QyoKoE_8IdCbrtiSHp9TsTSNyTHY0FO5whE7jOTd9UE,3252
|
||||
pip/_vendor/rich/layout.py,sha256=RFYL6HdCFsHf9WRpcvi3w-fpj-8O5dMZ8W96VdKNdbI,14007
|
||||
pip/_vendor/rich/live.py,sha256=emVaLUua-FKSYqZXmtJJjBIstO99CqMOuA6vMAKVkO0,14172
|
||||
pip/_vendor/rich/live_render.py,sha256=zElm3PrfSIvjOce28zETHMIUf9pFYSUA5o0AflgUP64,3667
|
||||
pip/_vendor/rich/logging.py,sha256=uB-cB-3Q4bmXDLLpbOWkmFviw-Fde39zyMV6tKJ2WHQ,11903
|
||||
pip/_vendor/rich/markup.py,sha256=xzF4uAafiEeEYDJYt_vUnJOGoTU8RrH-PH7WcWYXjCg,8198
|
||||
pip/_vendor/rich/measure.py,sha256=HmrIJX8sWRTHbgh8MxEay_83VkqNW_70s8aKP5ZcYI8,5305
|
||||
pip/_vendor/rich/padding.py,sha256=kTFGsdGe0os7tXLnHKpwTI90CXEvrceeZGCshmJy5zw,4970
|
||||
pip/_vendor/rich/pager.py,sha256=SO_ETBFKbg3n_AgOzXm41Sv36YxXAyI3_R-KOY2_uSc,828
|
||||
pip/_vendor/rich/palette.py,sha256=lInvR1ODDT2f3UZMfL1grq7dY_pDdKHw4bdUgOGaM4Y,3396
|
||||
pip/_vendor/rich/panel.py,sha256=wGMe40J8KCGgQoM0LyjRErmGIkv2bsYA71RCXThD0xE,10574
|
||||
pip/_vendor/rich/pretty.py,sha256=dAbLqSF3jJnyfBLJ7QjQ3B2J-WGyBnAdGXeuBVIyMyA,37414
|
||||
pip/_vendor/rich/progress.py,sha256=eg-OURdfZW3n3bib1-zP3SZl6cIm2VZup1pr_96CyLk,59836
|
||||
pip/_vendor/rich/progress_bar.py,sha256=cEoBfkc3lLwqba4XKsUpy4vSQKDh2QQ5J2J94-ACFoo,8165
|
||||
pip/_vendor/rich/prompt.py,sha256=x0mW-pIPodJM4ry6grgmmLrl8VZp99kqcmdnBe70YYA,11303
|
||||
pip/_vendor/rich/protocol.py,sha256=5hHHDDNHckdk8iWH5zEbi-zuIVSF5hbU2jIo47R7lTE,1391
|
||||
pip/_vendor/rich/region.py,sha256=rNT9xZrVZTYIXZC0NYn41CJQwYNbR-KecPOxTgQvB8Y,166
|
||||
pip/_vendor/rich/repr.py,sha256=eJObQe6_c5pUjRM85sZ2rrW47_iF9HT3Z8DrgVjvOl8,4436
|
||||
pip/_vendor/rich/rule.py,sha256=V6AWI0wCb6DB0rvN967FRMlQrdlG7HoZdfEAHyeG8CM,4773
|
||||
pip/_vendor/rich/scope.py,sha256=TMUU8qo17thyqQCPqjDLYpg_UU1k5qVd-WwiJvnJVas,2843
|
||||
pip/_vendor/rich/screen.py,sha256=YoeReESUhx74grqb0mSSb9lghhysWmFHYhsbMVQjXO8,1591
|
||||
pip/_vendor/rich/segment.py,sha256=6XdX0MfL18tUCaUWDWncIqx0wpq3GiaqzhYP779JvRA,24224
|
||||
pip/_vendor/rich/spinner.py,sha256=7b8MCleS4fa46HX0AzF98zfu6ZM6fAL0UgYzPOoakF4,4374
|
||||
pip/_vendor/rich/status.py,sha256=gJsIXIZeSo3urOyxRUjs6VrhX5CZrA0NxIQ-dxhCnwo,4425
|
||||
pip/_vendor/rich/style.py,sha256=odBbAlrgdEbAj7pmtPbQtWJNS8upyNhhy--Ks6KwAKk,26332
|
||||
pip/_vendor/rich/styled.py,sha256=eZNnzGrI4ki_54pgY3Oj0T-x3lxdXTYh4_ryDB24wBU,1258
|
||||
pip/_vendor/rich/syntax.py,sha256=W1xtdBA1-EVP-weYofKXusUlV5zghCOv1nWMHHfNmiY,34995
|
||||
pip/_vendor/rich/table.py,sha256=-WzesL-VJKsaiDU3uyczpJMHy6VCaSewBYJwx8RudI8,39684
|
||||
pip/_vendor/rich/terminal_theme.py,sha256=1j5-ufJfnvlAo5Qsi_ACZiXDmwMXzqgmFByObT9-yJY,3370
|
||||
pip/_vendor/rich/text.py,sha256=andXaxWW_wBveMiZZpd5viQwucWo7SPopcM3ZCQeO0c,45686
|
||||
pip/_vendor/rich/theme.py,sha256=GKNtQhDBZKAzDaY0vQVQQFzbc0uWfFe6CJXA-syT7zQ,3627
|
||||
pip/_vendor/rich/themes.py,sha256=0xgTLozfabebYtcJtDdC5QkX5IVUEaviqDUJJh4YVFk,102
|
||||
pip/_vendor/rich/traceback.py,sha256=6LkGguCEAxKv8v8xmKfMeYPPJ1UXUEHDv4726To6FiQ,26070
|
||||
pip/_vendor/rich/tree.py,sha256=BMbUYNjS9uodNPfvtY_odmU09GA5QzcMbQ5cJZhllQI,9169
|
||||
pip/_vendor/six.py,sha256=TOOfQi7nFGfMrIvtdr6wX4wyHH8M7aknmuLfo2cBBrM,34549
|
||||
pip/_vendor/tenacity/__init__.py,sha256=rjcWJVq5PcNJNC42rt-TAGGskM-RUEkZbDKu1ra7IPo,18364
|
||||
pip/_vendor/tenacity/__pycache__/__init__.cpython-311.pyc,,
|
||||
pip/_vendor/tenacity/__pycache__/_asyncio.cpython-311.pyc,,
|
||||
pip/_vendor/tenacity/__pycache__/_utils.cpython-311.pyc,,
|
||||
pip/_vendor/tenacity/__pycache__/after.cpython-311.pyc,,
|
||||
pip/_vendor/tenacity/__pycache__/before.cpython-311.pyc,,
|
||||
pip/_vendor/tenacity/__pycache__/before_sleep.cpython-311.pyc,,
|
||||
pip/_vendor/tenacity/__pycache__/nap.cpython-311.pyc,,
|
||||
pip/_vendor/tenacity/__pycache__/retry.cpython-311.pyc,,
|
||||
pip/_vendor/tenacity/__pycache__/stop.cpython-311.pyc,,
|
||||
pip/_vendor/tenacity/__pycache__/tornadoweb.cpython-311.pyc,,
|
||||
pip/_vendor/tenacity/__pycache__/wait.cpython-311.pyc,,
|
||||
pip/_vendor/tenacity/_asyncio.py,sha256=HEb0BVJEeBJE9P-m9XBxh1KcaF96BwoeqkJCL5sbVcQ,3314
|
||||
pip/_vendor/tenacity/_utils.py,sha256=-y68scDcyoqvTJuJJ0GTfjdSCljEYlbCYvgk7nM4NdM,1944
|
||||
pip/_vendor/tenacity/after.py,sha256=dlmyxxFy2uqpLXDr838DiEd7jgv2AGthsWHGYcGYsaI,1496
|
||||
pip/_vendor/tenacity/before.py,sha256=7XtvRmO0dRWUp8SVn24OvIiGFj8-4OP5muQRUiWgLh0,1376
|
||||
pip/_vendor/tenacity/before_sleep.py,sha256=ThyDvqKU5yle_IvYQz_b6Tp6UjUS0PhVp6zgqYl9U6Y,1908
|
||||
pip/_vendor/tenacity/nap.py,sha256=fRWvnz1aIzbIq9Ap3gAkAZgDH6oo5zxMrU6ZOVByq0I,1383
|
||||
pip/_vendor/tenacity/retry.py,sha256=Cy504Ss3UrRV7lnYgvymF66WD1wJ2dbM869kDcjuDes,7550
|
||||
pip/_vendor/tenacity/stop.py,sha256=sKHmHaoSaW6sKu3dTxUVKr1-stVkY7lw4Y9yjZU30zQ,2790
|
||||
pip/_vendor/tenacity/tornadoweb.py,sha256=E8lWO2nwe6dJgoB-N2HhQprYLDLB_UdSgFnv-EN6wKE,2145
|
||||
pip/_vendor/tenacity/wait.py,sha256=tdLTESRm5E237VHG0SxCDXRa0DHKPKVq285kslHVURc,8011
|
||||
pip/_vendor/tomli/__init__.py,sha256=JhUwV66DB1g4Hvt1UQCVMdfCu-IgAV8FXmvDU9onxd4,396
|
||||
pip/_vendor/tomli/__pycache__/__init__.cpython-311.pyc,,
|
||||
pip/_vendor/tomli/__pycache__/_parser.cpython-311.pyc,,
|
||||
pip/_vendor/tomli/__pycache__/_re.cpython-311.pyc,,
|
||||
pip/_vendor/tomli/__pycache__/_types.cpython-311.pyc,,
|
||||
pip/_vendor/tomli/_parser.py,sha256=g9-ENaALS-B8dokYpCuzUFalWlog7T-SIYMjLZSWrtM,22633
|
||||
pip/_vendor/tomli/_re.py,sha256=dbjg5ChZT23Ka9z9DHOXfdtSpPwUfdgMXnj8NOoly-w,2943
|
||||
pip/_vendor/tomli/_types.py,sha256=-GTG2VUqkpxwMqzmVO4F7ybKddIbAnuAHXfmWQcTi3Q,254
|
||||
pip/_vendor/typing_extensions.py,sha256=VKZ_nHsuzDbKOVUY2CTdavwBgfZ2EXRyluZHRzUYAbg,80114
|
||||
pip/_vendor/urllib3/__init__.py,sha256=iXLcYiJySn0GNbWOOZDDApgBL1JgP44EZ8i1760S8Mc,3333
|
||||
pip/_vendor/urllib3/__pycache__/__init__.cpython-311.pyc,,
|
||||
pip/_vendor/urllib3/__pycache__/_collections.cpython-311.pyc,,
|
||||
pip/_vendor/urllib3/__pycache__/_version.cpython-311.pyc,,
|
||||
pip/_vendor/urllib3/__pycache__/connection.cpython-311.pyc,,
|
||||
pip/_vendor/urllib3/__pycache__/connectionpool.cpython-311.pyc,,
|
||||
pip/_vendor/urllib3/__pycache__/exceptions.cpython-311.pyc,,
|
||||
pip/_vendor/urllib3/__pycache__/fields.cpython-311.pyc,,
|
||||
pip/_vendor/urllib3/__pycache__/filepost.cpython-311.pyc,,
|
||||
pip/_vendor/urllib3/__pycache__/poolmanager.cpython-311.pyc,,
|
||||
pip/_vendor/urllib3/__pycache__/request.cpython-311.pyc,,
|
||||
pip/_vendor/urllib3/__pycache__/response.cpython-311.pyc,,
|
||||
pip/_vendor/urllib3/_collections.py,sha256=Rp1mVyBgc_UlAcp6M3at1skJBXR5J43NawRTvW2g_XY,10811
|
||||
pip/_vendor/urllib3/_version.py,sha256=JWE--BUVy7--9FsXILONIpQ43irftKGjT9j2H_fdF2M,64
|
||||
pip/_vendor/urllib3/connection.py,sha256=8976wL6sGeVMW0JnXvx5mD00yXu87uQjxtB9_VL8dx8,20070
|
||||
pip/_vendor/urllib3/connectionpool.py,sha256=vS4UaHLoR9_5aGLXSQ776y_jTxgqqjx0YsjkYksWGOo,39095
|
||||
pip/_vendor/urllib3/contrib/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
||||
pip/_vendor/urllib3/contrib/__pycache__/__init__.cpython-311.pyc,,
|
||||
pip/_vendor/urllib3/contrib/__pycache__/_appengine_environ.cpython-311.pyc,,
|
||||
pip/_vendor/urllib3/contrib/__pycache__/appengine.cpython-311.pyc,,
|
||||
pip/_vendor/urllib3/contrib/__pycache__/ntlmpool.cpython-311.pyc,,
|
||||
pip/_vendor/urllib3/contrib/__pycache__/pyopenssl.cpython-311.pyc,,
|
||||
pip/_vendor/urllib3/contrib/__pycache__/securetransport.cpython-311.pyc,,
|
||||
pip/_vendor/urllib3/contrib/__pycache__/socks.cpython-311.pyc,,
|
||||
pip/_vendor/urllib3/contrib/_appengine_environ.py,sha256=bDbyOEhW2CKLJcQqAKAyrEHN-aklsyHFKq6vF8ZFsmk,957
|
||||
pip/_vendor/urllib3/contrib/_securetransport/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
||||
pip/_vendor/urllib3/contrib/_securetransport/__pycache__/__init__.cpython-311.pyc,,
|
||||
pip/_vendor/urllib3/contrib/_securetransport/__pycache__/bindings.cpython-311.pyc,,
|
||||
pip/_vendor/urllib3/contrib/_securetransport/__pycache__/low_level.cpython-311.pyc,,
|
||||
pip/_vendor/urllib3/contrib/_securetransport/bindings.py,sha256=4Xk64qIkPBt09A5q-RIFUuDhNc9mXilVapm7WnYnzRw,17632
|
||||
pip/_vendor/urllib3/contrib/_securetransport/low_level.py,sha256=B2JBB2_NRP02xK6DCa1Pa9IuxrPwxzDzZbixQkb7U9M,13922
|
||||
pip/_vendor/urllib3/contrib/appengine.py,sha256=VR68eAVE137lxTgjBDwCna5UiBZTOKa01Aj_-5BaCz4,11036
|
||||
pip/_vendor/urllib3/contrib/ntlmpool.py,sha256=NlfkW7WMdW8ziqudopjHoW299og1BTWi0IeIibquFwk,4528
|
||||
pip/_vendor/urllib3/contrib/pyopenssl.py,sha256=hDJh4MhyY_p-oKlFcYcQaVQRDv6GMmBGuW9yjxyeejM,17081
|
||||
pip/_vendor/urllib3/contrib/securetransport.py,sha256=yhZdmVjY6PI6EeFbp7qYOp6-vp1Rkv2NMuOGaEj7pmc,34448
|
||||
pip/_vendor/urllib3/contrib/socks.py,sha256=aRi9eWXo9ZEb95XUxef4Z21CFlnnjbEiAo9HOseoMt4,7097
|
||||
pip/_vendor/urllib3/exceptions.py,sha256=0Mnno3KHTNfXRfY7638NufOPkUb6mXOm-Lqj-4x2w8A,8217
|
||||
pip/_vendor/urllib3/fields.py,sha256=kvLDCg_JmH1lLjUUEY_FLS8UhY7hBvDPuVETbY8mdrM,8579
|
||||
pip/_vendor/urllib3/filepost.py,sha256=5b_qqgRHVlL7uLtdAYBzBh-GHmU5AfJVt_2N0XS3PeY,2440
|
||||
pip/_vendor/urllib3/packages/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
||||
pip/_vendor/urllib3/packages/__pycache__/__init__.cpython-311.pyc,,
|
||||
pip/_vendor/urllib3/packages/__pycache__/six.cpython-311.pyc,,
|
||||
pip/_vendor/urllib3/packages/backports/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
||||
pip/_vendor/urllib3/packages/backports/__pycache__/__init__.cpython-311.pyc,,
|
||||
pip/_vendor/urllib3/packages/backports/__pycache__/makefile.cpython-311.pyc,,
|
||||
pip/_vendor/urllib3/packages/backports/makefile.py,sha256=nbzt3i0agPVP07jqqgjhaYjMmuAi_W5E0EywZivVO8E,1417
|
||||
pip/_vendor/urllib3/packages/six.py,sha256=b9LM0wBXv7E7SrbCjAm4wwN-hrH-iNxv18LgWNMMKPo,34665
|
||||
pip/_vendor/urllib3/poolmanager.py,sha256=0KOOJECoeLYVjUHvv-0h4Oq3FFQQ2yb-Fnjkbj8gJO0,19786
|
||||
pip/_vendor/urllib3/request.py,sha256=ZFSIqX0C6WizixecChZ3_okyu7BEv0lZu1VT0s6h4SM,5985
|
||||
pip/_vendor/urllib3/response.py,sha256=fmDJAFkG71uFTn-sVSTh2Iw0WmcXQYqkbRjihvwBjU8,30641
|
||||
pip/_vendor/urllib3/util/__init__.py,sha256=JEmSmmqqLyaw8P51gUImZh8Gwg9i1zSe-DoqAitn2nc,1155
|
||||
pip/_vendor/urllib3/util/__pycache__/__init__.cpython-311.pyc,,
|
||||
pip/_vendor/urllib3/util/__pycache__/connection.cpython-311.pyc,,
|
||||
pip/_vendor/urllib3/util/__pycache__/proxy.cpython-311.pyc,,
|
||||
pip/_vendor/urllib3/util/__pycache__/queue.cpython-311.pyc,,
|
||||
pip/_vendor/urllib3/util/__pycache__/request.cpython-311.pyc,,
|
||||
pip/_vendor/urllib3/util/__pycache__/response.cpython-311.pyc,,
|
||||
pip/_vendor/urllib3/util/__pycache__/retry.cpython-311.pyc,,
|
||||
pip/_vendor/urllib3/util/__pycache__/ssl_.cpython-311.pyc,,
|
||||
pip/_vendor/urllib3/util/__pycache__/ssl_match_hostname.cpython-311.pyc,,
|
||||
pip/_vendor/urllib3/util/__pycache__/ssltransport.cpython-311.pyc,,
|
||||
pip/_vendor/urllib3/util/__pycache__/timeout.cpython-311.pyc,,
|
||||
pip/_vendor/urllib3/util/__pycache__/url.cpython-311.pyc,,
|
||||
pip/_vendor/urllib3/util/__pycache__/wait.cpython-311.pyc,,
|
||||
pip/_vendor/urllib3/util/connection.py,sha256=5Lx2B1PW29KxBn2T0xkN1CBgRBa3gGVJBKoQoRogEVk,4901
|
||||
pip/_vendor/urllib3/util/proxy.py,sha256=zUvPPCJrp6dOF0N4GAVbOcl6o-4uXKSrGiTkkr5vUS4,1605
|
||||
pip/_vendor/urllib3/util/queue.py,sha256=nRgX8_eX-_VkvxoX096QWoz8Ps0QHUAExILCY_7PncM,498
|
||||
pip/_vendor/urllib3/util/request.py,sha256=C0OUt2tcU6LRiQJ7YYNP9GvPrSvl7ziIBekQ-5nlBZk,3997
|
||||
pip/_vendor/urllib3/util/response.py,sha256=GJpg3Egi9qaJXRwBh5wv-MNuRWan5BIu40oReoxWP28,3510
|
||||
pip/_vendor/urllib3/util/retry.py,sha256=4laWh0HpwGijLiBmdBIYtbhYekQnNzzhx2W9uys0RHA,22003
|
||||
pip/_vendor/urllib3/util/ssl_.py,sha256=X4-AqW91aYPhPx6-xbf66yHFQKbqqfC_5Zt4WkLX1Hc,17177
|
||||
pip/_vendor/urllib3/util/ssl_match_hostname.py,sha256=Ir4cZVEjmAk8gUAIHWSi7wtOO83UCYABY2xFD1Ql_WA,5758
|
||||
pip/_vendor/urllib3/util/ssltransport.py,sha256=NA-u5rMTrDFDFC8QzRKUEKMG0561hOD4qBTr3Z4pv6E,6895
|
||||
pip/_vendor/urllib3/util/timeout.py,sha256=QSbBUNOB9yh6AnDn61SrLQ0hg5oz0I9-uXEG91AJuIg,10003
|
||||
pip/_vendor/urllib3/util/url.py,sha256=HLCLEKt8D-QMioTNbneZSzGTGyUkns4w_lSJP1UzE2E,14298
|
||||
pip/_vendor/urllib3/util/wait.py,sha256=fOX0_faozG2P7iVojQoE1mbydweNyTcm-hXEfFrTtLI,5403
|
||||
pip/_vendor/vendor.txt,sha256=3i3Zr7_kRDD9UEva0I8YOMroCZ8xuZ9OWd_Q4jmazqE,476
|
||||
pip/_vendor/webencodings/__init__.py,sha256=qOBJIuPy_4ByYH6W_bNgJF-qYQ2DoU-dKsDu5yRWCXg,10579
|
||||
pip/_vendor/webencodings/__pycache__/__init__.cpython-311.pyc,,
|
||||
pip/_vendor/webencodings/__pycache__/labels.cpython-311.pyc,,
|
||||
pip/_vendor/webencodings/__pycache__/mklabels.cpython-311.pyc,,
|
||||
pip/_vendor/webencodings/__pycache__/tests.cpython-311.pyc,,
|
||||
pip/_vendor/webencodings/__pycache__/x_user_defined.cpython-311.pyc,,
|
||||
pip/_vendor/webencodings/labels.py,sha256=4AO_KxTddqGtrL9ns7kAPjb0CcN6xsCIxbK37HY9r3E,8979
|
||||
pip/_vendor/webencodings/mklabels.py,sha256=GYIeywnpaLnP0GSic8LFWgd0UVvO_l1Nc6YoF-87R_4,1305
|
||||
pip/_vendor/webencodings/tests.py,sha256=OtGLyjhNY1fvkW1GvLJ_FV9ZoqC9Anyjr7q3kxTbzNs,6563
|
||||
pip/_vendor/webencodings/x_user_defined.py,sha256=yOqWSdmpytGfUgh_Z6JYgDNhoc-BAHyyeeT15Fr42tM,4307
|
||||
pip/py.typed,sha256=EBVvvPRTn_eIpz5e5QztSCdrMX7Qwd7VP93RSoIlZ2I,286
|
||||
@@ -0,0 +1,5 @@
|
||||
Wheel-Version: 1.0
|
||||
Generator: bdist_wheel (0.38.4)
|
||||
Root-Is-Purelib: true
|
||||
Tag: py3-none-any
|
||||
|
||||
@@ -0,0 +1,4 @@
|
||||
[console_scripts]
|
||||
pip = pip._internal.cli.main:main
|
||||
pip3 = pip._internal.cli.main:main
|
||||
pip3.11 = pip._internal.cli.main:main
|
||||
@@ -0,0 +1 @@
|
||||
pip
|
||||
@@ -0,0 +1,13 @@
|
||||
from typing import List, Optional
|
||||
|
||||
__version__ = "23.0.1"
|
||||
|
||||
|
||||
def main(args: Optional[List[str]] = None) -> int:
|
||||
"""This is an internal API only meant for use by pip's own console scripts.
|
||||
|
||||
For additional details, see https://github.com/pypa/pip/issues/7498.
|
||||
"""
|
||||
from pip._internal.utils.entrypoints import _wrapper
|
||||
|
||||
return _wrapper(args)
|
||||
@@ -0,0 +1,31 @@
|
||||
import os
|
||||
import sys
|
||||
import warnings
|
||||
|
||||
# Remove '' and current working directory from the first entry
|
||||
# of sys.path, if present to avoid using current directory
|
||||
# in pip commands check, freeze, install, list and show,
|
||||
# when invoked as python -m pip <command>
|
||||
if sys.path[0] in ("", os.getcwd()):
|
||||
sys.path.pop(0)
|
||||
|
||||
# If we are running from a wheel, add the wheel to sys.path
|
||||
# This allows the usage python pip-*.whl/pip install pip-*.whl
|
||||
if __package__ == "":
|
||||
# __file__ is pip-*.whl/pip/__main__.py
|
||||
# first dirname call strips of '/__main__.py', second strips off '/pip'
|
||||
# Resulting path is the name of the wheel itself
|
||||
# Add that to sys.path so we can import pip
|
||||
path = os.path.dirname(os.path.dirname(__file__))
|
||||
sys.path.insert(0, path)
|
||||
|
||||
if __name__ == "__main__":
|
||||
# Work around the error reported in #9540, pending a proper fix.
|
||||
# Note: It is essential the warning filter is set *before* importing
|
||||
# pip, as the deprecation happens at import time, not runtime.
|
||||
warnings.filterwarnings(
|
||||
"ignore", category=DeprecationWarning, module=".*packaging\\.version"
|
||||
)
|
||||
from pip._internal.cli.main import main as _main
|
||||
|
||||
sys.exit(_main())
|
||||
@@ -0,0 +1,50 @@
|
||||
"""Execute exactly this copy of pip, within a different environment.
|
||||
|
||||
This file is named as it is, to ensure that this module can't be imported via
|
||||
an import statement.
|
||||
"""
|
||||
|
||||
# /!\ This version compatibility check section must be Python 2 compatible. /!\
|
||||
|
||||
import sys
|
||||
|
||||
# Copied from setup.py
|
||||
PYTHON_REQUIRES = (3, 7)
|
||||
|
||||
|
||||
def version_str(version): # type: ignore
|
||||
return ".".join(str(v) for v in version)
|
||||
|
||||
|
||||
if sys.version_info[:2] < PYTHON_REQUIRES:
|
||||
raise SystemExit(
|
||||
"This version of pip does not support python {} (requires >={}).".format(
|
||||
version_str(sys.version_info[:2]), version_str(PYTHON_REQUIRES)
|
||||
)
|
||||
)
|
||||
|
||||
# From here on, we can use Python 3 features, but the syntax must remain
|
||||
# Python 2 compatible.
|
||||
|
||||
import runpy # noqa: E402
|
||||
from importlib.machinery import PathFinder # noqa: E402
|
||||
from os.path import dirname # noqa: E402
|
||||
|
||||
PIP_SOURCES_ROOT = dirname(dirname(__file__))
|
||||
|
||||
|
||||
class PipImportRedirectingFinder:
|
||||
@classmethod
|
||||
def find_spec(self, fullname, path=None, target=None): # type: ignore
|
||||
if fullname != "pip":
|
||||
return None
|
||||
|
||||
spec = PathFinder.find_spec(fullname, [PIP_SOURCES_ROOT], target)
|
||||
assert spec, (PIP_SOURCES_ROOT, fullname)
|
||||
return spec
|
||||
|
||||
|
||||
sys.meta_path.insert(0, PipImportRedirectingFinder())
|
||||
|
||||
assert __name__ == "__main__", "Cannot run __pip-runner__.py as a non-main module"
|
||||
runpy.run_module("pip", run_name="__main__", alter_sys=True)
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,19 @@
|
||||
from typing import List, Optional
|
||||
|
||||
import pip._internal.utils.inject_securetransport # noqa
|
||||
from pip._internal.utils import _log
|
||||
|
||||
# init_logging() must be called before any call to logging.getLogger()
|
||||
# which happens at import of most modules.
|
||||
_log.init_logging()
|
||||
|
||||
|
||||
def main(args: (Optional[List[str]]) = None) -> int:
|
||||
"""This is preserved for old console scripts that may still be referencing
|
||||
it.
|
||||
|
||||
For additional details, see https://github.com/pypa/pip/issues/7498.
|
||||
"""
|
||||
from pip._internal.utils.entrypoints import _wrapper
|
||||
|
||||
return _wrapper(args)
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
@@ -0,0 +1,311 @@
|
||||
"""Build Environment used for isolation during sdist building
|
||||
"""
|
||||
|
||||
import logging
|
||||
import os
|
||||
import pathlib
|
||||
import site
|
||||
import sys
|
||||
import textwrap
|
||||
from collections import OrderedDict
|
||||
from types import TracebackType
|
||||
from typing import TYPE_CHECKING, Iterable, List, Optional, Set, Tuple, Type, Union
|
||||
|
||||
from pip._vendor.certifi import where
|
||||
from pip._vendor.packaging.requirements import Requirement
|
||||
from pip._vendor.packaging.version import Version
|
||||
|
||||
from pip import __file__ as pip_location
|
||||
from pip._internal.cli.spinners import open_spinner
|
||||
from pip._internal.locations import get_platlib, get_purelib, get_scheme
|
||||
from pip._internal.metadata import get_default_environment, get_environment
|
||||
from pip._internal.utils.subprocess import call_subprocess
|
||||
from pip._internal.utils.temp_dir import TempDirectory, tempdir_kinds
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from pip._internal.index.package_finder import PackageFinder
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
def _dedup(a: str, b: str) -> Union[Tuple[str], Tuple[str, str]]:
|
||||
return (a, b) if a != b else (a,)
|
||||
|
||||
|
||||
class _Prefix:
|
||||
def __init__(self, path: str) -> None:
|
||||
self.path = path
|
||||
self.setup = False
|
||||
scheme = get_scheme("", prefix=path)
|
||||
self.bin_dir = scheme.scripts
|
||||
self.lib_dirs = _dedup(scheme.purelib, scheme.platlib)
|
||||
|
||||
|
||||
def get_runnable_pip() -> str:
|
||||
"""Get a file to pass to a Python executable, to run the currently-running pip.
|
||||
|
||||
This is used to run a pip subprocess, for installing requirements into the build
|
||||
environment.
|
||||
"""
|
||||
source = pathlib.Path(pip_location).resolve().parent
|
||||
|
||||
if not source.is_dir():
|
||||
# This would happen if someone is using pip from inside a zip file. In that
|
||||
# case, we can use that directly.
|
||||
return str(source)
|
||||
|
||||
return os.fsdecode(source / "__pip-runner__.py")
|
||||
|
||||
|
||||
def _get_system_sitepackages() -> Set[str]:
|
||||
"""Get system site packages
|
||||
|
||||
Usually from site.getsitepackages,
|
||||
but fallback on `get_purelib()/get_platlib()` if unavailable
|
||||
(e.g. in a virtualenv created by virtualenv<20)
|
||||
|
||||
Returns normalized set of strings.
|
||||
"""
|
||||
if hasattr(site, "getsitepackages"):
|
||||
system_sites = site.getsitepackages()
|
||||
else:
|
||||
# virtualenv < 20 overwrites site.py without getsitepackages
|
||||
# fallback on get_purelib/get_platlib.
|
||||
# this is known to miss things, but shouldn't in the cases
|
||||
# where getsitepackages() has been removed (inside a virtualenv)
|
||||
system_sites = [get_purelib(), get_platlib()]
|
||||
return {os.path.normcase(path) for path in system_sites}
|
||||
|
||||
|
||||
class BuildEnvironment:
|
||||
"""Creates and manages an isolated environment to install build deps"""
|
||||
|
||||
def __init__(self) -> None:
|
||||
temp_dir = TempDirectory(kind=tempdir_kinds.BUILD_ENV, globally_managed=True)
|
||||
|
||||
self._prefixes = OrderedDict(
|
||||
(name, _Prefix(os.path.join(temp_dir.path, name)))
|
||||
for name in ("normal", "overlay")
|
||||
)
|
||||
|
||||
self._bin_dirs: List[str] = []
|
||||
self._lib_dirs: List[str] = []
|
||||
for prefix in reversed(list(self._prefixes.values())):
|
||||
self._bin_dirs.append(prefix.bin_dir)
|
||||
self._lib_dirs.extend(prefix.lib_dirs)
|
||||
|
||||
# Customize site to:
|
||||
# - ensure .pth files are honored
|
||||
# - prevent access to system site packages
|
||||
system_sites = _get_system_sitepackages()
|
||||
|
||||
self._site_dir = os.path.join(temp_dir.path, "site")
|
||||
if not os.path.exists(self._site_dir):
|
||||
os.mkdir(self._site_dir)
|
||||
with open(
|
||||
os.path.join(self._site_dir, "sitecustomize.py"), "w", encoding="utf-8"
|
||||
) as fp:
|
||||
fp.write(
|
||||
textwrap.dedent(
|
||||
"""
|
||||
import os, site, sys
|
||||
|
||||
# First, drop system-sites related paths.
|
||||
original_sys_path = sys.path[:]
|
||||
known_paths = set()
|
||||
for path in {system_sites!r}:
|
||||
site.addsitedir(path, known_paths=known_paths)
|
||||
system_paths = set(
|
||||
os.path.normcase(path)
|
||||
for path in sys.path[len(original_sys_path):]
|
||||
)
|
||||
original_sys_path = [
|
||||
path for path in original_sys_path
|
||||
if os.path.normcase(path) not in system_paths
|
||||
]
|
||||
sys.path = original_sys_path
|
||||
|
||||
# Second, add lib directories.
|
||||
# ensuring .pth file are processed.
|
||||
for path in {lib_dirs!r}:
|
||||
assert not path in sys.path
|
||||
site.addsitedir(path)
|
||||
"""
|
||||
).format(system_sites=system_sites, lib_dirs=self._lib_dirs)
|
||||
)
|
||||
|
||||
def __enter__(self) -> None:
|
||||
self._save_env = {
|
||||
name: os.environ.get(name, None)
|
||||
for name in ("PATH", "PYTHONNOUSERSITE", "PYTHONPATH")
|
||||
}
|
||||
|
||||
path = self._bin_dirs[:]
|
||||
old_path = self._save_env["PATH"]
|
||||
if old_path:
|
||||
path.extend(old_path.split(os.pathsep))
|
||||
|
||||
pythonpath = [self._site_dir]
|
||||
|
||||
os.environ.update(
|
||||
{
|
||||
"PATH": os.pathsep.join(path),
|
||||
"PYTHONNOUSERSITE": "1",
|
||||
"PYTHONPATH": os.pathsep.join(pythonpath),
|
||||
}
|
||||
)
|
||||
|
||||
def __exit__(
|
||||
self,
|
||||
exc_type: Optional[Type[BaseException]],
|
||||
exc_val: Optional[BaseException],
|
||||
exc_tb: Optional[TracebackType],
|
||||
) -> None:
|
||||
for varname, old_value in self._save_env.items():
|
||||
if old_value is None:
|
||||
os.environ.pop(varname, None)
|
||||
else:
|
||||
os.environ[varname] = old_value
|
||||
|
||||
def check_requirements(
|
||||
self, reqs: Iterable[str]
|
||||
) -> Tuple[Set[Tuple[str, str]], Set[str]]:
|
||||
"""Return 2 sets:
|
||||
- conflicting requirements: set of (installed, wanted) reqs tuples
|
||||
- missing requirements: set of reqs
|
||||
"""
|
||||
missing = set()
|
||||
conflicting = set()
|
||||
if reqs:
|
||||
env = (
|
||||
get_environment(self._lib_dirs)
|
||||
if hasattr(self, "_lib_dirs")
|
||||
else get_default_environment()
|
||||
)
|
||||
for req_str in reqs:
|
||||
req = Requirement(req_str)
|
||||
# We're explicitly evaluating with an empty extra value, since build
|
||||
# environments are not provided any mechanism to select specific extras.
|
||||
if req.marker is not None and not req.marker.evaluate({"extra": ""}):
|
||||
continue
|
||||
dist = env.get_distribution(req.name)
|
||||
if not dist:
|
||||
missing.add(req_str)
|
||||
continue
|
||||
if isinstance(dist.version, Version):
|
||||
installed_req_str = f"{req.name}=={dist.version}"
|
||||
else:
|
||||
installed_req_str = f"{req.name}==={dist.version}"
|
||||
if not req.specifier.contains(dist.version, prereleases=True):
|
||||
conflicting.add((installed_req_str, req_str))
|
||||
# FIXME: Consider direct URL?
|
||||
return conflicting, missing
|
||||
|
||||
def install_requirements(
|
||||
self,
|
||||
finder: "PackageFinder",
|
||||
requirements: Iterable[str],
|
||||
prefix_as_string: str,
|
||||
*,
|
||||
kind: str,
|
||||
) -> None:
|
||||
prefix = self._prefixes[prefix_as_string]
|
||||
assert not prefix.setup
|
||||
prefix.setup = True
|
||||
if not requirements:
|
||||
return
|
||||
self._install_requirements(
|
||||
get_runnable_pip(),
|
||||
finder,
|
||||
requirements,
|
||||
prefix,
|
||||
kind=kind,
|
||||
)
|
||||
|
||||
@staticmethod
|
||||
def _install_requirements(
|
||||
pip_runnable: str,
|
||||
finder: "PackageFinder",
|
||||
requirements: Iterable[str],
|
||||
prefix: _Prefix,
|
||||
*,
|
||||
kind: str,
|
||||
) -> None:
|
||||
args: List[str] = [
|
||||
sys.executable,
|
||||
pip_runnable,
|
||||
"install",
|
||||
"--ignore-installed",
|
||||
"--no-user",
|
||||
"--prefix",
|
||||
prefix.path,
|
||||
"--no-warn-script-location",
|
||||
]
|
||||
if logger.getEffectiveLevel() <= logging.DEBUG:
|
||||
args.append("-v")
|
||||
for format_control in ("no_binary", "only_binary"):
|
||||
formats = getattr(finder.format_control, format_control)
|
||||
args.extend(
|
||||
(
|
||||
"--" + format_control.replace("_", "-"),
|
||||
",".join(sorted(formats or {":none:"})),
|
||||
)
|
||||
)
|
||||
|
||||
index_urls = finder.index_urls
|
||||
if index_urls:
|
||||
args.extend(["-i", index_urls[0]])
|
||||
for extra_index in index_urls[1:]:
|
||||
args.extend(["--extra-index-url", extra_index])
|
||||
else:
|
||||
args.append("--no-index")
|
||||
for link in finder.find_links:
|
||||
args.extend(["--find-links", link])
|
||||
|
||||
for host in finder.trusted_hosts:
|
||||
args.extend(["--trusted-host", host])
|
||||
if finder.allow_all_prereleases:
|
||||
args.append("--pre")
|
||||
if finder.prefer_binary:
|
||||
args.append("--prefer-binary")
|
||||
args.append("--")
|
||||
args.extend(requirements)
|
||||
extra_environ = {"_PIP_STANDALONE_CERT": where()}
|
||||
with open_spinner(f"Installing {kind}") as spinner:
|
||||
call_subprocess(
|
||||
args,
|
||||
command_desc=f"pip subprocess to install {kind}",
|
||||
spinner=spinner,
|
||||
extra_environ=extra_environ,
|
||||
)
|
||||
|
||||
|
||||
class NoOpBuildEnvironment(BuildEnvironment):
|
||||
"""A no-op drop-in replacement for BuildEnvironment"""
|
||||
|
||||
def __init__(self) -> None:
|
||||
pass
|
||||
|
||||
def __enter__(self) -> None:
|
||||
pass
|
||||
|
||||
def __exit__(
|
||||
self,
|
||||
exc_type: Optional[Type[BaseException]],
|
||||
exc_val: Optional[BaseException],
|
||||
exc_tb: Optional[TracebackType],
|
||||
) -> None:
|
||||
pass
|
||||
|
||||
def cleanup(self) -> None:
|
||||
pass
|
||||
|
||||
def install_requirements(
|
||||
self,
|
||||
finder: "PackageFinder",
|
||||
requirements: Iterable[str],
|
||||
prefix_as_string: str,
|
||||
*,
|
||||
kind: str,
|
||||
) -> None:
|
||||
raise NotImplementedError()
|
||||
@@ -0,0 +1,293 @@
|
||||
"""Cache Management
|
||||
"""
|
||||
|
||||
import hashlib
|
||||
import json
|
||||
import logging
|
||||
import os
|
||||
from pathlib import Path
|
||||
from typing import Any, Dict, List, Optional, Set
|
||||
|
||||
from pip._vendor.packaging.tags import Tag, interpreter_name, interpreter_version
|
||||
from pip._vendor.packaging.utils import canonicalize_name
|
||||
|
||||
from pip._internal.exceptions import InvalidWheelFilename
|
||||
from pip._internal.models.direct_url import DirectUrl
|
||||
from pip._internal.models.format_control import FormatControl
|
||||
from pip._internal.models.link import Link
|
||||
from pip._internal.models.wheel import Wheel
|
||||
from pip._internal.utils.temp_dir import TempDirectory, tempdir_kinds
|
||||
from pip._internal.utils.urls import path_to_url
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
ORIGIN_JSON_NAME = "origin.json"
|
||||
|
||||
|
||||
def _hash_dict(d: Dict[str, str]) -> str:
|
||||
"""Return a stable sha224 of a dictionary."""
|
||||
s = json.dumps(d, sort_keys=True, separators=(",", ":"), ensure_ascii=True)
|
||||
return hashlib.sha224(s.encode("ascii")).hexdigest()
|
||||
|
||||
|
||||
class Cache:
|
||||
"""An abstract class - provides cache directories for data from links
|
||||
|
||||
|
||||
:param cache_dir: The root of the cache.
|
||||
:param format_control: An object of FormatControl class to limit
|
||||
binaries being read from the cache.
|
||||
:param allowed_formats: which formats of files the cache should store.
|
||||
('binary' and 'source' are the only allowed values)
|
||||
"""
|
||||
|
||||
def __init__(
|
||||
self, cache_dir: str, format_control: FormatControl, allowed_formats: Set[str]
|
||||
) -> None:
|
||||
super().__init__()
|
||||
assert not cache_dir or os.path.isabs(cache_dir)
|
||||
self.cache_dir = cache_dir or None
|
||||
self.format_control = format_control
|
||||
self.allowed_formats = allowed_formats
|
||||
|
||||
_valid_formats = {"source", "binary"}
|
||||
assert self.allowed_formats.union(_valid_formats) == _valid_formats
|
||||
|
||||
def _get_cache_path_parts(self, link: Link) -> List[str]:
|
||||
"""Get parts of part that must be os.path.joined with cache_dir"""
|
||||
|
||||
# We want to generate an url to use as our cache key, we don't want to
|
||||
# just re-use the URL because it might have other items in the fragment
|
||||
# and we don't care about those.
|
||||
key_parts = {"url": link.url_without_fragment}
|
||||
if link.hash_name is not None and link.hash is not None:
|
||||
key_parts[link.hash_name] = link.hash
|
||||
if link.subdirectory_fragment:
|
||||
key_parts["subdirectory"] = link.subdirectory_fragment
|
||||
|
||||
# Include interpreter name, major and minor version in cache key
|
||||
# to cope with ill-behaved sdists that build a different wheel
|
||||
# depending on the python version their setup.py is being run on,
|
||||
# and don't encode the difference in compatibility tags.
|
||||
# https://github.com/pypa/pip/issues/7296
|
||||
key_parts["interpreter_name"] = interpreter_name()
|
||||
key_parts["interpreter_version"] = interpreter_version()
|
||||
|
||||
# Encode our key url with sha224, we'll use this because it has similar
|
||||
# security properties to sha256, but with a shorter total output (and
|
||||
# thus less secure). However the differences don't make a lot of
|
||||
# difference for our use case here.
|
||||
hashed = _hash_dict(key_parts)
|
||||
|
||||
# We want to nest the directories some to prevent having a ton of top
|
||||
# level directories where we might run out of sub directories on some
|
||||
# FS.
|
||||
parts = [hashed[:2], hashed[2:4], hashed[4:6], hashed[6:]]
|
||||
|
||||
return parts
|
||||
|
||||
def _get_candidates(self, link: Link, canonical_package_name: str) -> List[Any]:
|
||||
can_not_cache = not self.cache_dir or not canonical_package_name or not link
|
||||
if can_not_cache:
|
||||
return []
|
||||
|
||||
formats = self.format_control.get_allowed_formats(canonical_package_name)
|
||||
if not self.allowed_formats.intersection(formats):
|
||||
return []
|
||||
|
||||
candidates = []
|
||||
path = self.get_path_for_link(link)
|
||||
if os.path.isdir(path):
|
||||
for candidate in os.listdir(path):
|
||||
candidates.append((candidate, path))
|
||||
return candidates
|
||||
|
||||
def get_path_for_link(self, link: Link) -> str:
|
||||
"""Return a directory to store cached items in for link."""
|
||||
raise NotImplementedError()
|
||||
|
||||
def get(
|
||||
self,
|
||||
link: Link,
|
||||
package_name: Optional[str],
|
||||
supported_tags: List[Tag],
|
||||
) -> Link:
|
||||
"""Returns a link to a cached item if it exists, otherwise returns the
|
||||
passed link.
|
||||
"""
|
||||
raise NotImplementedError()
|
||||
|
||||
|
||||
class SimpleWheelCache(Cache):
|
||||
"""A cache of wheels for future installs."""
|
||||
|
||||
def __init__(self, cache_dir: str, format_control: FormatControl) -> None:
|
||||
super().__init__(cache_dir, format_control, {"binary"})
|
||||
|
||||
def get_path_for_link(self, link: Link) -> str:
|
||||
"""Return a directory to store cached wheels for link
|
||||
|
||||
Because there are M wheels for any one sdist, we provide a directory
|
||||
to cache them in, and then consult that directory when looking up
|
||||
cache hits.
|
||||
|
||||
We only insert things into the cache if they have plausible version
|
||||
numbers, so that we don't contaminate the cache with things that were
|
||||
not unique. E.g. ./package might have dozens of installs done for it
|
||||
and build a version of 0.0...and if we built and cached a wheel, we'd
|
||||
end up using the same wheel even if the source has been edited.
|
||||
|
||||
:param link: The link of the sdist for which this will cache wheels.
|
||||
"""
|
||||
parts = self._get_cache_path_parts(link)
|
||||
assert self.cache_dir
|
||||
# Store wheels within the root cache_dir
|
||||
return os.path.join(self.cache_dir, "wheels", *parts)
|
||||
|
||||
def get(
|
||||
self,
|
||||
link: Link,
|
||||
package_name: Optional[str],
|
||||
supported_tags: List[Tag],
|
||||
) -> Link:
|
||||
candidates = []
|
||||
|
||||
if not package_name:
|
||||
return link
|
||||
|
||||
canonical_package_name = canonicalize_name(package_name)
|
||||
for wheel_name, wheel_dir in self._get_candidates(link, canonical_package_name):
|
||||
try:
|
||||
wheel = Wheel(wheel_name)
|
||||
except InvalidWheelFilename:
|
||||
continue
|
||||
if canonicalize_name(wheel.name) != canonical_package_name:
|
||||
logger.debug(
|
||||
"Ignoring cached wheel %s for %s as it "
|
||||
"does not match the expected distribution name %s.",
|
||||
wheel_name,
|
||||
link,
|
||||
package_name,
|
||||
)
|
||||
continue
|
||||
if not wheel.supported(supported_tags):
|
||||
# Built for a different python/arch/etc
|
||||
continue
|
||||
candidates.append(
|
||||
(
|
||||
wheel.support_index_min(supported_tags),
|
||||
wheel_name,
|
||||
wheel_dir,
|
||||
)
|
||||
)
|
||||
|
||||
if not candidates:
|
||||
return link
|
||||
|
||||
_, wheel_name, wheel_dir = min(candidates)
|
||||
return Link(path_to_url(os.path.join(wheel_dir, wheel_name)))
|
||||
|
||||
|
||||
class EphemWheelCache(SimpleWheelCache):
|
||||
"""A SimpleWheelCache that creates it's own temporary cache directory"""
|
||||
|
||||
def __init__(self, format_control: FormatControl) -> None:
|
||||
self._temp_dir = TempDirectory(
|
||||
kind=tempdir_kinds.EPHEM_WHEEL_CACHE,
|
||||
globally_managed=True,
|
||||
)
|
||||
|
||||
super().__init__(self._temp_dir.path, format_control)
|
||||
|
||||
|
||||
class CacheEntry:
|
||||
def __init__(
|
||||
self,
|
||||
link: Link,
|
||||
persistent: bool,
|
||||
):
|
||||
self.link = link
|
||||
self.persistent = persistent
|
||||
self.origin: Optional[DirectUrl] = None
|
||||
origin_direct_url_path = Path(self.link.file_path).parent / ORIGIN_JSON_NAME
|
||||
if origin_direct_url_path.exists():
|
||||
self.origin = DirectUrl.from_json(origin_direct_url_path.read_text())
|
||||
|
||||
|
||||
class WheelCache(Cache):
|
||||
"""Wraps EphemWheelCache and SimpleWheelCache into a single Cache
|
||||
|
||||
This Cache allows for gracefully degradation, using the ephem wheel cache
|
||||
when a certain link is not found in the simple wheel cache first.
|
||||
"""
|
||||
|
||||
def __init__(
|
||||
self, cache_dir: str, format_control: Optional[FormatControl] = None
|
||||
) -> None:
|
||||
if format_control is None:
|
||||
format_control = FormatControl()
|
||||
super().__init__(cache_dir, format_control, {"binary"})
|
||||
self._wheel_cache = SimpleWheelCache(cache_dir, format_control)
|
||||
self._ephem_cache = EphemWheelCache(format_control)
|
||||
|
||||
def get_path_for_link(self, link: Link) -> str:
|
||||
return self._wheel_cache.get_path_for_link(link)
|
||||
|
||||
def get_ephem_path_for_link(self, link: Link) -> str:
|
||||
return self._ephem_cache.get_path_for_link(link)
|
||||
|
||||
def get(
|
||||
self,
|
||||
link: Link,
|
||||
package_name: Optional[str],
|
||||
supported_tags: List[Tag],
|
||||
) -> Link:
|
||||
cache_entry = self.get_cache_entry(link, package_name, supported_tags)
|
||||
if cache_entry is None:
|
||||
return link
|
||||
return cache_entry.link
|
||||
|
||||
def get_cache_entry(
|
||||
self,
|
||||
link: Link,
|
||||
package_name: Optional[str],
|
||||
supported_tags: List[Tag],
|
||||
) -> Optional[CacheEntry]:
|
||||
"""Returns a CacheEntry with a link to a cached item if it exists or
|
||||
None. The cache entry indicates if the item was found in the persistent
|
||||
or ephemeral cache.
|
||||
"""
|
||||
retval = self._wheel_cache.get(
|
||||
link=link,
|
||||
package_name=package_name,
|
||||
supported_tags=supported_tags,
|
||||
)
|
||||
if retval is not link:
|
||||
return CacheEntry(retval, persistent=True)
|
||||
|
||||
retval = self._ephem_cache.get(
|
||||
link=link,
|
||||
package_name=package_name,
|
||||
supported_tags=supported_tags,
|
||||
)
|
||||
if retval is not link:
|
||||
return CacheEntry(retval, persistent=False)
|
||||
|
||||
return None
|
||||
|
||||
@staticmethod
|
||||
def record_download_origin(cache_dir: str, download_info: DirectUrl) -> None:
|
||||
origin_path = Path(cache_dir) / ORIGIN_JSON_NAME
|
||||
if origin_path.is_file():
|
||||
origin = DirectUrl.from_json(origin_path.read_text())
|
||||
# TODO: use DirectUrl.equivalent when https://github.com/pypa/pip/pull/10564
|
||||
# is merged.
|
||||
if origin.url != download_info.url:
|
||||
logger.warning(
|
||||
"Origin URL %s in cache entry %s does not match download URL %s. "
|
||||
"This is likely a pip bug or a cache corruption issue.",
|
||||
origin.url,
|
||||
cache_dir,
|
||||
download_info.url,
|
||||
)
|
||||
origin_path.write_text(download_info.to_json(), encoding="utf-8")
|
||||
@@ -0,0 +1,4 @@
|
||||
"""Subpackage containing all of pip's command line interface related code
|
||||
"""
|
||||
|
||||
# This file intentionally does not import submodules
|
||||
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
@@ -0,0 +1,171 @@
|
||||
"""Logic that powers autocompletion installed by ``pip completion``.
|
||||
"""
|
||||
|
||||
import optparse
|
||||
import os
|
||||
import sys
|
||||
from itertools import chain
|
||||
from typing import Any, Iterable, List, Optional
|
||||
|
||||
from pip._internal.cli.main_parser import create_main_parser
|
||||
from pip._internal.commands import commands_dict, create_command
|
||||
from pip._internal.metadata import get_default_environment
|
||||
|
||||
|
||||
def autocomplete() -> None:
|
||||
"""Entry Point for completion of main and subcommand options."""
|
||||
# Don't complete if user hasn't sourced bash_completion file.
|
||||
if "PIP_AUTO_COMPLETE" not in os.environ:
|
||||
return
|
||||
cwords = os.environ["COMP_WORDS"].split()[1:]
|
||||
cword = int(os.environ["COMP_CWORD"])
|
||||
try:
|
||||
current = cwords[cword - 1]
|
||||
except IndexError:
|
||||
current = ""
|
||||
|
||||
parser = create_main_parser()
|
||||
subcommands = list(commands_dict)
|
||||
options = []
|
||||
|
||||
# subcommand
|
||||
subcommand_name: Optional[str] = None
|
||||
for word in cwords:
|
||||
if word in subcommands:
|
||||
subcommand_name = word
|
||||
break
|
||||
# subcommand options
|
||||
if subcommand_name is not None:
|
||||
# special case: 'help' subcommand has no options
|
||||
if subcommand_name == "help":
|
||||
sys.exit(1)
|
||||
# special case: list locally installed dists for show and uninstall
|
||||
should_list_installed = not current.startswith("-") and subcommand_name in [
|
||||
"show",
|
||||
"uninstall",
|
||||
]
|
||||
if should_list_installed:
|
||||
env = get_default_environment()
|
||||
lc = current.lower()
|
||||
installed = [
|
||||
dist.canonical_name
|
||||
for dist in env.iter_installed_distributions(local_only=True)
|
||||
if dist.canonical_name.startswith(lc)
|
||||
and dist.canonical_name not in cwords[1:]
|
||||
]
|
||||
# if there are no dists installed, fall back to option completion
|
||||
if installed:
|
||||
for dist in installed:
|
||||
print(dist)
|
||||
sys.exit(1)
|
||||
|
||||
should_list_installables = (
|
||||
not current.startswith("-") and subcommand_name == "install"
|
||||
)
|
||||
if should_list_installables:
|
||||
for path in auto_complete_paths(current, "path"):
|
||||
print(path)
|
||||
sys.exit(1)
|
||||
|
||||
subcommand = create_command(subcommand_name)
|
||||
|
||||
for opt in subcommand.parser.option_list_all:
|
||||
if opt.help != optparse.SUPPRESS_HELP:
|
||||
for opt_str in opt._long_opts + opt._short_opts:
|
||||
options.append((opt_str, opt.nargs))
|
||||
|
||||
# filter out previously specified options from available options
|
||||
prev_opts = [x.split("=")[0] for x in cwords[1 : cword - 1]]
|
||||
options = [(x, v) for (x, v) in options if x not in prev_opts]
|
||||
# filter options by current input
|
||||
options = [(k, v) for k, v in options if k.startswith(current)]
|
||||
# get completion type given cwords and available subcommand options
|
||||
completion_type = get_path_completion_type(
|
||||
cwords,
|
||||
cword,
|
||||
subcommand.parser.option_list_all,
|
||||
)
|
||||
# get completion files and directories if ``completion_type`` is
|
||||
# ``<file>``, ``<dir>`` or ``<path>``
|
||||
if completion_type:
|
||||
paths = auto_complete_paths(current, completion_type)
|
||||
options = [(path, 0) for path in paths]
|
||||
for option in options:
|
||||
opt_label = option[0]
|
||||
# append '=' to options which require args
|
||||
if option[1] and option[0][:2] == "--":
|
||||
opt_label += "="
|
||||
print(opt_label)
|
||||
else:
|
||||
# show main parser options only when necessary
|
||||
|
||||
opts = [i.option_list for i in parser.option_groups]
|
||||
opts.append(parser.option_list)
|
||||
flattened_opts = chain.from_iterable(opts)
|
||||
if current.startswith("-"):
|
||||
for opt in flattened_opts:
|
||||
if opt.help != optparse.SUPPRESS_HELP:
|
||||
subcommands += opt._long_opts + opt._short_opts
|
||||
else:
|
||||
# get completion type given cwords and all available options
|
||||
completion_type = get_path_completion_type(cwords, cword, flattened_opts)
|
||||
if completion_type:
|
||||
subcommands = list(auto_complete_paths(current, completion_type))
|
||||
|
||||
print(" ".join([x for x in subcommands if x.startswith(current)]))
|
||||
sys.exit(1)
|
||||
|
||||
|
||||
def get_path_completion_type(
|
||||
cwords: List[str], cword: int, opts: Iterable[Any]
|
||||
) -> Optional[str]:
|
||||
"""Get the type of path completion (``file``, ``dir``, ``path`` or None)
|
||||
|
||||
:param cwords: same as the environmental variable ``COMP_WORDS``
|
||||
:param cword: same as the environmental variable ``COMP_CWORD``
|
||||
:param opts: The available options to check
|
||||
:return: path completion type (``file``, ``dir``, ``path`` or None)
|
||||
"""
|
||||
if cword < 2 or not cwords[cword - 2].startswith("-"):
|
||||
return None
|
||||
for opt in opts:
|
||||
if opt.help == optparse.SUPPRESS_HELP:
|
||||
continue
|
||||
for o in str(opt).split("/"):
|
||||
if cwords[cword - 2].split("=")[0] == o:
|
||||
if not opt.metavar or any(
|
||||
x in ("path", "file", "dir") for x in opt.metavar.split("/")
|
||||
):
|
||||
return opt.metavar
|
||||
return None
|
||||
|
||||
|
||||
def auto_complete_paths(current: str, completion_type: str) -> Iterable[str]:
|
||||
"""If ``completion_type`` is ``file`` or ``path``, list all regular files
|
||||
and directories starting with ``current``; otherwise only list directories
|
||||
starting with ``current``.
|
||||
|
||||
:param current: The word to be completed
|
||||
:param completion_type: path completion type(``file``, ``path`` or ``dir``)
|
||||
:return: A generator of regular files and/or directories
|
||||
"""
|
||||
directory, filename = os.path.split(current)
|
||||
current_path = os.path.abspath(directory)
|
||||
# Don't complete paths if they can't be accessed
|
||||
if not os.access(current_path, os.R_OK):
|
||||
return
|
||||
filename = os.path.normcase(filename)
|
||||
# list all files that start with ``filename``
|
||||
file_list = (
|
||||
x for x in os.listdir(current_path) if os.path.normcase(x).startswith(filename)
|
||||
)
|
||||
for f in file_list:
|
||||
opt = os.path.join(current_path, f)
|
||||
comp_file = os.path.normcase(os.path.join(directory, f))
|
||||
# complete regular files when there is not ``<dir>`` after option
|
||||
# complete directories when there is ``<file>``, ``<path>`` or
|
||||
# ``<dir>``after option
|
||||
if completion_type != "dir" and os.path.isfile(opt):
|
||||
yield comp_file
|
||||
elif os.path.isdir(opt):
|
||||
yield os.path.join(comp_file, "")
|
||||
@@ -0,0 +1,216 @@
|
||||
"""Base Command class, and related routines"""
|
||||
|
||||
import functools
|
||||
import logging
|
||||
import logging.config
|
||||
import optparse
|
||||
import os
|
||||
import sys
|
||||
import traceback
|
||||
from optparse import Values
|
||||
from typing import Any, Callable, List, Optional, Tuple
|
||||
|
||||
from pip._vendor.rich import traceback as rich_traceback
|
||||
|
||||
from pip._internal.cli import cmdoptions
|
||||
from pip._internal.cli.command_context import CommandContextMixIn
|
||||
from pip._internal.cli.parser import ConfigOptionParser, UpdatingDefaultsHelpFormatter
|
||||
from pip._internal.cli.status_codes import (
|
||||
ERROR,
|
||||
PREVIOUS_BUILD_DIR_ERROR,
|
||||
UNKNOWN_ERROR,
|
||||
VIRTUALENV_NOT_FOUND,
|
||||
)
|
||||
from pip._internal.exceptions import (
|
||||
BadCommand,
|
||||
CommandError,
|
||||
DiagnosticPipError,
|
||||
InstallationError,
|
||||
NetworkConnectionError,
|
||||
PreviousBuildDirError,
|
||||
UninstallationError,
|
||||
)
|
||||
from pip._internal.utils.filesystem import check_path_owner
|
||||
from pip._internal.utils.logging import BrokenStdoutLoggingError, setup_logging
|
||||
from pip._internal.utils.misc import get_prog, normalize_path
|
||||
from pip._internal.utils.temp_dir import TempDirectoryTypeRegistry as TempDirRegistry
|
||||
from pip._internal.utils.temp_dir import global_tempdir_manager, tempdir_registry
|
||||
from pip._internal.utils.virtualenv import running_under_virtualenv
|
||||
|
||||
__all__ = ["Command"]
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
class Command(CommandContextMixIn):
|
||||
usage: str = ""
|
||||
ignore_require_venv: bool = False
|
||||
|
||||
def __init__(self, name: str, summary: str, isolated: bool = False) -> None:
|
||||
super().__init__()
|
||||
|
||||
self.name = name
|
||||
self.summary = summary
|
||||
self.parser = ConfigOptionParser(
|
||||
usage=self.usage,
|
||||
prog=f"{get_prog()} {name}",
|
||||
formatter=UpdatingDefaultsHelpFormatter(),
|
||||
add_help_option=False,
|
||||
name=name,
|
||||
description=self.__doc__,
|
||||
isolated=isolated,
|
||||
)
|
||||
|
||||
self.tempdir_registry: Optional[TempDirRegistry] = None
|
||||
|
||||
# Commands should add options to this option group
|
||||
optgroup_name = f"{self.name.capitalize()} Options"
|
||||
self.cmd_opts = optparse.OptionGroup(self.parser, optgroup_name)
|
||||
|
||||
# Add the general options
|
||||
gen_opts = cmdoptions.make_option_group(
|
||||
cmdoptions.general_group,
|
||||
self.parser,
|
||||
)
|
||||
self.parser.add_option_group(gen_opts)
|
||||
|
||||
self.add_options()
|
||||
|
||||
def add_options(self) -> None:
|
||||
pass
|
||||
|
||||
def handle_pip_version_check(self, options: Values) -> None:
|
||||
"""
|
||||
This is a no-op so that commands by default do not do the pip version
|
||||
check.
|
||||
"""
|
||||
# Make sure we do the pip version check if the index_group options
|
||||
# are present.
|
||||
assert not hasattr(options, "no_index")
|
||||
|
||||
def run(self, options: Values, args: List[str]) -> int:
|
||||
raise NotImplementedError
|
||||
|
||||
def parse_args(self, args: List[str]) -> Tuple[Values, List[str]]:
|
||||
# factored out for testability
|
||||
return self.parser.parse_args(args)
|
||||
|
||||
def main(self, args: List[str]) -> int:
|
||||
try:
|
||||
with self.main_context():
|
||||
return self._main(args)
|
||||
finally:
|
||||
logging.shutdown()
|
||||
|
||||
def _main(self, args: List[str]) -> int:
|
||||
# We must initialize this before the tempdir manager, otherwise the
|
||||
# configuration would not be accessible by the time we clean up the
|
||||
# tempdir manager.
|
||||
self.tempdir_registry = self.enter_context(tempdir_registry())
|
||||
# Intentionally set as early as possible so globally-managed temporary
|
||||
# directories are available to the rest of the code.
|
||||
self.enter_context(global_tempdir_manager())
|
||||
|
||||
options, args = self.parse_args(args)
|
||||
|
||||
# Set verbosity so that it can be used elsewhere.
|
||||
self.verbosity = options.verbose - options.quiet
|
||||
|
||||
level_number = setup_logging(
|
||||
verbosity=self.verbosity,
|
||||
no_color=options.no_color,
|
||||
user_log_file=options.log,
|
||||
)
|
||||
|
||||
# TODO: Try to get these passing down from the command?
|
||||
# without resorting to os.environ to hold these.
|
||||
# This also affects isolated builds and it should.
|
||||
|
||||
if options.no_input:
|
||||
os.environ["PIP_NO_INPUT"] = "1"
|
||||
|
||||
if options.exists_action:
|
||||
os.environ["PIP_EXISTS_ACTION"] = " ".join(options.exists_action)
|
||||
|
||||
if options.require_venv and not self.ignore_require_venv:
|
||||
# If a venv is required check if it can really be found
|
||||
if not running_under_virtualenv():
|
||||
logger.critical("Could not find an activated virtualenv (required).")
|
||||
sys.exit(VIRTUALENV_NOT_FOUND)
|
||||
|
||||
if options.cache_dir:
|
||||
options.cache_dir = normalize_path(options.cache_dir)
|
||||
if not check_path_owner(options.cache_dir):
|
||||
logger.warning(
|
||||
"The directory '%s' or its parent directory is not owned "
|
||||
"or is not writable by the current user. The cache "
|
||||
"has been disabled. Check the permissions and owner of "
|
||||
"that directory. If executing pip with sudo, you should "
|
||||
"use sudo's -H flag.",
|
||||
options.cache_dir,
|
||||
)
|
||||
options.cache_dir = None
|
||||
|
||||
def intercepts_unhandled_exc(
|
||||
run_func: Callable[..., int]
|
||||
) -> Callable[..., int]:
|
||||
@functools.wraps(run_func)
|
||||
def exc_logging_wrapper(*args: Any) -> int:
|
||||
try:
|
||||
status = run_func(*args)
|
||||
assert isinstance(status, int)
|
||||
return status
|
||||
except DiagnosticPipError as exc:
|
||||
logger.error("[present-rich] %s", exc)
|
||||
logger.debug("Exception information:", exc_info=True)
|
||||
|
||||
return ERROR
|
||||
except PreviousBuildDirError as exc:
|
||||
logger.critical(str(exc))
|
||||
logger.debug("Exception information:", exc_info=True)
|
||||
|
||||
return PREVIOUS_BUILD_DIR_ERROR
|
||||
except (
|
||||
InstallationError,
|
||||
UninstallationError,
|
||||
BadCommand,
|
||||
NetworkConnectionError,
|
||||
) as exc:
|
||||
logger.critical(str(exc))
|
||||
logger.debug("Exception information:", exc_info=True)
|
||||
|
||||
return ERROR
|
||||
except CommandError as exc:
|
||||
logger.critical("%s", exc)
|
||||
logger.debug("Exception information:", exc_info=True)
|
||||
|
||||
return ERROR
|
||||
except BrokenStdoutLoggingError:
|
||||
# Bypass our logger and write any remaining messages to
|
||||
# stderr because stdout no longer works.
|
||||
print("ERROR: Pipe to stdout was broken", file=sys.stderr)
|
||||
if level_number <= logging.DEBUG:
|
||||
traceback.print_exc(file=sys.stderr)
|
||||
|
||||
return ERROR
|
||||
except KeyboardInterrupt:
|
||||
logger.critical("Operation cancelled by user")
|
||||
logger.debug("Exception information:", exc_info=True)
|
||||
|
||||
return ERROR
|
||||
except BaseException:
|
||||
logger.critical("Exception:", exc_info=True)
|
||||
|
||||
return UNKNOWN_ERROR
|
||||
|
||||
return exc_logging_wrapper
|
||||
|
||||
try:
|
||||
if not options.debug_mode:
|
||||
run = intercepts_unhandled_exc(self.run)
|
||||
else:
|
||||
run = self.run
|
||||
rich_traceback.install(show_locals=True)
|
||||
return run(options, args)
|
||||
finally:
|
||||
self.handle_pip_version_check(options)
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,27 @@
|
||||
from contextlib import ExitStack, contextmanager
|
||||
from typing import ContextManager, Generator, TypeVar
|
||||
|
||||
_T = TypeVar("_T", covariant=True)
|
||||
|
||||
|
||||
class CommandContextMixIn:
|
||||
def __init__(self) -> None:
|
||||
super().__init__()
|
||||
self._in_main_context = False
|
||||
self._main_context = ExitStack()
|
||||
|
||||
@contextmanager
|
||||
def main_context(self) -> Generator[None, None, None]:
|
||||
assert not self._in_main_context
|
||||
|
||||
self._in_main_context = True
|
||||
try:
|
||||
with self._main_context:
|
||||
yield
|
||||
finally:
|
||||
self._in_main_context = False
|
||||
|
||||
def enter_context(self, context_provider: ContextManager[_T]) -> _T:
|
||||
assert self._in_main_context
|
||||
|
||||
return self._main_context.enter_context(context_provider)
|
||||
@@ -0,0 +1,70 @@
|
||||
"""Primary application entrypoint.
|
||||
"""
|
||||
import locale
|
||||
import logging
|
||||
import os
|
||||
import sys
|
||||
from typing import List, Optional
|
||||
|
||||
from pip._internal.cli.autocompletion import autocomplete
|
||||
from pip._internal.cli.main_parser import parse_command
|
||||
from pip._internal.commands import create_command
|
||||
from pip._internal.exceptions import PipError
|
||||
from pip._internal.utils import deprecation
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
# Do not import and use main() directly! Using it directly is actively
|
||||
# discouraged by pip's maintainers. The name, location and behavior of
|
||||
# this function is subject to change, so calling it directly is not
|
||||
# portable across different pip versions.
|
||||
|
||||
# In addition, running pip in-process is unsupported and unsafe. This is
|
||||
# elaborated in detail at
|
||||
# https://pip.pypa.io/en/stable/user_guide/#using-pip-from-your-program.
|
||||
# That document also provides suggestions that should work for nearly
|
||||
# all users that are considering importing and using main() directly.
|
||||
|
||||
# However, we know that certain users will still want to invoke pip
|
||||
# in-process. If you understand and accept the implications of using pip
|
||||
# in an unsupported manner, the best approach is to use runpy to avoid
|
||||
# depending on the exact location of this entry point.
|
||||
|
||||
# The following example shows how to use runpy to invoke pip in that
|
||||
# case:
|
||||
#
|
||||
# sys.argv = ["pip", your, args, here]
|
||||
# runpy.run_module("pip", run_name="__main__")
|
||||
#
|
||||
# Note that this will exit the process after running, unlike a direct
|
||||
# call to main. As it is not safe to do any processing after calling
|
||||
# main, this should not be an issue in practice.
|
||||
|
||||
|
||||
def main(args: Optional[List[str]] = None) -> int:
|
||||
if args is None:
|
||||
args = sys.argv[1:]
|
||||
|
||||
# Configure our deprecation warnings to be sent through loggers
|
||||
deprecation.install_warning_logger()
|
||||
|
||||
autocomplete()
|
||||
|
||||
try:
|
||||
cmd_name, cmd_args = parse_command(args)
|
||||
except PipError as exc:
|
||||
sys.stderr.write(f"ERROR: {exc}")
|
||||
sys.stderr.write(os.linesep)
|
||||
sys.exit(1)
|
||||
|
||||
# Needed for locale.getpreferredencoding(False) to work
|
||||
# in pip._internal.utils.encoding.auto_decode
|
||||
try:
|
||||
locale.setlocale(locale.LC_ALL, "")
|
||||
except locale.Error as e:
|
||||
# setlocale can apparently crash if locale are uninitialized
|
||||
logger.debug("Ignoring error %s when setting locale", e)
|
||||
command = create_command(cmd_name, isolated=("--isolated" in cmd_args))
|
||||
|
||||
return command.main(cmd_args)
|
||||
@@ -0,0 +1,134 @@
|
||||
"""A single place for constructing and exposing the main parser
|
||||
"""
|
||||
|
||||
import os
|
||||
import subprocess
|
||||
import sys
|
||||
from typing import List, Optional, Tuple
|
||||
|
||||
from pip._internal.build_env import get_runnable_pip
|
||||
from pip._internal.cli import cmdoptions
|
||||
from pip._internal.cli.parser import ConfigOptionParser, UpdatingDefaultsHelpFormatter
|
||||
from pip._internal.commands import commands_dict, get_similar_commands
|
||||
from pip._internal.exceptions import CommandError
|
||||
from pip._internal.utils.misc import get_pip_version, get_prog
|
||||
|
||||
__all__ = ["create_main_parser", "parse_command"]
|
||||
|
||||
|
||||
def create_main_parser() -> ConfigOptionParser:
|
||||
"""Creates and returns the main parser for pip's CLI"""
|
||||
|
||||
parser = ConfigOptionParser(
|
||||
usage="\n%prog <command> [options]",
|
||||
add_help_option=False,
|
||||
formatter=UpdatingDefaultsHelpFormatter(),
|
||||
name="global",
|
||||
prog=get_prog(),
|
||||
)
|
||||
parser.disable_interspersed_args()
|
||||
|
||||
parser.version = get_pip_version()
|
||||
|
||||
# add the general options
|
||||
gen_opts = cmdoptions.make_option_group(cmdoptions.general_group, parser)
|
||||
parser.add_option_group(gen_opts)
|
||||
|
||||
# so the help formatter knows
|
||||
parser.main = True # type: ignore
|
||||
|
||||
# create command listing for description
|
||||
description = [""] + [
|
||||
f"{name:27} {command_info.summary}"
|
||||
for name, command_info in commands_dict.items()
|
||||
]
|
||||
parser.description = "\n".join(description)
|
||||
|
||||
return parser
|
||||
|
||||
|
||||
def identify_python_interpreter(python: str) -> Optional[str]:
|
||||
# If the named file exists, use it.
|
||||
# If it's a directory, assume it's a virtual environment and
|
||||
# look for the environment's Python executable.
|
||||
if os.path.exists(python):
|
||||
if os.path.isdir(python):
|
||||
# bin/python for Unix, Scripts/python.exe for Windows
|
||||
# Try both in case of odd cases like cygwin.
|
||||
for exe in ("bin/python", "Scripts/python.exe"):
|
||||
py = os.path.join(python, exe)
|
||||
if os.path.exists(py):
|
||||
return py
|
||||
else:
|
||||
return python
|
||||
|
||||
# Could not find the interpreter specified
|
||||
return None
|
||||
|
||||
|
||||
def parse_command(args: List[str]) -> Tuple[str, List[str]]:
|
||||
parser = create_main_parser()
|
||||
|
||||
# Note: parser calls disable_interspersed_args(), so the result of this
|
||||
# call is to split the initial args into the general options before the
|
||||
# subcommand and everything else.
|
||||
# For example:
|
||||
# args: ['--timeout=5', 'install', '--user', 'INITools']
|
||||
# general_options: ['--timeout==5']
|
||||
# args_else: ['install', '--user', 'INITools']
|
||||
general_options, args_else = parser.parse_args(args)
|
||||
|
||||
# --python
|
||||
if general_options.python and "_PIP_RUNNING_IN_SUBPROCESS" not in os.environ:
|
||||
# Re-invoke pip using the specified Python interpreter
|
||||
interpreter = identify_python_interpreter(general_options.python)
|
||||
if interpreter is None:
|
||||
raise CommandError(
|
||||
f"Could not locate Python interpreter {general_options.python}"
|
||||
)
|
||||
|
||||
pip_cmd = [
|
||||
interpreter,
|
||||
get_runnable_pip(),
|
||||
]
|
||||
pip_cmd.extend(args)
|
||||
|
||||
# Set a flag so the child doesn't re-invoke itself, causing
|
||||
# an infinite loop.
|
||||
os.environ["_PIP_RUNNING_IN_SUBPROCESS"] = "1"
|
||||
returncode = 0
|
||||
try:
|
||||
proc = subprocess.run(pip_cmd)
|
||||
returncode = proc.returncode
|
||||
except (subprocess.SubprocessError, OSError) as exc:
|
||||
raise CommandError(f"Failed to run pip under {interpreter}: {exc}")
|
||||
sys.exit(returncode)
|
||||
|
||||
# --version
|
||||
if general_options.version:
|
||||
sys.stdout.write(parser.version)
|
||||
sys.stdout.write(os.linesep)
|
||||
sys.exit()
|
||||
|
||||
# pip || pip help -> print_help()
|
||||
if not args_else or (args_else[0] == "help" and len(args_else) == 1):
|
||||
parser.print_help()
|
||||
sys.exit()
|
||||
|
||||
# the subcommand name
|
||||
cmd_name = args_else[0]
|
||||
|
||||
if cmd_name not in commands_dict:
|
||||
guess = get_similar_commands(cmd_name)
|
||||
|
||||
msg = [f'unknown command "{cmd_name}"']
|
||||
if guess:
|
||||
msg.append(f'maybe you meant "{guess}"')
|
||||
|
||||
raise CommandError(" - ".join(msg))
|
||||
|
||||
# all the args without the subcommand
|
||||
cmd_args = args[:]
|
||||
cmd_args.remove(cmd_name)
|
||||
|
||||
return cmd_name, cmd_args
|
||||
@@ -0,0 +1,294 @@
|
||||
"""Base option parser setup"""
|
||||
|
||||
import logging
|
||||
import optparse
|
||||
import shutil
|
||||
import sys
|
||||
import textwrap
|
||||
from contextlib import suppress
|
||||
from typing import Any, Dict, Generator, List, Tuple
|
||||
|
||||
from pip._internal.cli.status_codes import UNKNOWN_ERROR
|
||||
from pip._internal.configuration import Configuration, ConfigurationError
|
||||
from pip._internal.utils.misc import redact_auth_from_url, strtobool
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
class PrettyHelpFormatter(optparse.IndentedHelpFormatter):
|
||||
"""A prettier/less verbose help formatter for optparse."""
|
||||
|
||||
def __init__(self, *args: Any, **kwargs: Any) -> None:
|
||||
# help position must be aligned with __init__.parseopts.description
|
||||
kwargs["max_help_position"] = 30
|
||||
kwargs["indent_increment"] = 1
|
||||
kwargs["width"] = shutil.get_terminal_size()[0] - 2
|
||||
super().__init__(*args, **kwargs)
|
||||
|
||||
def format_option_strings(self, option: optparse.Option) -> str:
|
||||
return self._format_option_strings(option)
|
||||
|
||||
def _format_option_strings(
|
||||
self, option: optparse.Option, mvarfmt: str = " <{}>", optsep: str = ", "
|
||||
) -> str:
|
||||
"""
|
||||
Return a comma-separated list of option strings and metavars.
|
||||
|
||||
:param option: tuple of (short opt, long opt), e.g: ('-f', '--format')
|
||||
:param mvarfmt: metavar format string
|
||||
:param optsep: separator
|
||||
"""
|
||||
opts = []
|
||||
|
||||
if option._short_opts:
|
||||
opts.append(option._short_opts[0])
|
||||
if option._long_opts:
|
||||
opts.append(option._long_opts[0])
|
||||
if len(opts) > 1:
|
||||
opts.insert(1, optsep)
|
||||
|
||||
if option.takes_value():
|
||||
assert option.dest is not None
|
||||
metavar = option.metavar or option.dest.lower()
|
||||
opts.append(mvarfmt.format(metavar.lower()))
|
||||
|
||||
return "".join(opts)
|
||||
|
||||
def format_heading(self, heading: str) -> str:
|
||||
if heading == "Options":
|
||||
return ""
|
||||
return heading + ":\n"
|
||||
|
||||
def format_usage(self, usage: str) -> str:
|
||||
"""
|
||||
Ensure there is only one newline between usage and the first heading
|
||||
if there is no description.
|
||||
"""
|
||||
msg = "\nUsage: {}\n".format(self.indent_lines(textwrap.dedent(usage), " "))
|
||||
return msg
|
||||
|
||||
def format_description(self, description: str) -> str:
|
||||
# leave full control over description to us
|
||||
if description:
|
||||
if hasattr(self.parser, "main"):
|
||||
label = "Commands"
|
||||
else:
|
||||
label = "Description"
|
||||
# some doc strings have initial newlines, some don't
|
||||
description = description.lstrip("\n")
|
||||
# some doc strings have final newlines and spaces, some don't
|
||||
description = description.rstrip()
|
||||
# dedent, then reindent
|
||||
description = self.indent_lines(textwrap.dedent(description), " ")
|
||||
description = f"{label}:\n{description}\n"
|
||||
return description
|
||||
else:
|
||||
return ""
|
||||
|
||||
def format_epilog(self, epilog: str) -> str:
|
||||
# leave full control over epilog to us
|
||||
if epilog:
|
||||
return epilog
|
||||
else:
|
||||
return ""
|
||||
|
||||
def indent_lines(self, text: str, indent: str) -> str:
|
||||
new_lines = [indent + line for line in text.split("\n")]
|
||||
return "\n".join(new_lines)
|
||||
|
||||
|
||||
class UpdatingDefaultsHelpFormatter(PrettyHelpFormatter):
|
||||
"""Custom help formatter for use in ConfigOptionParser.
|
||||
|
||||
This is updates the defaults before expanding them, allowing
|
||||
them to show up correctly in the help listing.
|
||||
|
||||
Also redact auth from url type options
|
||||
"""
|
||||
|
||||
def expand_default(self, option: optparse.Option) -> str:
|
||||
default_values = None
|
||||
if self.parser is not None:
|
||||
assert isinstance(self.parser, ConfigOptionParser)
|
||||
self.parser._update_defaults(self.parser.defaults)
|
||||
assert option.dest is not None
|
||||
default_values = self.parser.defaults.get(option.dest)
|
||||
help_text = super().expand_default(option)
|
||||
|
||||
if default_values and option.metavar == "URL":
|
||||
if isinstance(default_values, str):
|
||||
default_values = [default_values]
|
||||
|
||||
# If its not a list, we should abort and just return the help text
|
||||
if not isinstance(default_values, list):
|
||||
default_values = []
|
||||
|
||||
for val in default_values:
|
||||
help_text = help_text.replace(val, redact_auth_from_url(val))
|
||||
|
||||
return help_text
|
||||
|
||||
|
||||
class CustomOptionParser(optparse.OptionParser):
|
||||
def insert_option_group(
|
||||
self, idx: int, *args: Any, **kwargs: Any
|
||||
) -> optparse.OptionGroup:
|
||||
"""Insert an OptionGroup at a given position."""
|
||||
group = self.add_option_group(*args, **kwargs)
|
||||
|
||||
self.option_groups.pop()
|
||||
self.option_groups.insert(idx, group)
|
||||
|
||||
return group
|
||||
|
||||
@property
|
||||
def option_list_all(self) -> List[optparse.Option]:
|
||||
"""Get a list of all options, including those in option groups."""
|
||||
res = self.option_list[:]
|
||||
for i in self.option_groups:
|
||||
res.extend(i.option_list)
|
||||
|
||||
return res
|
||||
|
||||
|
||||
class ConfigOptionParser(CustomOptionParser):
|
||||
"""Custom option parser which updates its defaults by checking the
|
||||
configuration files and environmental variables"""
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
*args: Any,
|
||||
name: str,
|
||||
isolated: bool = False,
|
||||
**kwargs: Any,
|
||||
) -> None:
|
||||
self.name = name
|
||||
self.config = Configuration(isolated)
|
||||
|
||||
assert self.name
|
||||
super().__init__(*args, **kwargs)
|
||||
|
||||
def check_default(self, option: optparse.Option, key: str, val: Any) -> Any:
|
||||
try:
|
||||
return option.check_value(key, val)
|
||||
except optparse.OptionValueError as exc:
|
||||
print(f"An error occurred during configuration: {exc}")
|
||||
sys.exit(3)
|
||||
|
||||
def _get_ordered_configuration_items(
|
||||
self,
|
||||
) -> Generator[Tuple[str, Any], None, None]:
|
||||
# Configuration gives keys in an unordered manner. Order them.
|
||||
override_order = ["global", self.name, ":env:"]
|
||||
|
||||
# Pool the options into different groups
|
||||
section_items: Dict[str, List[Tuple[str, Any]]] = {
|
||||
name: [] for name in override_order
|
||||
}
|
||||
for section_key, val in self.config.items():
|
||||
# ignore empty values
|
||||
if not val:
|
||||
logger.debug(
|
||||
"Ignoring configuration key '%s' as it's value is empty.",
|
||||
section_key,
|
||||
)
|
||||
continue
|
||||
|
||||
section, key = section_key.split(".", 1)
|
||||
if section in override_order:
|
||||
section_items[section].append((key, val))
|
||||
|
||||
# Yield each group in their override order
|
||||
for section in override_order:
|
||||
for key, val in section_items[section]:
|
||||
yield key, val
|
||||
|
||||
def _update_defaults(self, defaults: Dict[str, Any]) -> Dict[str, Any]:
|
||||
"""Updates the given defaults with values from the config files and
|
||||
the environ. Does a little special handling for certain types of
|
||||
options (lists)."""
|
||||
|
||||
# Accumulate complex default state.
|
||||
self.values = optparse.Values(self.defaults)
|
||||
late_eval = set()
|
||||
# Then set the options with those values
|
||||
for key, val in self._get_ordered_configuration_items():
|
||||
# '--' because configuration supports only long names
|
||||
option = self.get_option("--" + key)
|
||||
|
||||
# Ignore options not present in this parser. E.g. non-globals put
|
||||
# in [global] by users that want them to apply to all applicable
|
||||
# commands.
|
||||
if option is None:
|
||||
continue
|
||||
|
||||
assert option.dest is not None
|
||||
|
||||
if option.action in ("store_true", "store_false"):
|
||||
try:
|
||||
val = strtobool(val)
|
||||
except ValueError:
|
||||
self.error(
|
||||
"{} is not a valid value for {} option, " # noqa
|
||||
"please specify a boolean value like yes/no, "
|
||||
"true/false or 1/0 instead.".format(val, key)
|
||||
)
|
||||
elif option.action == "count":
|
||||
with suppress(ValueError):
|
||||
val = strtobool(val)
|
||||
with suppress(ValueError):
|
||||
val = int(val)
|
||||
if not isinstance(val, int) or val < 0:
|
||||
self.error(
|
||||
"{} is not a valid value for {} option, " # noqa
|
||||
"please instead specify either a non-negative integer "
|
||||
"or a boolean value like yes/no or false/true "
|
||||
"which is equivalent to 1/0.".format(val, key)
|
||||
)
|
||||
elif option.action == "append":
|
||||
val = val.split()
|
||||
val = [self.check_default(option, key, v) for v in val]
|
||||
elif option.action == "callback":
|
||||
assert option.callback is not None
|
||||
late_eval.add(option.dest)
|
||||
opt_str = option.get_opt_string()
|
||||
val = option.convert_value(opt_str, val)
|
||||
# From take_action
|
||||
args = option.callback_args or ()
|
||||
kwargs = option.callback_kwargs or {}
|
||||
option.callback(option, opt_str, val, self, *args, **kwargs)
|
||||
else:
|
||||
val = self.check_default(option, key, val)
|
||||
|
||||
defaults[option.dest] = val
|
||||
|
||||
for key in late_eval:
|
||||
defaults[key] = getattr(self.values, key)
|
||||
self.values = None
|
||||
return defaults
|
||||
|
||||
def get_default_values(self) -> optparse.Values:
|
||||
"""Overriding to make updating the defaults after instantiation of
|
||||
the option parser possible, _update_defaults() does the dirty work."""
|
||||
if not self.process_default_values:
|
||||
# Old, pre-Optik 1.5 behaviour.
|
||||
return optparse.Values(self.defaults)
|
||||
|
||||
# Load the configuration, or error out in case of an error
|
||||
try:
|
||||
self.config.load()
|
||||
except ConfigurationError as err:
|
||||
self.exit(UNKNOWN_ERROR, str(err))
|
||||
|
||||
defaults = self._update_defaults(self.defaults.copy()) # ours
|
||||
for option in self._get_all_options():
|
||||
assert option.dest is not None
|
||||
default = defaults.get(option.dest)
|
||||
if isinstance(default, str):
|
||||
opt_str = option.get_opt_string()
|
||||
defaults[option.dest] = option.check_value(opt_str, default)
|
||||
return optparse.Values(defaults)
|
||||
|
||||
def error(self, msg: str) -> None:
|
||||
self.print_usage(sys.stderr)
|
||||
self.exit(UNKNOWN_ERROR, f"{msg}\n")
|
||||
@@ -0,0 +1,68 @@
|
||||
import functools
|
||||
from typing import Callable, Generator, Iterable, Iterator, Optional, Tuple
|
||||
|
||||
from pip._vendor.rich.progress import (
|
||||
BarColumn,
|
||||
DownloadColumn,
|
||||
FileSizeColumn,
|
||||
Progress,
|
||||
ProgressColumn,
|
||||
SpinnerColumn,
|
||||
TextColumn,
|
||||
TimeElapsedColumn,
|
||||
TimeRemainingColumn,
|
||||
TransferSpeedColumn,
|
||||
)
|
||||
|
||||
from pip._internal.utils.logging import get_indentation
|
||||
|
||||
DownloadProgressRenderer = Callable[[Iterable[bytes]], Iterator[bytes]]
|
||||
|
||||
|
||||
def _rich_progress_bar(
|
||||
iterable: Iterable[bytes],
|
||||
*,
|
||||
bar_type: str,
|
||||
size: int,
|
||||
) -> Generator[bytes, None, None]:
|
||||
assert bar_type == "on", "This should only be used in the default mode."
|
||||
|
||||
if not size:
|
||||
total = float("inf")
|
||||
columns: Tuple[ProgressColumn, ...] = (
|
||||
TextColumn("[progress.description]{task.description}"),
|
||||
SpinnerColumn("line", speed=1.5),
|
||||
FileSizeColumn(),
|
||||
TransferSpeedColumn(),
|
||||
TimeElapsedColumn(),
|
||||
)
|
||||
else:
|
||||
total = size
|
||||
columns = (
|
||||
TextColumn("[progress.description]{task.description}"),
|
||||
BarColumn(),
|
||||
DownloadColumn(),
|
||||
TransferSpeedColumn(),
|
||||
TextColumn("eta"),
|
||||
TimeRemainingColumn(),
|
||||
)
|
||||
|
||||
progress = Progress(*columns, refresh_per_second=30)
|
||||
task_id = progress.add_task(" " * (get_indentation() + 2), total=total)
|
||||
with progress:
|
||||
for chunk in iterable:
|
||||
yield chunk
|
||||
progress.update(task_id, advance=len(chunk))
|
||||
|
||||
|
||||
def get_download_progress_renderer(
|
||||
*, bar_type: str, size: Optional[int] = None
|
||||
) -> DownloadProgressRenderer:
|
||||
"""Get an object that can be used to render the download progress.
|
||||
|
||||
Returns a callable, that takes an iterable to "wrap".
|
||||
"""
|
||||
if bar_type == "on":
|
||||
return functools.partial(_rich_progress_bar, bar_type=bar_type, size=size)
|
||||
else:
|
||||
return iter # no-op, when passed an iterator
|
||||
@@ -0,0 +1,502 @@
|
||||
"""Contains the Command base classes that depend on PipSession.
|
||||
|
||||
The classes in this module are in a separate module so the commands not
|
||||
needing download / PackageFinder capability don't unnecessarily import the
|
||||
PackageFinder machinery and all its vendored dependencies, etc.
|
||||
"""
|
||||
|
||||
import logging
|
||||
import os
|
||||
import sys
|
||||
from functools import partial
|
||||
from optparse import Values
|
||||
from typing import TYPE_CHECKING, Any, List, Optional, Tuple
|
||||
|
||||
from pip._internal.cache import WheelCache
|
||||
from pip._internal.cli import cmdoptions
|
||||
from pip._internal.cli.base_command import Command
|
||||
from pip._internal.cli.command_context import CommandContextMixIn
|
||||
from pip._internal.exceptions import CommandError, PreviousBuildDirError
|
||||
from pip._internal.index.collector import LinkCollector
|
||||
from pip._internal.index.package_finder import PackageFinder
|
||||
from pip._internal.models.selection_prefs import SelectionPreferences
|
||||
from pip._internal.models.target_python import TargetPython
|
||||
from pip._internal.network.session import PipSession
|
||||
from pip._internal.operations.build.build_tracker import BuildTracker
|
||||
from pip._internal.operations.prepare import RequirementPreparer
|
||||
from pip._internal.req.constructors import (
|
||||
install_req_from_editable,
|
||||
install_req_from_line,
|
||||
install_req_from_parsed_requirement,
|
||||
install_req_from_req_string,
|
||||
)
|
||||
from pip._internal.req.req_file import parse_requirements
|
||||
from pip._internal.req.req_install import InstallRequirement
|
||||
from pip._internal.resolution.base import BaseResolver
|
||||
from pip._internal.self_outdated_check import pip_self_version_check
|
||||
from pip._internal.utils.temp_dir import (
|
||||
TempDirectory,
|
||||
TempDirectoryTypeRegistry,
|
||||
tempdir_kinds,
|
||||
)
|
||||
from pip._internal.utils.virtualenv import running_under_virtualenv
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from ssl import SSLContext
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
def _create_truststore_ssl_context() -> Optional["SSLContext"]:
|
||||
if sys.version_info < (3, 10):
|
||||
raise CommandError("The truststore feature is only available for Python 3.10+")
|
||||
|
||||
try:
|
||||
import ssl
|
||||
except ImportError:
|
||||
logger.warning("Disabling truststore since ssl support is missing")
|
||||
return None
|
||||
|
||||
try:
|
||||
import truststore
|
||||
except ImportError:
|
||||
raise CommandError(
|
||||
"To use the truststore feature, 'truststore' must be installed into "
|
||||
"pip's current environment."
|
||||
)
|
||||
|
||||
return truststore.SSLContext(ssl.PROTOCOL_TLS_CLIENT)
|
||||
|
||||
|
||||
class SessionCommandMixin(CommandContextMixIn):
|
||||
|
||||
"""
|
||||
A class mixin for command classes needing _build_session().
|
||||
"""
|
||||
|
||||
def __init__(self) -> None:
|
||||
super().__init__()
|
||||
self._session: Optional[PipSession] = None
|
||||
|
||||
@classmethod
|
||||
def _get_index_urls(cls, options: Values) -> Optional[List[str]]:
|
||||
"""Return a list of index urls from user-provided options."""
|
||||
index_urls = []
|
||||
if not getattr(options, "no_index", False):
|
||||
url = getattr(options, "index_url", None)
|
||||
if url:
|
||||
index_urls.append(url)
|
||||
urls = getattr(options, "extra_index_urls", None)
|
||||
if urls:
|
||||
index_urls.extend(urls)
|
||||
# Return None rather than an empty list
|
||||
return index_urls or None
|
||||
|
||||
def get_default_session(self, options: Values) -> PipSession:
|
||||
"""Get a default-managed session."""
|
||||
if self._session is None:
|
||||
self._session = self.enter_context(self._build_session(options))
|
||||
# there's no type annotation on requests.Session, so it's
|
||||
# automatically ContextManager[Any] and self._session becomes Any,
|
||||
# then https://github.com/python/mypy/issues/7696 kicks in
|
||||
assert self._session is not None
|
||||
return self._session
|
||||
|
||||
def _build_session(
|
||||
self,
|
||||
options: Values,
|
||||
retries: Optional[int] = None,
|
||||
timeout: Optional[int] = None,
|
||||
fallback_to_certifi: bool = False,
|
||||
) -> PipSession:
|
||||
cache_dir = options.cache_dir
|
||||
assert not cache_dir or os.path.isabs(cache_dir)
|
||||
|
||||
if "truststore" in options.features_enabled:
|
||||
try:
|
||||
ssl_context = _create_truststore_ssl_context()
|
||||
except Exception:
|
||||
if not fallback_to_certifi:
|
||||
raise
|
||||
ssl_context = None
|
||||
else:
|
||||
ssl_context = None
|
||||
|
||||
session = PipSession(
|
||||
cache=os.path.join(cache_dir, "http") if cache_dir else None,
|
||||
retries=retries if retries is not None else options.retries,
|
||||
trusted_hosts=options.trusted_hosts,
|
||||
index_urls=self._get_index_urls(options),
|
||||
ssl_context=ssl_context,
|
||||
)
|
||||
|
||||
# Handle custom ca-bundles from the user
|
||||
if options.cert:
|
||||
session.verify = options.cert
|
||||
|
||||
# Handle SSL client certificate
|
||||
if options.client_cert:
|
||||
session.cert = options.client_cert
|
||||
|
||||
# Handle timeouts
|
||||
if options.timeout or timeout:
|
||||
session.timeout = timeout if timeout is not None else options.timeout
|
||||
|
||||
# Handle configured proxies
|
||||
if options.proxy:
|
||||
session.proxies = {
|
||||
"http": options.proxy,
|
||||
"https": options.proxy,
|
||||
}
|
||||
|
||||
# Determine if we can prompt the user for authentication or not
|
||||
session.auth.prompting = not options.no_input
|
||||
|
||||
return session
|
||||
|
||||
|
||||
class IndexGroupCommand(Command, SessionCommandMixin):
|
||||
|
||||
"""
|
||||
Abstract base class for commands with the index_group options.
|
||||
|
||||
This also corresponds to the commands that permit the pip version check.
|
||||
"""
|
||||
|
||||
def handle_pip_version_check(self, options: Values) -> None:
|
||||
"""
|
||||
Do the pip version check if not disabled.
|
||||
|
||||
This overrides the default behavior of not doing the check.
|
||||
"""
|
||||
# Make sure the index_group options are present.
|
||||
assert hasattr(options, "no_index")
|
||||
|
||||
if options.disable_pip_version_check or options.no_index:
|
||||
return
|
||||
|
||||
# Otherwise, check if we're using the latest version of pip available.
|
||||
session = self._build_session(
|
||||
options,
|
||||
retries=0,
|
||||
timeout=min(5, options.timeout),
|
||||
# This is set to ensure the function does not fail when truststore is
|
||||
# specified in use-feature but cannot be loaded. This usually raises a
|
||||
# CommandError and shows a nice user-facing error, but this function is not
|
||||
# called in that try-except block.
|
||||
fallback_to_certifi=True,
|
||||
)
|
||||
with session:
|
||||
pip_self_version_check(session, options)
|
||||
|
||||
|
||||
KEEPABLE_TEMPDIR_TYPES = [
|
||||
tempdir_kinds.BUILD_ENV,
|
||||
tempdir_kinds.EPHEM_WHEEL_CACHE,
|
||||
tempdir_kinds.REQ_BUILD,
|
||||
]
|
||||
|
||||
|
||||
def warn_if_run_as_root() -> None:
|
||||
"""Output a warning for sudo users on Unix.
|
||||
|
||||
In a virtual environment, sudo pip still writes to virtualenv.
|
||||
On Windows, users may run pip as Administrator without issues.
|
||||
This warning only applies to Unix root users outside of virtualenv.
|
||||
"""
|
||||
if running_under_virtualenv():
|
||||
return
|
||||
if not hasattr(os, "getuid"):
|
||||
return
|
||||
# On Windows, there are no "system managed" Python packages. Installing as
|
||||
# Administrator via pip is the correct way of updating system environments.
|
||||
#
|
||||
# We choose sys.platform over utils.compat.WINDOWS here to enable Mypy platform
|
||||
# checks: https://mypy.readthedocs.io/en/stable/common_issues.html
|
||||
if sys.platform == "win32" or sys.platform == "cygwin":
|
||||
return
|
||||
|
||||
if os.getuid() != 0:
|
||||
return
|
||||
|
||||
logger.warning(
|
||||
"Running pip as the 'root' user can result in broken permissions and "
|
||||
"conflicting behaviour with the system package manager. "
|
||||
"It is recommended to use a virtual environment instead: "
|
||||
"https://pip.pypa.io/warnings/venv"
|
||||
)
|
||||
|
||||
|
||||
def with_cleanup(func: Any) -> Any:
|
||||
"""Decorator for common logic related to managing temporary
|
||||
directories.
|
||||
"""
|
||||
|
||||
def configure_tempdir_registry(registry: TempDirectoryTypeRegistry) -> None:
|
||||
for t in KEEPABLE_TEMPDIR_TYPES:
|
||||
registry.set_delete(t, False)
|
||||
|
||||
def wrapper(
|
||||
self: RequirementCommand, options: Values, args: List[Any]
|
||||
) -> Optional[int]:
|
||||
assert self.tempdir_registry is not None
|
||||
if options.no_clean:
|
||||
configure_tempdir_registry(self.tempdir_registry)
|
||||
|
||||
try:
|
||||
return func(self, options, args)
|
||||
except PreviousBuildDirError:
|
||||
# This kind of conflict can occur when the user passes an explicit
|
||||
# build directory with a pre-existing folder. In that case we do
|
||||
# not want to accidentally remove it.
|
||||
configure_tempdir_registry(self.tempdir_registry)
|
||||
raise
|
||||
|
||||
return wrapper
|
||||
|
||||
|
||||
class RequirementCommand(IndexGroupCommand):
|
||||
def __init__(self, *args: Any, **kw: Any) -> None:
|
||||
super().__init__(*args, **kw)
|
||||
|
||||
self.cmd_opts.add_option(cmdoptions.no_clean())
|
||||
|
||||
@staticmethod
|
||||
def determine_resolver_variant(options: Values) -> str:
|
||||
"""Determines which resolver should be used, based on the given options."""
|
||||
if "legacy-resolver" in options.deprecated_features_enabled:
|
||||
return "legacy"
|
||||
|
||||
return "2020-resolver"
|
||||
|
||||
@classmethod
|
||||
def make_requirement_preparer(
|
||||
cls,
|
||||
temp_build_dir: TempDirectory,
|
||||
options: Values,
|
||||
build_tracker: BuildTracker,
|
||||
session: PipSession,
|
||||
finder: PackageFinder,
|
||||
use_user_site: bool,
|
||||
download_dir: Optional[str] = None,
|
||||
verbosity: int = 0,
|
||||
) -> RequirementPreparer:
|
||||
"""
|
||||
Create a RequirementPreparer instance for the given parameters.
|
||||
"""
|
||||
temp_build_dir_path = temp_build_dir.path
|
||||
assert temp_build_dir_path is not None
|
||||
|
||||
resolver_variant = cls.determine_resolver_variant(options)
|
||||
if resolver_variant == "2020-resolver":
|
||||
lazy_wheel = "fast-deps" in options.features_enabled
|
||||
if lazy_wheel:
|
||||
logger.warning(
|
||||
"pip is using lazily downloaded wheels using HTTP "
|
||||
"range requests to obtain dependency information. "
|
||||
"This experimental feature is enabled through "
|
||||
"--use-feature=fast-deps and it is not ready for "
|
||||
"production."
|
||||
)
|
||||
else:
|
||||
lazy_wheel = False
|
||||
if "fast-deps" in options.features_enabled:
|
||||
logger.warning(
|
||||
"fast-deps has no effect when used with the legacy resolver."
|
||||
)
|
||||
|
||||
return RequirementPreparer(
|
||||
build_dir=temp_build_dir_path,
|
||||
src_dir=options.src_dir,
|
||||
download_dir=download_dir,
|
||||
build_isolation=options.build_isolation,
|
||||
check_build_deps=options.check_build_deps,
|
||||
build_tracker=build_tracker,
|
||||
session=session,
|
||||
progress_bar=options.progress_bar,
|
||||
finder=finder,
|
||||
require_hashes=options.require_hashes,
|
||||
use_user_site=use_user_site,
|
||||
lazy_wheel=lazy_wheel,
|
||||
verbosity=verbosity,
|
||||
)
|
||||
|
||||
@classmethod
|
||||
def make_resolver(
|
||||
cls,
|
||||
preparer: RequirementPreparer,
|
||||
finder: PackageFinder,
|
||||
options: Values,
|
||||
wheel_cache: Optional[WheelCache] = None,
|
||||
use_user_site: bool = False,
|
||||
ignore_installed: bool = True,
|
||||
ignore_requires_python: bool = False,
|
||||
force_reinstall: bool = False,
|
||||
upgrade_strategy: str = "to-satisfy-only",
|
||||
use_pep517: Optional[bool] = None,
|
||||
py_version_info: Optional[Tuple[int, ...]] = None,
|
||||
) -> BaseResolver:
|
||||
"""
|
||||
Create a Resolver instance for the given parameters.
|
||||
"""
|
||||
make_install_req = partial(
|
||||
install_req_from_req_string,
|
||||
isolated=options.isolated_mode,
|
||||
use_pep517=use_pep517,
|
||||
config_settings=getattr(options, "config_settings", None),
|
||||
)
|
||||
resolver_variant = cls.determine_resolver_variant(options)
|
||||
# The long import name and duplicated invocation is needed to convince
|
||||
# Mypy into correctly typechecking. Otherwise it would complain the
|
||||
# "Resolver" class being redefined.
|
||||
if resolver_variant == "2020-resolver":
|
||||
import pip._internal.resolution.resolvelib.resolver
|
||||
|
||||
return pip._internal.resolution.resolvelib.resolver.Resolver(
|
||||
preparer=preparer,
|
||||
finder=finder,
|
||||
wheel_cache=wheel_cache,
|
||||
make_install_req=make_install_req,
|
||||
use_user_site=use_user_site,
|
||||
ignore_dependencies=options.ignore_dependencies,
|
||||
ignore_installed=ignore_installed,
|
||||
ignore_requires_python=ignore_requires_python,
|
||||
force_reinstall=force_reinstall,
|
||||
upgrade_strategy=upgrade_strategy,
|
||||
py_version_info=py_version_info,
|
||||
)
|
||||
import pip._internal.resolution.legacy.resolver
|
||||
|
||||
return pip._internal.resolution.legacy.resolver.Resolver(
|
||||
preparer=preparer,
|
||||
finder=finder,
|
||||
wheel_cache=wheel_cache,
|
||||
make_install_req=make_install_req,
|
||||
use_user_site=use_user_site,
|
||||
ignore_dependencies=options.ignore_dependencies,
|
||||
ignore_installed=ignore_installed,
|
||||
ignore_requires_python=ignore_requires_python,
|
||||
force_reinstall=force_reinstall,
|
||||
upgrade_strategy=upgrade_strategy,
|
||||
py_version_info=py_version_info,
|
||||
)
|
||||
|
||||
def get_requirements(
|
||||
self,
|
||||
args: List[str],
|
||||
options: Values,
|
||||
finder: PackageFinder,
|
||||
session: PipSession,
|
||||
) -> List[InstallRequirement]:
|
||||
"""
|
||||
Parse command-line arguments into the corresponding requirements.
|
||||
"""
|
||||
requirements: List[InstallRequirement] = []
|
||||
for filename in options.constraints:
|
||||
for parsed_req in parse_requirements(
|
||||
filename,
|
||||
constraint=True,
|
||||
finder=finder,
|
||||
options=options,
|
||||
session=session,
|
||||
):
|
||||
req_to_add = install_req_from_parsed_requirement(
|
||||
parsed_req,
|
||||
isolated=options.isolated_mode,
|
||||
user_supplied=False,
|
||||
)
|
||||
requirements.append(req_to_add)
|
||||
|
||||
for req in args:
|
||||
req_to_add = install_req_from_line(
|
||||
req,
|
||||
None,
|
||||
isolated=options.isolated_mode,
|
||||
use_pep517=options.use_pep517,
|
||||
user_supplied=True,
|
||||
config_settings=getattr(options, "config_settings", None),
|
||||
)
|
||||
requirements.append(req_to_add)
|
||||
|
||||
for req in options.editables:
|
||||
req_to_add = install_req_from_editable(
|
||||
req,
|
||||
user_supplied=True,
|
||||
isolated=options.isolated_mode,
|
||||
use_pep517=options.use_pep517,
|
||||
config_settings=getattr(options, "config_settings", None),
|
||||
)
|
||||
requirements.append(req_to_add)
|
||||
|
||||
# NOTE: options.require_hashes may be set if --require-hashes is True
|
||||
for filename in options.requirements:
|
||||
for parsed_req in parse_requirements(
|
||||
filename, finder=finder, options=options, session=session
|
||||
):
|
||||
req_to_add = install_req_from_parsed_requirement(
|
||||
parsed_req,
|
||||
isolated=options.isolated_mode,
|
||||
use_pep517=options.use_pep517,
|
||||
user_supplied=True,
|
||||
)
|
||||
requirements.append(req_to_add)
|
||||
|
||||
# If any requirement has hash options, enable hash checking.
|
||||
if any(req.has_hash_options for req in requirements):
|
||||
options.require_hashes = True
|
||||
|
||||
if not (args or options.editables or options.requirements):
|
||||
opts = {"name": self.name}
|
||||
if options.find_links:
|
||||
raise CommandError(
|
||||
"You must give at least one requirement to {name} "
|
||||
'(maybe you meant "pip {name} {links}"?)'.format(
|
||||
**dict(opts, links=" ".join(options.find_links))
|
||||
)
|
||||
)
|
||||
else:
|
||||
raise CommandError(
|
||||
"You must give at least one requirement to {name} "
|
||||
'(see "pip help {name}")'.format(**opts)
|
||||
)
|
||||
|
||||
return requirements
|
||||
|
||||
@staticmethod
|
||||
def trace_basic_info(finder: PackageFinder) -> None:
|
||||
"""
|
||||
Trace basic information about the provided objects.
|
||||
"""
|
||||
# Display where finder is looking for packages
|
||||
search_scope = finder.search_scope
|
||||
locations = search_scope.get_formatted_locations()
|
||||
if locations:
|
||||
logger.info(locations)
|
||||
|
||||
def _build_package_finder(
|
||||
self,
|
||||
options: Values,
|
||||
session: PipSession,
|
||||
target_python: Optional[TargetPython] = None,
|
||||
ignore_requires_python: Optional[bool] = None,
|
||||
) -> PackageFinder:
|
||||
"""
|
||||
Create a package finder appropriate to this requirement command.
|
||||
|
||||
:param ignore_requires_python: Whether to ignore incompatible
|
||||
"Requires-Python" values in links. Defaults to False.
|
||||
"""
|
||||
link_collector = LinkCollector.create(session, options=options)
|
||||
selection_prefs = SelectionPreferences(
|
||||
allow_yanked=True,
|
||||
format_control=options.format_control,
|
||||
allow_all_prereleases=options.pre,
|
||||
prefer_binary=options.prefer_binary,
|
||||
ignore_requires_python=ignore_requires_python,
|
||||
)
|
||||
|
||||
return PackageFinder.create(
|
||||
link_collector=link_collector,
|
||||
selection_prefs=selection_prefs,
|
||||
target_python=target_python,
|
||||
)
|
||||
@@ -0,0 +1,159 @@
|
||||
import contextlib
|
||||
import itertools
|
||||
import logging
|
||||
import sys
|
||||
import time
|
||||
from typing import IO, Generator, Optional
|
||||
|
||||
from pip._internal.utils.compat import WINDOWS
|
||||
from pip._internal.utils.logging import get_indentation
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
class SpinnerInterface:
|
||||
def spin(self) -> None:
|
||||
raise NotImplementedError()
|
||||
|
||||
def finish(self, final_status: str) -> None:
|
||||
raise NotImplementedError()
|
||||
|
||||
|
||||
class InteractiveSpinner(SpinnerInterface):
|
||||
def __init__(
|
||||
self,
|
||||
message: str,
|
||||
file: Optional[IO[str]] = None,
|
||||
spin_chars: str = "-\\|/",
|
||||
# Empirically, 8 updates/second looks nice
|
||||
min_update_interval_seconds: float = 0.125,
|
||||
):
|
||||
self._message = message
|
||||
if file is None:
|
||||
file = sys.stdout
|
||||
self._file = file
|
||||
self._rate_limiter = RateLimiter(min_update_interval_seconds)
|
||||
self._finished = False
|
||||
|
||||
self._spin_cycle = itertools.cycle(spin_chars)
|
||||
|
||||
self._file.write(" " * get_indentation() + self._message + " ... ")
|
||||
self._width = 0
|
||||
|
||||
def _write(self, status: str) -> None:
|
||||
assert not self._finished
|
||||
# Erase what we wrote before by backspacing to the beginning, writing
|
||||
# spaces to overwrite the old text, and then backspacing again
|
||||
backup = "\b" * self._width
|
||||
self._file.write(backup + " " * self._width + backup)
|
||||
# Now we have a blank slate to add our status
|
||||
self._file.write(status)
|
||||
self._width = len(status)
|
||||
self._file.flush()
|
||||
self._rate_limiter.reset()
|
||||
|
||||
def spin(self) -> None:
|
||||
if self._finished:
|
||||
return
|
||||
if not self._rate_limiter.ready():
|
||||
return
|
||||
self._write(next(self._spin_cycle))
|
||||
|
||||
def finish(self, final_status: str) -> None:
|
||||
if self._finished:
|
||||
return
|
||||
self._write(final_status)
|
||||
self._file.write("\n")
|
||||
self._file.flush()
|
||||
self._finished = True
|
||||
|
||||
|
||||
# Used for dumb terminals, non-interactive installs (no tty), etc.
|
||||
# We still print updates occasionally (once every 60 seconds by default) to
|
||||
# act as a keep-alive for systems like Travis-CI that take lack-of-output as
|
||||
# an indication that a task has frozen.
|
||||
class NonInteractiveSpinner(SpinnerInterface):
|
||||
def __init__(self, message: str, min_update_interval_seconds: float = 60.0) -> None:
|
||||
self._message = message
|
||||
self._finished = False
|
||||
self._rate_limiter = RateLimiter(min_update_interval_seconds)
|
||||
self._update("started")
|
||||
|
||||
def _update(self, status: str) -> None:
|
||||
assert not self._finished
|
||||
self._rate_limiter.reset()
|
||||
logger.info("%s: %s", self._message, status)
|
||||
|
||||
def spin(self) -> None:
|
||||
if self._finished:
|
||||
return
|
||||
if not self._rate_limiter.ready():
|
||||
return
|
||||
self._update("still running...")
|
||||
|
||||
def finish(self, final_status: str) -> None:
|
||||
if self._finished:
|
||||
return
|
||||
self._update(f"finished with status '{final_status}'")
|
||||
self._finished = True
|
||||
|
||||
|
||||
class RateLimiter:
|
||||
def __init__(self, min_update_interval_seconds: float) -> None:
|
||||
self._min_update_interval_seconds = min_update_interval_seconds
|
||||
self._last_update: float = 0
|
||||
|
||||
def ready(self) -> bool:
|
||||
now = time.time()
|
||||
delta = now - self._last_update
|
||||
return delta >= self._min_update_interval_seconds
|
||||
|
||||
def reset(self) -> None:
|
||||
self._last_update = time.time()
|
||||
|
||||
|
||||
@contextlib.contextmanager
|
||||
def open_spinner(message: str) -> Generator[SpinnerInterface, None, None]:
|
||||
# Interactive spinner goes directly to sys.stdout rather than being routed
|
||||
# through the logging system, but it acts like it has level INFO,
|
||||
# i.e. it's only displayed if we're at level INFO or better.
|
||||
# Non-interactive spinner goes through the logging system, so it is always
|
||||
# in sync with logging configuration.
|
||||
if sys.stdout.isatty() and logger.getEffectiveLevel() <= logging.INFO:
|
||||
spinner: SpinnerInterface = InteractiveSpinner(message)
|
||||
else:
|
||||
spinner = NonInteractiveSpinner(message)
|
||||
try:
|
||||
with hidden_cursor(sys.stdout):
|
||||
yield spinner
|
||||
except KeyboardInterrupt:
|
||||
spinner.finish("canceled")
|
||||
raise
|
||||
except Exception:
|
||||
spinner.finish("error")
|
||||
raise
|
||||
else:
|
||||
spinner.finish("done")
|
||||
|
||||
|
||||
HIDE_CURSOR = "\x1b[?25l"
|
||||
SHOW_CURSOR = "\x1b[?25h"
|
||||
|
||||
|
||||
@contextlib.contextmanager
|
||||
def hidden_cursor(file: IO[str]) -> Generator[None, None, None]:
|
||||
# The Windows terminal does not support the hide/show cursor ANSI codes,
|
||||
# even via colorama. So don't even try.
|
||||
if WINDOWS:
|
||||
yield
|
||||
# We don't want to clutter the output with control characters if we're
|
||||
# writing to a file, or if the user is running with --quiet.
|
||||
# See https://github.com/pypa/pip/issues/3418
|
||||
elif not file.isatty() or logger.getEffectiveLevel() > logging.INFO:
|
||||
yield
|
||||
else:
|
||||
file.write(HIDE_CURSOR)
|
||||
try:
|
||||
yield
|
||||
finally:
|
||||
file.write(SHOW_CURSOR)
|
||||
@@ -0,0 +1,6 @@
|
||||
SUCCESS = 0
|
||||
ERROR = 1
|
||||
UNKNOWN_ERROR = 2
|
||||
VIRTUALENV_NOT_FOUND = 3
|
||||
PREVIOUS_BUILD_DIR_ERROR = 4
|
||||
NO_MATCHES_FOUND = 23
|
||||
@@ -0,0 +1,132 @@
|
||||
"""
|
||||
Package containing all pip commands
|
||||
"""
|
||||
|
||||
import importlib
|
||||
from collections import namedtuple
|
||||
from typing import Any, Dict, Optional
|
||||
|
||||
from pip._internal.cli.base_command import Command
|
||||
|
||||
CommandInfo = namedtuple("CommandInfo", "module_path, class_name, summary")
|
||||
|
||||
# This dictionary does a bunch of heavy lifting for help output:
|
||||
# - Enables avoiding additional (costly) imports for presenting `--help`.
|
||||
# - The ordering matters for help display.
|
||||
#
|
||||
# Even though the module path starts with the same "pip._internal.commands"
|
||||
# prefix, the full path makes testing easier (specifically when modifying
|
||||
# `commands_dict` in test setup / teardown).
|
||||
commands_dict: Dict[str, CommandInfo] = {
|
||||
"install": CommandInfo(
|
||||
"pip._internal.commands.install",
|
||||
"InstallCommand",
|
||||
"Install packages.",
|
||||
),
|
||||
"download": CommandInfo(
|
||||
"pip._internal.commands.download",
|
||||
"DownloadCommand",
|
||||
"Download packages.",
|
||||
),
|
||||
"uninstall": CommandInfo(
|
||||
"pip._internal.commands.uninstall",
|
||||
"UninstallCommand",
|
||||
"Uninstall packages.",
|
||||
),
|
||||
"freeze": CommandInfo(
|
||||
"pip._internal.commands.freeze",
|
||||
"FreezeCommand",
|
||||
"Output installed packages in requirements format.",
|
||||
),
|
||||
"inspect": CommandInfo(
|
||||
"pip._internal.commands.inspect",
|
||||
"InspectCommand",
|
||||
"Inspect the python environment.",
|
||||
),
|
||||
"list": CommandInfo(
|
||||
"pip._internal.commands.list",
|
||||
"ListCommand",
|
||||
"List installed packages.",
|
||||
),
|
||||
"show": CommandInfo(
|
||||
"pip._internal.commands.show",
|
||||
"ShowCommand",
|
||||
"Show information about installed packages.",
|
||||
),
|
||||
"check": CommandInfo(
|
||||
"pip._internal.commands.check",
|
||||
"CheckCommand",
|
||||
"Verify installed packages have compatible dependencies.",
|
||||
),
|
||||
"config": CommandInfo(
|
||||
"pip._internal.commands.configuration",
|
||||
"ConfigurationCommand",
|
||||
"Manage local and global configuration.",
|
||||
),
|
||||
"search": CommandInfo(
|
||||
"pip._internal.commands.search",
|
||||
"SearchCommand",
|
||||
"Search PyPI for packages.",
|
||||
),
|
||||
"cache": CommandInfo(
|
||||
"pip._internal.commands.cache",
|
||||
"CacheCommand",
|
||||
"Inspect and manage pip's wheel cache.",
|
||||
),
|
||||
"index": CommandInfo(
|
||||
"pip._internal.commands.index",
|
||||
"IndexCommand",
|
||||
"Inspect information available from package indexes.",
|
||||
),
|
||||
"wheel": CommandInfo(
|
||||
"pip._internal.commands.wheel",
|
||||
"WheelCommand",
|
||||
"Build wheels from your requirements.",
|
||||
),
|
||||
"hash": CommandInfo(
|
||||
"pip._internal.commands.hash",
|
||||
"HashCommand",
|
||||
"Compute hashes of package archives.",
|
||||
),
|
||||
"completion": CommandInfo(
|
||||
"pip._internal.commands.completion",
|
||||
"CompletionCommand",
|
||||
"A helper command used for command completion.",
|
||||
),
|
||||
"debug": CommandInfo(
|
||||
"pip._internal.commands.debug",
|
||||
"DebugCommand",
|
||||
"Show information useful for debugging.",
|
||||
),
|
||||
"help": CommandInfo(
|
||||
"pip._internal.commands.help",
|
||||
"HelpCommand",
|
||||
"Show help for commands.",
|
||||
),
|
||||
}
|
||||
|
||||
|
||||
def create_command(name: str, **kwargs: Any) -> Command:
|
||||
"""
|
||||
Create an instance of the Command class with the given name.
|
||||
"""
|
||||
module_path, class_name, summary = commands_dict[name]
|
||||
module = importlib.import_module(module_path)
|
||||
command_class = getattr(module, class_name)
|
||||
command = command_class(name=name, summary=summary, **kwargs)
|
||||
|
||||
return command
|
||||
|
||||
|
||||
def get_similar_commands(name: str) -> Optional[str]:
|
||||
"""Command name auto-correct."""
|
||||
from difflib import get_close_matches
|
||||
|
||||
name = name.lower()
|
||||
|
||||
close_commands = get_close_matches(name, commands_dict.keys())
|
||||
|
||||
if close_commands:
|
||||
return close_commands[0]
|
||||
else:
|
||||
return None
|
||||
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user