From 4530facb072ed536137d26b5b6fbe593cc7b9ac3 Mon Sep 17 00:00:00 2001 From: Gerhard Hagerer Date: Tue, 1 Nov 2016 10:30:22 +0100 Subject: [PATCH 1/4] Adding PyMySQL for Python 3 Stubs were auto-generated and manually modified using mypy/stubgen.py and Python 3.5. Closes the following ticket: https://github.com/python/typeshed/issues/631 --- third_party/3/pymysql/__init__.pyi | 39 ++ third_party/3/pymysql/charset.pyi | 20 + third_party/3/pymysql/connections.pyi | 142 ++++++ third_party/3/pymysql/constants/CLIENT.pyi | 24 + third_party/3/pymysql/constants/COMMAND.pyi | 28 + third_party/3/pymysql/constants/ER.pyi | 477 ++++++++++++++++++ .../3/pymysql/constants/FIELD_TYPE.pyi | 35 ++ third_party/3/pymysql/constants/FLAG.pyi | 21 + .../3/pymysql/constants/SERVER_STATUS.pyi | 16 + third_party/3/pymysql/constants/__init__.pyi | 4 + third_party/3/pymysql/converters.pyi | 50 ++ third_party/3/pymysql/cursors.pyi | 37 ++ third_party/3/pymysql/err.pyi | 22 + third_party/3/pymysql/tests/__init__.pyi | 9 + third_party/3/pymysql/times.pyi | 14 + third_party/3/pymysql/util.pyi | 7 + 16 files changed, 945 insertions(+) create mode 100644 third_party/3/pymysql/__init__.pyi create mode 100644 third_party/3/pymysql/charset.pyi create mode 100644 third_party/3/pymysql/connections.pyi create mode 100644 third_party/3/pymysql/constants/CLIENT.pyi create mode 100644 third_party/3/pymysql/constants/COMMAND.pyi create mode 100644 third_party/3/pymysql/constants/ER.pyi create mode 100644 third_party/3/pymysql/constants/FIELD_TYPE.pyi create mode 100644 third_party/3/pymysql/constants/FLAG.pyi create mode 100644 third_party/3/pymysql/constants/SERVER_STATUS.pyi create mode 100644 third_party/3/pymysql/constants/__init__.pyi create mode 100644 third_party/3/pymysql/converters.pyi create mode 100644 third_party/3/pymysql/cursors.pyi create mode 100644 third_party/3/pymysql/err.pyi create mode 100644 third_party/3/pymysql/tests/__init__.pyi create mode 100644 third_party/3/pymysql/times.pyi create mode 100644 third_party/3/pymysql/util.pyi diff --git a/third_party/3/pymysql/__init__.pyi b/third_party/3/pymysql/__init__.pyi new file mode 100644 index 000000000000..2c896e8d930a --- /dev/null +++ b/third_party/3/pymysql/__init__.pyi @@ -0,0 +1,39 @@ +# Stubs for pymysql (Python 3.5) +# +# NOTE: This dynamically typed stub was automatically generated by stubgen. + +from typing import * +from .connections import Connection +from .constants import FIELD_TYPE as FIELD_TYPE +from .converters import escape_dict as escape_dict, escape_sequence as escape_sequence, escape_string as escape_string +from .err import Warning as Warning, Error as Error, InterfaceError as InterfaceError, DataError as DataError, DatabaseError as DatabaseError, OperationalError as OperationalError, IntegrityError as IntegrityError, InternalError as InternalError, NotSupportedError as NotSupportedError, ProgrammingError as ProgrammingError, MySQLError as MySQLError +from .times import Date as Date, Time as Time, Timestamp as Timestamp, DateFromTicks as DateFromTicks, TimeFromTicks as TimeFromTicks, TimestampFromTicks as TimestampFromTicks + +threadsafety = ... # type: int +apilevel = ... # type: str +paramstyle = ... # type: str + +class DBAPISet(frozenset): + def __ne__(self, other) -> bool: ... + def __eq__(self, other) -> bool: ... + def __hash__(self) -> int: ... + +STRING = ... # type: DBAPISet +BINARY = ... # type: DBAPISet +NUMBER = ... # type: DBAPISet +DATE = ... # type: DBAPISet +TIME = ... # type: DBAPISet +TIMESTAMP = ... # type: DBAPISet +ROWID = ... # type: DBAPISet + +def Binary(x) -> Union[bytearray, bytes]: ... +def Connect(*args, **kwargs) -> Connection: ... +def get_client_info() -> str: ... + +connect = ... # type: Callable[..., Connection] + + +version_info = ... # type: Tuple[int, int, int, str, int] +NULL = ... # type: str + +def install_as_MySQLdb() -> None: ... diff --git a/third_party/3/pymysql/charset.pyi b/third_party/3/pymysql/charset.pyi new file mode 100644 index 000000000000..4fc0df540f6c --- /dev/null +++ b/third_party/3/pymysql/charset.pyi @@ -0,0 +1,20 @@ +# Stubs for pymysql.charset (Python 3.5) +# +# NOTE: This dynamically typed stub was automatically generated by stubgen. + +from typing import Any + +MBLENGTH = ... # type: Any + +class Charset: + is_default = ... # type: Any + def __init__(self, id, name, collation, is_default): ... + +class Charsets: + def __init__(self): ... + def add(self, c): ... + def by_id(self, id): ... + def by_name(self, name): ... + +def charset_by_name(name): ... +def charset_by_id(id): ... diff --git a/third_party/3/pymysql/connections.pyi b/third_party/3/pymysql/connections.pyi new file mode 100644 index 000000000000..4bea852cd8b4 --- /dev/null +++ b/third_party/3/pymysql/connections.pyi @@ -0,0 +1,142 @@ +# Stubs for pymysql.connections (Python 3.5) +# +# NOTE: This dynamically typed stub was automatically generated by stubgen. + +from typing import * +from .charset import MBLENGTH as MBLENGTH, charset_by_name as charset_by_name, charset_by_id as charset_by_id +from .cursors import Cursor as Cursor +from .constants import FIELD_TYPE as FIELD_TYPE, FLAG as FLAG +from .constants import SERVER_STATUS as SERVER_STATUS +from .constants.CLIENT import * +from .constants.COMMAND import * +from .util import join_bytes as join_bytes, byte2int as byte2int, int2byte as int2byte +from .converters import escape_item as escape_item, encoders as encoders, decoders as decoders +from .err import raise_mysql_exception as raise_mysql_exception, Warning as Warning, Error as Error, InterfaceError as InterfaceError, DataError as DataError, DatabaseError as DatabaseError, OperationalError as OperationalError, IntegrityError as IntegrityError, InternalError as InternalError, NotSupportedError as NotSupportedError, ProgrammingError as ProgrammingError + +sha_new = ... # type: Any +SSL_ENABLED = ... # type: Any +DEFAULT_USER = ... # type: Any +DEBUG = ... # type: Any +NULL_COLUMN = ... # type: Any +UNSIGNED_CHAR_COLUMN = ... # type: Any +UNSIGNED_SHORT_COLUMN = ... # type: Any +UNSIGNED_INT24_COLUMN = ... # type: Any +UNSIGNED_INT64_COLUMN = ... # type: Any +UNSIGNED_CHAR_LENGTH = ... # type: Any +UNSIGNED_SHORT_LENGTH = ... # type: Any +UNSIGNED_INT24_LENGTH = ... # type: Any +UNSIGNED_INT64_LENGTH = ... # type: Any +DEFAULT_CHARSET = ... # type: Any + +def dump_packet(data): ... + +SCRAMBLE_LENGTH_323 = ... # type: Any + +class RandStruct_323: + max_value = ... # type: Any + seed1 = ... # type: Any + seed2 = ... # type: Any + def __init__(self, seed1, seed2): ... + def my_rnd(self): ... + +def pack_int24(n): ... +def unpack_uint16(n): ... +def unpack_int24(n): ... +def unpack_int32(n): ... +def unpack_int64(n): ... +def defaulterrorhandler(connection, cursor, errorclass, errorvalue): ... + +class MysqlPacket: + connection = ... # type: Any + def __init__(self, connection): ... + def packet_number(self): ... + def get_all_data(self): ... + def read(self, size): ... + def read_all(self): ... + def advance(self, length): ... + def rewind(self, position=0): ... + def peek(self, size): ... + def get_bytes(self, position, length=1): ... + def read_length_coded_binary(self): ... + def read_length_coded_string(self): ... + def is_ok_packet(self): ... + def is_eof_packet(self): ... + def is_resultset_packet(self): ... + def is_error_packet(self): ... + def check_error(self): ... + def dump(self): ... + +class FieldDescriptorPacket(MysqlPacket): + def __init__(self, *args): ... + def description(self): ... + def get_column_length(self): ... + +class Connection: + errorhandler = ... # type: Any + ssl = ... # type: Any + host = ... # type: Any + port = ... # type: Any + user = ... # type: Any + password = ... # type: Any + db = ... # type: Any + unix_socket = ... # type: Any + charset = ... # type: Any + use_unicode = ... # type: Any + client_flag = ... # type: Any + cursorclass = ... # type: Any + connect_timeout = ... # type: Any + messages = ... # type: Any + encoders = ... # type: Any + decoders = ... # type: Any + host_info = ... # type: Any + def __init__(self, host='', user=None, passwd='', db=None, port=3306, unix_socket=None, charset='', sql_mode=None, read_default_file=None, conv=..., use_unicode=None, client_flag=0, cursorclass=..., init_command=None, connect_timeout=None, ssl=None, read_default_group=None, compress=None, named_pipe=None): ... + socket = ... # type: Any + rfile = ... # type: Any + wfile = ... # type: Any + def close(self): ... + def autocommit(self, value): ... + def commit(self): ... + def rollback(self): ... + def escape(self, obj): ... + def literal(self, obj): ... + def cursor(self, cursor: Optional[Type[Cursor]]=None): ... + def __enter__(self): ... + def __exit__(self, exc, value, traceback): ... + def query(self, sql): ... + def next_result(self): ... + def affected_rows(self): ... + def kill(self, thread_id): ... + def ping(self, reconnect=True): ... + def set_charset(self, charset): ... + def read_packet(self, packet_type=...): ... + def insert_id(self): ... + def thread_id(self): ... + def character_set_name(self): ... + def get_host_info(self): ... + def get_proto_info(self): ... + def get_server_info(self): ... + Warning = ... # type: Any + Error = ... # type: Any + InterfaceError = ... # type: Any + DatabaseError = ... # type: Any + DataError = ... # type: Any + OperationalError = ... # type: Any + IntegrityError = ... # type: Any + InternalError = ... # type: Any + ProgrammingError = ... # type: Any + NotSupportedError = ... # type: Any + +class MySQLResult: + connection = ... # type: Any + affected_rows = ... # type: Any + insert_id = ... # type: Any + server_status = ... # type: Any + warning_count = ... # type: Any + message = ... # type: Any + field_count = ... # type: Any + description = ... # type: Any + rows = ... # type: Any + has_next = ... # type: Any + def __init__(self, connection): ... + first_packet = ... # type: Any + def read(self): ... diff --git a/third_party/3/pymysql/constants/CLIENT.pyi b/third_party/3/pymysql/constants/CLIENT.pyi new file mode 100644 index 000000000000..30d9dfcfc939 --- /dev/null +++ b/third_party/3/pymysql/constants/CLIENT.pyi @@ -0,0 +1,24 @@ +# Stubs for pymysql.constants.CLIENT (Python 3.5) +# +# NOTE: This dynamically typed stub was automatically generated by stubgen. + +from typing import Any + +LONG_PASSWORD = ... # type: Any +FOUND_ROWS = ... # type: Any +LONG_FLAG = ... # type: Any +CONNECT_WITH_DB = ... # type: Any +NO_SCHEMA = ... # type: Any +COMPRESS = ... # type: Any +ODBC = ... # type: Any +LOCAL_FILES = ... # type: Any +IGNORE_SPACE = ... # type: Any +PROTOCOL_41 = ... # type: Any +INTERACTIVE = ... # type: Any +SSL = ... # type: Any +IGNORE_SIGPIPE = ... # type: Any +TRANSACTIONS = ... # type: Any +SECURE_CONNECTION = ... # type: Any +MULTI_STATEMENTS = ... # type: Any +MULTI_RESULTS = ... # type: Any +CAPABILITIES = ... # type: Any diff --git a/third_party/3/pymysql/constants/COMMAND.pyi b/third_party/3/pymysql/constants/COMMAND.pyi new file mode 100644 index 000000000000..4ec68d5aae1f --- /dev/null +++ b/third_party/3/pymysql/constants/COMMAND.pyi @@ -0,0 +1,28 @@ +# Stubs for pymysql.constants.COMMAND (Python 3.5) +# +# NOTE: This dynamically typed stub was automatically generated by stubgen. + +from typing import Any + +COM_SLEEP = ... # type: Any +COM_QUIT = ... # type: Any +COM_INIT_DB = ... # type: Any +COM_QUERY = ... # type: Any +COM_FIELD_LIST = ... # type: Any +COM_CREATE_DB = ... # type: Any +COM_DROP_DB = ... # type: Any +COM_REFRESH = ... # type: Any +COM_SHUTDOWN = ... # type: Any +COM_STATISTICS = ... # type: Any +COM_PROCESS_INFO = ... # type: Any +COM_CONNECT = ... # type: Any +COM_PROCESS_KILL = ... # type: Any +COM_DEBUG = ... # type: Any +COM_PING = ... # type: Any +COM_TIME = ... # type: Any +COM_DELAYED_INSERT = ... # type: Any +COM_CHANGE_USER = ... # type: Any +COM_BINLOG_DUMP = ... # type: Any +COM_TABLE_DUMP = ... # type: Any +COM_CONNECT_OUT = ... # type: Any +COM_REGISTER_SLAVE = ... # type: Any diff --git a/third_party/3/pymysql/constants/ER.pyi b/third_party/3/pymysql/constants/ER.pyi new file mode 100644 index 000000000000..0ab17b26f6df --- /dev/null +++ b/third_party/3/pymysql/constants/ER.pyi @@ -0,0 +1,477 @@ +# Stubs for pymysql.constants.ER (Python 3.5) +# +# NOTE: This dynamically typed stub was automatically generated by stubgen. + +from typing import Any + +ERROR_FIRST = ... # type: Any +HASHCHK = ... # type: Any +NISAMCHK = ... # type: Any +NO = ... # type: Any +YES = ... # type: Any +CANT_CREATE_FILE = ... # type: Any +CANT_CREATE_TABLE = ... # type: Any +CANT_CREATE_DB = ... # type: Any +DB_CREATE_EXISTS = ... # type: Any +DB_DROP_EXISTS = ... # type: Any +DB_DROP_DELETE = ... # type: Any +DB_DROP_RMDIR = ... # type: Any +CANT_DELETE_FILE = ... # type: Any +CANT_FIND_SYSTEM_REC = ... # type: Any +CANT_GET_STAT = ... # type: Any +CANT_GET_WD = ... # type: Any +CANT_LOCK = ... # type: Any +CANT_OPEN_FILE = ... # type: Any +FILE_NOT_FOUND = ... # type: Any +CANT_READ_DIR = ... # type: Any +CANT_SET_WD = ... # type: Any +CHECKREAD = ... # type: Any +DISK_FULL = ... # type: Any +DUP_KEY = ... # type: Any +ERROR_ON_CLOSE = ... # type: Any +ERROR_ON_READ = ... # type: Any +ERROR_ON_RENAME = ... # type: Any +ERROR_ON_WRITE = ... # type: Any +FILE_USED = ... # type: Any +FILSORT_ABORT = ... # type: Any +FORM_NOT_FOUND = ... # type: Any +GET_ERRNO = ... # type: Any +ILLEGAL_HA = ... # type: Any +KEY_NOT_FOUND = ... # type: Any +NOT_FORM_FILE = ... # type: Any +NOT_KEYFILE = ... # type: Any +OLD_KEYFILE = ... # type: Any +OPEN_AS_READONLY = ... # type: Any +OUTOFMEMORY = ... # type: Any +OUT_OF_SORTMEMORY = ... # type: Any +UNEXPECTED_EOF = ... # type: Any +CON_COUNT_ERROR = ... # type: Any +OUT_OF_RESOURCES = ... # type: Any +BAD_HOST_ERROR = ... # type: Any +HANDSHAKE_ERROR = ... # type: Any +DBACCESS_DENIED_ERROR = ... # type: Any +ACCESS_DENIED_ERROR = ... # type: Any +NO_DB_ERROR = ... # type: Any +UNKNOWN_COM_ERROR = ... # type: Any +BAD_NULL_ERROR = ... # type: Any +BAD_DB_ERROR = ... # type: Any +TABLE_EXISTS_ERROR = ... # type: Any +BAD_TABLE_ERROR = ... # type: Any +NON_UNIQ_ERROR = ... # type: Any +SERVER_SHUTDOWN = ... # type: Any +BAD_FIELD_ERROR = ... # type: Any +WRONG_FIELD_WITH_GROUP = ... # type: Any +WRONG_GROUP_FIELD = ... # type: Any +WRONG_SUM_SELECT = ... # type: Any +WRONG_VALUE_COUNT = ... # type: Any +TOO_LONG_IDENT = ... # type: Any +DUP_FIELDNAME = ... # type: Any +DUP_KEYNAME = ... # type: Any +DUP_ENTRY = ... # type: Any +WRONG_FIELD_SPEC = ... # type: Any +PARSE_ERROR = ... # type: Any +EMPTY_QUERY = ... # type: Any +NONUNIQ_TABLE = ... # type: Any +INVALID_DEFAULT = ... # type: Any +MULTIPLE_PRI_KEY = ... # type: Any +TOO_MANY_KEYS = ... # type: Any +TOO_MANY_KEY_PARTS = ... # type: Any +TOO_LONG_KEY = ... # type: Any +KEY_COLUMN_DOES_NOT_EXITS = ... # type: Any +BLOB_USED_AS_KEY = ... # type: Any +TOO_BIG_FIELDLENGTH = ... # type: Any +WRONG_AUTO_KEY = ... # type: Any +READY = ... # type: Any +NORMAL_SHUTDOWN = ... # type: Any +GOT_SIGNAL = ... # type: Any +SHUTDOWN_COMPLETE = ... # type: Any +FORCING_CLOSE = ... # type: Any +IPSOCK_ERROR = ... # type: Any +NO_SUCH_INDEX = ... # type: Any +WRONG_FIELD_TERMINATORS = ... # type: Any +BLOBS_AND_NO_TERMINATED = ... # type: Any +TEXTFILE_NOT_READABLE = ... # type: Any +FILE_EXISTS_ERROR = ... # type: Any +LOAD_INFO = ... # type: Any +ALTER_INFO = ... # type: Any +WRONG_SUB_KEY = ... # type: Any +CANT_REMOVE_ALL_FIELDS = ... # type: Any +CANT_DROP_FIELD_OR_KEY = ... # type: Any +INSERT_INFO = ... # type: Any +UPDATE_TABLE_USED = ... # type: Any +NO_SUCH_THREAD = ... # type: Any +KILL_DENIED_ERROR = ... # type: Any +NO_TABLES_USED = ... # type: Any +TOO_BIG_SET = ... # type: Any +NO_UNIQUE_LOGFILE = ... # type: Any +TABLE_NOT_LOCKED_FOR_WRITE = ... # type: Any +TABLE_NOT_LOCKED = ... # type: Any +BLOB_CANT_HAVE_DEFAULT = ... # type: Any +WRONG_DB_NAME = ... # type: Any +WRONG_TABLE_NAME = ... # type: Any +TOO_BIG_SELECT = ... # type: Any +UNKNOWN_ERROR = ... # type: Any +UNKNOWN_PROCEDURE = ... # type: Any +WRONG_PARAMCOUNT_TO_PROCEDURE = ... # type: Any +WRONG_PARAMETERS_TO_PROCEDURE = ... # type: Any +UNKNOWN_TABLE = ... # type: Any +FIELD_SPECIFIED_TWICE = ... # type: Any +INVALID_GROUP_FUNC_USE = ... # type: Any +UNSUPPORTED_EXTENSION = ... # type: Any +TABLE_MUST_HAVE_COLUMNS = ... # type: Any +RECORD_FILE_FULL = ... # type: Any +UNKNOWN_CHARACTER_SET = ... # type: Any +TOO_MANY_TABLES = ... # type: Any +TOO_MANY_FIELDS = ... # type: Any +TOO_BIG_ROWSIZE = ... # type: Any +STACK_OVERRUN = ... # type: Any +WRONG_OUTER_JOIN = ... # type: Any +NULL_COLUMN_IN_INDEX = ... # type: Any +CANT_FIND_UDF = ... # type: Any +CANT_INITIALIZE_UDF = ... # type: Any +UDF_NO_PATHS = ... # type: Any +UDF_EXISTS = ... # type: Any +CANT_OPEN_LIBRARY = ... # type: Any +CANT_FIND_DL_ENTRY = ... # type: Any +FUNCTION_NOT_DEFINED = ... # type: Any +HOST_IS_BLOCKED = ... # type: Any +HOST_NOT_PRIVILEGED = ... # type: Any +PASSWORD_ANONYMOUS_USER = ... # type: Any +PASSWORD_NOT_ALLOWED = ... # type: Any +PASSWORD_NO_MATCH = ... # type: Any +UPDATE_INFO = ... # type: Any +CANT_CREATE_THREAD = ... # type: Any +WRONG_VALUE_COUNT_ON_ROW = ... # type: Any +CANT_REOPEN_TABLE = ... # type: Any +INVALID_USE_OF_NULL = ... # type: Any +REGEXP_ERROR = ... # type: Any +MIX_OF_GROUP_FUNC_AND_FIELDS = ... # type: Any +NONEXISTING_GRANT = ... # type: Any +TABLEACCESS_DENIED_ERROR = ... # type: Any +COLUMNACCESS_DENIED_ERROR = ... # type: Any +ILLEGAL_GRANT_FOR_TABLE = ... # type: Any +GRANT_WRONG_HOST_OR_USER = ... # type: Any +NO_SUCH_TABLE = ... # type: Any +NONEXISTING_TABLE_GRANT = ... # type: Any +NOT_ALLOWED_COMMAND = ... # type: Any +SYNTAX_ERROR = ... # type: Any +DELAYED_CANT_CHANGE_LOCK = ... # type: Any +TOO_MANY_DELAYED_THREADS = ... # type: Any +ABORTING_CONNECTION = ... # type: Any +NET_PACKET_TOO_LARGE = ... # type: Any +NET_READ_ERROR_FROM_PIPE = ... # type: Any +NET_FCNTL_ERROR = ... # type: Any +NET_PACKETS_OUT_OF_ORDER = ... # type: Any +NET_UNCOMPRESS_ERROR = ... # type: Any +NET_READ_ERROR = ... # type: Any +NET_READ_INTERRUPTED = ... # type: Any +NET_ERROR_ON_WRITE = ... # type: Any +NET_WRITE_INTERRUPTED = ... # type: Any +TOO_LONG_STRING = ... # type: Any +TABLE_CANT_HANDLE_BLOB = ... # type: Any +TABLE_CANT_HANDLE_AUTO_INCREMENT = ... # type: Any +DELAYED_INSERT_TABLE_LOCKED = ... # type: Any +WRONG_COLUMN_NAME = ... # type: Any +WRONG_KEY_COLUMN = ... # type: Any +WRONG_MRG_TABLE = ... # type: Any +DUP_UNIQUE = ... # type: Any +BLOB_KEY_WITHOUT_LENGTH = ... # type: Any +PRIMARY_CANT_HAVE_NULL = ... # type: Any +TOO_MANY_ROWS = ... # type: Any +REQUIRES_PRIMARY_KEY = ... # type: Any +NO_RAID_COMPILED = ... # type: Any +UPDATE_WITHOUT_KEY_IN_SAFE_MODE = ... # type: Any +KEY_DOES_NOT_EXITS = ... # type: Any +CHECK_NO_SUCH_TABLE = ... # type: Any +CHECK_NOT_IMPLEMENTED = ... # type: Any +CANT_DO_THIS_DURING_AN_TRANSACTION = ... # type: Any +ERROR_DURING_COMMIT = ... # type: Any +ERROR_DURING_ROLLBACK = ... # type: Any +ERROR_DURING_FLUSH_LOGS = ... # type: Any +ERROR_DURING_CHECKPOINT = ... # type: Any +NEW_ABORTING_CONNECTION = ... # type: Any +DUMP_NOT_IMPLEMENTED = ... # type: Any +FLUSH_MASTER_BINLOG_CLOSED = ... # type: Any +INDEX_REBUILD = ... # type: Any +MASTER = ... # type: Any +MASTER_NET_READ = ... # type: Any +MASTER_NET_WRITE = ... # type: Any +FT_MATCHING_KEY_NOT_FOUND = ... # type: Any +LOCK_OR_ACTIVE_TRANSACTION = ... # type: Any +UNKNOWN_SYSTEM_VARIABLE = ... # type: Any +CRASHED_ON_USAGE = ... # type: Any +CRASHED_ON_REPAIR = ... # type: Any +WARNING_NOT_COMPLETE_ROLLBACK = ... # type: Any +TRANS_CACHE_FULL = ... # type: Any +SLAVE_MUST_STOP = ... # type: Any +SLAVE_NOT_RUNNING = ... # type: Any +BAD_SLAVE = ... # type: Any +MASTER_INFO = ... # type: Any +SLAVE_THREAD = ... # type: Any +TOO_MANY_USER_CONNECTIONS = ... # type: Any +SET_CONSTANTS_ONLY = ... # type: Any +LOCK_WAIT_TIMEOUT = ... # type: Any +LOCK_TABLE_FULL = ... # type: Any +READ_ONLY_TRANSACTION = ... # type: Any +DROP_DB_WITH_READ_LOCK = ... # type: Any +CREATE_DB_WITH_READ_LOCK = ... # type: Any +WRONG_ARGUMENTS = ... # type: Any +NO_PERMISSION_TO_CREATE_USER = ... # type: Any +UNION_TABLES_IN_DIFFERENT_DIR = ... # type: Any +LOCK_DEADLOCK = ... # type: Any +TABLE_CANT_HANDLE_FT = ... # type: Any +CANNOT_ADD_FOREIGN = ... # type: Any +NO_REFERENCED_ROW = ... # type: Any +ROW_IS_REFERENCED = ... # type: Any +CONNECT_TO_MASTER = ... # type: Any +QUERY_ON_MASTER = ... # type: Any +ERROR_WHEN_EXECUTING_COMMAND = ... # type: Any +WRONG_USAGE = ... # type: Any +WRONG_NUMBER_OF_COLUMNS_IN_SELECT = ... # type: Any +CANT_UPDATE_WITH_READLOCK = ... # type: Any +MIXING_NOT_ALLOWED = ... # type: Any +DUP_ARGUMENT = ... # type: Any +USER_LIMIT_REACHED = ... # type: Any +SPECIFIC_ACCESS_DENIED_ERROR = ... # type: Any +LOCAL_VARIABLE = ... # type: Any +GLOBAL_VARIABLE = ... # type: Any +NO_DEFAULT = ... # type: Any +WRONG_VALUE_FOR_VAR = ... # type: Any +WRONG_TYPE_FOR_VAR = ... # type: Any +VAR_CANT_BE_READ = ... # type: Any +CANT_USE_OPTION_HERE = ... # type: Any +NOT_SUPPORTED_YET = ... # type: Any +MASTER_FATAL_ERROR_READING_BINLOG = ... # type: Any +SLAVE_IGNORED_TABLE = ... # type: Any +INCORRECT_GLOBAL_LOCAL_VAR = ... # type: Any +WRONG_FK_DEF = ... # type: Any +KEY_REF_DO_NOT_MATCH_TABLE_REF = ... # type: Any +OPERAND_COLUMNS = ... # type: Any +SUBQUERY_NO_1_ROW = ... # type: Any +UNKNOWN_STMT_HANDLER = ... # type: Any +CORRUPT_HELP_DB = ... # type: Any +CYCLIC_REFERENCE = ... # type: Any +AUTO_CONVERT = ... # type: Any +ILLEGAL_REFERENCE = ... # type: Any +DERIVED_MUST_HAVE_ALIAS = ... # type: Any +SELECT_REDUCED = ... # type: Any +TABLENAME_NOT_ALLOWED_HERE = ... # type: Any +NOT_SUPPORTED_AUTH_MODE = ... # type: Any +SPATIAL_CANT_HAVE_NULL = ... # type: Any +COLLATION_CHARSET_MISMATCH = ... # type: Any +SLAVE_WAS_RUNNING = ... # type: Any +SLAVE_WAS_NOT_RUNNING = ... # type: Any +TOO_BIG_FOR_UNCOMPRESS = ... # type: Any +ZLIB_Z_MEM_ERROR = ... # type: Any +ZLIB_Z_BUF_ERROR = ... # type: Any +ZLIB_Z_DATA_ERROR = ... # type: Any +CUT_VALUE_GROUP_CONCAT = ... # type: Any +WARN_TOO_FEW_RECORDS = ... # type: Any +WARN_TOO_MANY_RECORDS = ... # type: Any +WARN_NULL_TO_NOTNULL = ... # type: Any +WARN_DATA_OUT_OF_RANGE = ... # type: Any +WARN_DATA_TRUNCATED = ... # type: Any +WARN_USING_OTHER_HANDLER = ... # type: Any +CANT_AGGREGATE_2COLLATIONS = ... # type: Any +DROP_USER = ... # type: Any +REVOKE_GRANTS = ... # type: Any +CANT_AGGREGATE_3COLLATIONS = ... # type: Any +CANT_AGGREGATE_NCOLLATIONS = ... # type: Any +VARIABLE_IS_NOT_STRUCT = ... # type: Any +UNKNOWN_COLLATION = ... # type: Any +SLAVE_IGNORED_SSL_PARAMS = ... # type: Any +SERVER_IS_IN_SECURE_AUTH_MODE = ... # type: Any +WARN_FIELD_RESOLVED = ... # type: Any +BAD_SLAVE_UNTIL_COND = ... # type: Any +MISSING_SKIP_SLAVE = ... # type: Any +UNTIL_COND_IGNORED = ... # type: Any +WRONG_NAME_FOR_INDEX = ... # type: Any +WRONG_NAME_FOR_CATALOG = ... # type: Any +WARN_QC_RESIZE = ... # type: Any +BAD_FT_COLUMN = ... # type: Any +UNKNOWN_KEY_CACHE = ... # type: Any +WARN_HOSTNAME_WONT_WORK = ... # type: Any +UNKNOWN_STORAGE_ENGINE = ... # type: Any +WARN_DEPRECATED_SYNTAX = ... # type: Any +NON_UPDATABLE_TABLE = ... # type: Any +FEATURE_DISABLED = ... # type: Any +OPTION_PREVENTS_STATEMENT = ... # type: Any +DUPLICATED_VALUE_IN_TYPE = ... # type: Any +TRUNCATED_WRONG_VALUE = ... # type: Any +TOO_MUCH_AUTO_TIMESTAMP_COLS = ... # type: Any +INVALID_ON_UPDATE = ... # type: Any +UNSUPPORTED_PS = ... # type: Any +GET_ERRMSG = ... # type: Any +GET_TEMPORARY_ERRMSG = ... # type: Any +UNKNOWN_TIME_ZONE = ... # type: Any +WARN_INVALID_TIMESTAMP = ... # type: Any +INVALID_CHARACTER_STRING = ... # type: Any +WARN_ALLOWED_PACKET_OVERFLOWED = ... # type: Any +CONFLICTING_DECLARATIONS = ... # type: Any +SP_NO_RECURSIVE_CREATE = ... # type: Any +SP_ALREADY_EXISTS = ... # type: Any +SP_DOES_NOT_EXIST = ... # type: Any +SP_DROP_FAILED = ... # type: Any +SP_STORE_FAILED = ... # type: Any +SP_LILABEL_MISMATCH = ... # type: Any +SP_LABEL_REDEFINE = ... # type: Any +SP_LABEL_MISMATCH = ... # type: Any +SP_UNINIT_VAR = ... # type: Any +SP_BADSELECT = ... # type: Any +SP_BADRETURN = ... # type: Any +SP_BADSTATEMENT = ... # type: Any +UPDATE_LOG_DEPRECATED_IGNORED = ... # type: Any +UPDATE_LOG_DEPRECATED_TRANSLATED = ... # type: Any +QUERY_INTERRUPTED = ... # type: Any +SP_WRONG_NO_OF_ARGS = ... # type: Any +SP_COND_MISMATCH = ... # type: Any +SP_NORETURN = ... # type: Any +SP_NORETURNEND = ... # type: Any +SP_BAD_CURSOR_QUERY = ... # type: Any +SP_BAD_CURSOR_SELECT = ... # type: Any +SP_CURSOR_MISMATCH = ... # type: Any +SP_CURSOR_ALREADY_OPEN = ... # type: Any +SP_CURSOR_NOT_OPEN = ... # type: Any +SP_UNDECLARED_VAR = ... # type: Any +SP_WRONG_NO_OF_FETCH_ARGS = ... # type: Any +SP_FETCH_NO_DATA = ... # type: Any +SP_DUP_PARAM = ... # type: Any +SP_DUP_VAR = ... # type: Any +SP_DUP_COND = ... # type: Any +SP_DUP_CURS = ... # type: Any +SP_CANT_ALTER = ... # type: Any +SP_SUBSELECT_NYI = ... # type: Any +STMT_NOT_ALLOWED_IN_SF_OR_TRG = ... # type: Any +SP_VARCOND_AFTER_CURSHNDLR = ... # type: Any +SP_CURSOR_AFTER_HANDLER = ... # type: Any +SP_CASE_NOT_FOUND = ... # type: Any +FPARSER_TOO_BIG_FILE = ... # type: Any +FPARSER_BAD_HEADER = ... # type: Any +FPARSER_EOF_IN_COMMENT = ... # type: Any +FPARSER_ERROR_IN_PARAMETER = ... # type: Any +FPARSER_EOF_IN_UNKNOWN_PARAMETER = ... # type: Any +VIEW_NO_EXPLAIN = ... # type: Any +FRM_UNKNOWN_TYPE = ... # type: Any +WRONG_OBJECT = ... # type: Any +NONUPDATEABLE_COLUMN = ... # type: Any +VIEW_SELECT_DERIVED = ... # type: Any +VIEW_SELECT_CLAUSE = ... # type: Any +VIEW_SELECT_VARIABLE = ... # type: Any +VIEW_SELECT_TMPTABLE = ... # type: Any +VIEW_WRONG_LIST = ... # type: Any +WARN_VIEW_MERGE = ... # type: Any +WARN_VIEW_WITHOUT_KEY = ... # type: Any +VIEW_INVALID = ... # type: Any +SP_NO_DROP_SP = ... # type: Any +SP_GOTO_IN_HNDLR = ... # type: Any +TRG_ALREADY_EXISTS = ... # type: Any +TRG_DOES_NOT_EXIST = ... # type: Any +TRG_ON_VIEW_OR_TEMP_TABLE = ... # type: Any +TRG_CANT_CHANGE_ROW = ... # type: Any +TRG_NO_SUCH_ROW_IN_TRG = ... # type: Any +NO_DEFAULT_FOR_FIELD = ... # type: Any +DIVISION_BY_ZERO = ... # type: Any +TRUNCATED_WRONG_VALUE_FOR_FIELD = ... # type: Any +ILLEGAL_VALUE_FOR_TYPE = ... # type: Any +VIEW_NONUPD_CHECK = ... # type: Any +VIEW_CHECK_FAILED = ... # type: Any +PROCACCESS_DENIED_ERROR = ... # type: Any +RELAY_LOG_FAIL = ... # type: Any +PASSWD_LENGTH = ... # type: Any +UNKNOWN_TARGET_BINLOG = ... # type: Any +IO_ERR_LOG_INDEX_READ = ... # type: Any +BINLOG_PURGE_PROHIBITED = ... # type: Any +FSEEK_FAIL = ... # type: Any +BINLOG_PURGE_FATAL_ERR = ... # type: Any +LOG_IN_USE = ... # type: Any +LOG_PURGE_UNKNOWN_ERR = ... # type: Any +RELAY_LOG_INIT = ... # type: Any +NO_BINARY_LOGGING = ... # type: Any +RESERVED_SYNTAX = ... # type: Any +WSAS_FAILED = ... # type: Any +DIFF_GROUPS_PROC = ... # type: Any +NO_GROUP_FOR_PROC = ... # type: Any +ORDER_WITH_PROC = ... # type: Any +LOGGING_PROHIBIT_CHANGING_OF = ... # type: Any +NO_FILE_MAPPING = ... # type: Any +WRONG_MAGIC = ... # type: Any +PS_MANY_PARAM = ... # type: Any +KEY_PART_0 = ... # type: Any +VIEW_CHECKSUM = ... # type: Any +VIEW_MULTIUPDATE = ... # type: Any +VIEW_NO_INSERT_FIELD_LIST = ... # type: Any +VIEW_DELETE_MERGE_VIEW = ... # type: Any +CANNOT_USER = ... # type: Any +XAER_NOTA = ... # type: Any +XAER_INVAL = ... # type: Any +XAER_RMFAIL = ... # type: Any +XAER_OUTSIDE = ... # type: Any +XAER_RMERR = ... # type: Any +XA_RBROLLBACK = ... # type: Any +NONEXISTING_PROC_GRANT = ... # type: Any +PROC_AUTO_GRANT_FAIL = ... # type: Any +PROC_AUTO_REVOKE_FAIL = ... # type: Any +DATA_TOO_LONG = ... # type: Any +SP_BAD_SQLSTATE = ... # type: Any +STARTUP = ... # type: Any +LOAD_FROM_FIXED_SIZE_ROWS_TO_VAR = ... # type: Any +CANT_CREATE_USER_WITH_GRANT = ... # type: Any +WRONG_VALUE_FOR_TYPE = ... # type: Any +TABLE_DEF_CHANGED = ... # type: Any +SP_DUP_HANDLER = ... # type: Any +SP_NOT_VAR_ARG = ... # type: Any +SP_NO_RETSET = ... # type: Any +CANT_CREATE_GEOMETRY_OBJECT = ... # type: Any +FAILED_ROUTINE_BREAK_BINLOG = ... # type: Any +BINLOG_UNSAFE_ROUTINE = ... # type: Any +BINLOG_CREATE_ROUTINE_NEED_SUPER = ... # type: Any +EXEC_STMT_WITH_OPEN_CURSOR = ... # type: Any +STMT_HAS_NO_OPEN_CURSOR = ... # type: Any +COMMIT_NOT_ALLOWED_IN_SF_OR_TRG = ... # type: Any +NO_DEFAULT_FOR_VIEW_FIELD = ... # type: Any +SP_NO_RECURSION = ... # type: Any +TOO_BIG_SCALE = ... # type: Any +TOO_BIG_PRECISION = ... # type: Any +M_BIGGER_THAN_D = ... # type: Any +WRONG_LOCK_OF_SYSTEM_TABLE = ... # type: Any +CONNECT_TO_FOREIGN_DATA_SOURCE = ... # type: Any +QUERY_ON_FOREIGN_DATA_SOURCE = ... # type: Any +FOREIGN_DATA_SOURCE_DOESNT_EXIST = ... # type: Any +FOREIGN_DATA_STRING_INVALID_CANT_CREATE = ... # type: Any +FOREIGN_DATA_STRING_INVALID = ... # type: Any +CANT_CREATE_FEDERATED_TABLE = ... # type: Any +TRG_IN_WRONG_SCHEMA = ... # type: Any +STACK_OVERRUN_NEED_MORE = ... # type: Any +TOO_LONG_BODY = ... # type: Any +WARN_CANT_DROP_DEFAULT_KEYCACHE = ... # type: Any +TOO_BIG_DISPLAYWIDTH = ... # type: Any +XAER_DUPID = ... # type: Any +DATETIME_FUNCTION_OVERFLOW = ... # type: Any +CANT_UPDATE_USED_TABLE_IN_SF_OR_TRG = ... # type: Any +VIEW_PREVENT_UPDATE = ... # type: Any +PS_NO_RECURSION = ... # type: Any +SP_CANT_SET_AUTOCOMMIT = ... # type: Any +MALFORMED_DEFINER = ... # type: Any +VIEW_FRM_NO_USER = ... # type: Any +VIEW_OTHER_USER = ... # type: Any +NO_SUCH_USER = ... # type: Any +FORBID_SCHEMA_CHANGE = ... # type: Any +ROW_IS_REFERENCED_2 = ... # type: Any +NO_REFERENCED_ROW_2 = ... # type: Any +SP_BAD_VAR_SHADOW = ... # type: Any +TRG_NO_DEFINER = ... # type: Any +OLD_FILE_FORMAT = ... # type: Any +SP_RECURSION_LIMIT = ... # type: Any +SP_PROC_TABLE_CORRUPT = ... # type: Any +SP_WRONG_NAME = ... # type: Any +TABLE_NEEDS_UPGRADE = ... # type: Any +SP_NO_AGGREGATE = ... # type: Any +MAX_PREPARED_STMT_COUNT_REACHED = ... # type: Any +VIEW_RECURSIVE = ... # type: Any +NON_GROUPING_FIELD_USED = ... # type: Any +TABLE_CANT_HANDLE_SPKEYS = ... # type: Any +NO_TRIGGERS_ON_SYSTEM_SCHEMA = ... # type: Any +USERNAME = ... # type: Any +HOSTNAME = ... # type: Any +WRONG_STRING_LENGTH = ... # type: Any +ERROR_LAST = ... # type: Any diff --git a/third_party/3/pymysql/constants/FIELD_TYPE.pyi b/third_party/3/pymysql/constants/FIELD_TYPE.pyi new file mode 100644 index 000000000000..e9987b2397ee --- /dev/null +++ b/third_party/3/pymysql/constants/FIELD_TYPE.pyi @@ -0,0 +1,35 @@ +# Stubs for pymysql.constants.FIELD_TYPE (Python 3.5) +# +# NOTE: This dynamically typed stub was automatically generated by stubgen. + +from typing import Any + +DECIMAL = ... # type: Any +TINY = ... # type: Any +SHORT = ... # type: Any +LONG = ... # type: Any +FLOAT = ... # type: Any +DOUBLE = ... # type: Any +NULL = ... # type: Any +TIMESTAMP = ... # type: Any +LONGLONG = ... # type: Any +INT24 = ... # type: Any +DATE = ... # type: Any +TIME = ... # type: Any +DATETIME = ... # type: Any +YEAR = ... # type: Any +NEWDATE = ... # type: Any +VARCHAR = ... # type: Any +BIT = ... # type: Any +NEWDECIMAL = ... # type: Any +ENUM = ... # type: Any +SET = ... # type: Any +TINY_BLOB = ... # type: Any +MEDIUM_BLOB = ... # type: Any +LONG_BLOB = ... # type: Any +BLOB = ... # type: Any +VAR_STRING = ... # type: Any +STRING = ... # type: Any +GEOMETRY = ... # type: Any +CHAR = ... # type: Any +INTERVAL = ... # type: Any diff --git a/third_party/3/pymysql/constants/FLAG.pyi b/third_party/3/pymysql/constants/FLAG.pyi new file mode 100644 index 000000000000..792df90317e6 --- /dev/null +++ b/third_party/3/pymysql/constants/FLAG.pyi @@ -0,0 +1,21 @@ +# Stubs for pymysql.constants.FLAG (Python 3.5) +# +# NOTE: This dynamically typed stub was automatically generated by stubgen. + +from typing import Any + +NOT_NULL = ... # type: Any +PRI_KEY = ... # type: Any +UNIQUE_KEY = ... # type: Any +MULTIPLE_KEY = ... # type: Any +BLOB = ... # type: Any +UNSIGNED = ... # type: Any +ZEROFILL = ... # type: Any +BINARY = ... # type: Any +ENUM = ... # type: Any +AUTO_INCREMENT = ... # type: Any +TIMESTAMP = ... # type: Any +SET = ... # type: Any +PART_KEY = ... # type: Any +GROUP = ... # type: Any +UNIQUE = ... # type: Any diff --git a/third_party/3/pymysql/constants/SERVER_STATUS.pyi b/third_party/3/pymysql/constants/SERVER_STATUS.pyi new file mode 100644 index 000000000000..6e4db8d02260 --- /dev/null +++ b/third_party/3/pymysql/constants/SERVER_STATUS.pyi @@ -0,0 +1,16 @@ +# Stubs for pymysql.constants.SERVER_STATUS (Python 3.5) +# +# NOTE: This dynamically typed stub was automatically generated by stubgen. + +from typing import Any + +SERVER_STATUS_IN_TRANS = ... # type: Any +SERVER_STATUS_AUTOCOMMIT = ... # type: Any +SERVER_MORE_RESULTS_EXISTS = ... # type: Any +SERVER_QUERY_NO_GOOD_INDEX_USED = ... # type: Any +SERVER_QUERY_NO_INDEX_USED = ... # type: Any +SERVER_STATUS_CURSOR_EXISTS = ... # type: Any +SERVER_STATUS_LAST_ROW_SENT = ... # type: Any +SERVER_STATUS_DB_DROPPED = ... # type: Any +SERVER_STATUS_NO_BACKSLASH_ESCAPES = ... # type: Any +SERVER_STATUS_METADATA_CHANGED = ... # type: Any diff --git a/third_party/3/pymysql/constants/__init__.pyi b/third_party/3/pymysql/constants/__init__.pyi new file mode 100644 index 000000000000..05a022e9a7af --- /dev/null +++ b/third_party/3/pymysql/constants/__init__.pyi @@ -0,0 +1,4 @@ +# Stubs for pymysql.constants (Python 3.5) +# +# NOTE: This dynamically typed stub was automatically generated by stubgen. + diff --git a/third_party/3/pymysql/converters.pyi b/third_party/3/pymysql/converters.pyi new file mode 100644 index 000000000000..d9c8d293052c --- /dev/null +++ b/third_party/3/pymysql/converters.pyi @@ -0,0 +1,50 @@ +# Stubs for pymysql.converters (Python 3.5) +# +# NOTE: This dynamically typed stub was automatically generated by stubgen. + +from typing import Any +from .constants import FIELD_TYPE as FIELD_TYPE, FLAG as FLAG +from .charset import charset_by_id as charset_by_id + +PYTHON3 = ... # type: Any +ESCAPE_REGEX = ... # type: Any +ESCAPE_MAP = ... # type: Any + +def escape_item(val, charset): ... +def escape_dict(val, charset): ... +def escape_sequence(val, charset): ... +def escape_set(val, charset): ... +def escape_bool(value): ... +def escape_object(value): ... + +escape_int = ... # type: Any + +escape_long = ... # type: Any + +def escape_float(value): ... +def escape_string(value): ... +def escape_unicode(value): ... +def escape_None(value): ... +def escape_timedelta(obj): ... +def escape_time(obj): ... +def escape_datetime(obj): ... +def escape_date(obj): ... +def escape_struct_time(obj): ... +def convert_datetime(connection, field, obj): ... +def convert_timedelta(connection, field, obj): ... +def convert_time(connection, field, obj): ... +def convert_date(connection, field, obj): ... +def convert_mysql_timestamp(connection, field, timestamp): ... +def convert_set(s): ... +def convert_bit(connection, field, b): ... +def convert_characters(connection, field, data): ... +def convert_int(connection, field, data): ... +def convert_long(connection, field, data): ... +def convert_float(connection, field, data): ... + +encoders = ... # type: Any +decoders = ... # type: Any +conversions = ... # type: Any + +def convert_decimal(connection, field, data): ... +def escape_decimal(obj): ... diff --git a/third_party/3/pymysql/cursors.pyi b/third_party/3/pymysql/cursors.pyi new file mode 100644 index 000000000000..972205a19d00 --- /dev/null +++ b/third_party/3/pymysql/cursors.pyi @@ -0,0 +1,37 @@ +# Stubs for pymysql.cursors (Python 3.5) +# +# NOTE: This dynamically typed stub was automatically generated by stubgen. + +from typing import * +from .connections import Connection + +Gen = Union[Tuple[Any, ...], Dict[str, Any]] + +class Cursor: + connection = ... # type: Connection + description = ... # type: Tuple[str, ...] + rownumber = ... # type: int + rowcount = ... # type: int + arraysize = ... # type: int + messages = ... # type: Any + errorhandler = ... # type: Any + lastrowid = ... # type: int + def __init__(self, connection: Connection) -> None: ... + def __del__(self) -> None: ... + def close(self) -> None: ... + def setinputsizes(self, *args): ... + def setoutputsizes(self, *args): ... + def nextset(self): ... + def execute(self, query: str, args=None) -> int: ... + def executemany(self, query: str, args) -> int: ... + def callproc(self, procname, args=...): ... + def fetchone(self) -> Optional[Gen]: ... + def fetchmany(self, size: int = None) -> Optional[Gen]: ... + def fetchall(self) -> Optional[Tuple[Gen, ...]]: ... + def scroll(self, value, mode=''): ... + def __iter__(self): ... + +class DictCursor(Cursor): + def fetchone(self) -> Optional[Dict[str, Any]]: ... + def fetchmany(self, size=None) -> Optional[Tuple[Dict[str, Any], ...]]: ... + def fetchall(self) -> Optional[Tuple[Dict[str, Any], ...]]: ... diff --git a/third_party/3/pymysql/err.pyi b/third_party/3/pymysql/err.pyi new file mode 100644 index 000000000000..8d47723840a9 --- /dev/null +++ b/third_party/3/pymysql/err.pyi @@ -0,0 +1,22 @@ +# Stubs for pymysql.err (Python 3.5) +# +# NOTE: This dynamically typed stub was automatically generated by stubgen. + +from typing import * +from .constants import ER as ER + +class MySQLError(Exception): ... +class Warning(MySQLError): ... +class Error(MySQLError): ... +class InterfaceError(Error): ... +class DatabaseError(Error): ... +class DataError(DatabaseError): ... +class OperationalError(DatabaseError): ... +class IntegrityError(DatabaseError): ... +class InternalError(DatabaseError): ... +class ProgrammingError(DatabaseError): ... +class NotSupportedError(DatabaseError): ... + +error_map = ... # type: dict + +def raise_mysql_exception(data) -> None: ... diff --git a/third_party/3/pymysql/tests/__init__.pyi b/third_party/3/pymysql/tests/__init__.pyi new file mode 100644 index 000000000000..48da3285ca41 --- /dev/null +++ b/third_party/3/pymysql/tests/__init__.pyi @@ -0,0 +1,9 @@ +# Stubs for pymysql.tests (Python 3.5) +# +# NOTE: This dynamically typed stub was automatically generated by stubgen. + +from pymysql.tests.test_issues import * +from pymysql.tests.test_example import * +from pymysql.tests.test_basic import * +from pymysql.tests.test_DictCursor import * +from pymysql.tests.thirdparty import * diff --git a/third_party/3/pymysql/times.pyi b/third_party/3/pymysql/times.pyi new file mode 100644 index 000000000000..e96c99057acc --- /dev/null +++ b/third_party/3/pymysql/times.pyi @@ -0,0 +1,14 @@ +# Stubs for pymysql.times (Python 3.5) +# +# NOTE: This dynamically typed stub was automatically generated by stubgen. + +from typing import Any + +Date = ... # type: Any +Time = ... # type: Any +TimeDelta = ... # type: Any +Timestamp = ... # type: Any + +def DateFromTicks(ticks): ... +def TimeFromTicks(ticks): ... +def TimestampFromTicks(ticks): ... diff --git a/third_party/3/pymysql/util.pyi b/third_party/3/pymysql/util.pyi new file mode 100644 index 000000000000..2c2f7c0372d6 --- /dev/null +++ b/third_party/3/pymysql/util.pyi @@ -0,0 +1,7 @@ +# Stubs for pymysql.util (Python 3.5) +# +# NOTE: This dynamically typed stub was automatically generated by stubgen. + +def byte2int(b): ... +def int2byte(i): ... +def join_bytes(bs): ... From 6f0a29d13840a6cef54e39c4778dbfb6beff56a8 Mon Sep 17 00:00:00 2001 From: Gerhard Hagerer Date: Tue, 1 Nov 2016 10:56:08 +0100 Subject: [PATCH 2/4] Delete __init__.pyi tests make problems for mypy --- third_party/3/pymysql/tests/__init__.pyi | 9 --------- 1 file changed, 9 deletions(-) delete mode 100644 third_party/3/pymysql/tests/__init__.pyi diff --git a/third_party/3/pymysql/tests/__init__.pyi b/third_party/3/pymysql/tests/__init__.pyi deleted file mode 100644 index 48da3285ca41..000000000000 --- a/third_party/3/pymysql/tests/__init__.pyi +++ /dev/null @@ -1,9 +0,0 @@ -# Stubs for pymysql.tests (Python 3.5) -# -# NOTE: This dynamically typed stub was automatically generated by stubgen. - -from pymysql.tests.test_issues import * -from pymysql.tests.test_example import * -from pymysql.tests.test_basic import * -from pymysql.tests.test_DictCursor import * -from pymysql.tests.thirdparty import * From dd2950984cb989b160d3498b04cdc34d3b7c40c6 Mon Sep 17 00:00:00 2001 From: Gerhard Hagerer Date: Wed, 2 Nov 2016 10:01:46 +0100 Subject: [PATCH 3/4] added sqlalchemy to third_party/2and3 just changed sqlalchemy/util/compat:37 unicode -> str, everything else is unchanged --- third_party/2and3/sqlalchemy/__init__.pyi | 124 ++++++ .../2and3/sqlalchemy/databases/__init__.pyi | 12 + .../2and3/sqlalchemy/databases/mysql.pyi | 1 + .../2and3/sqlalchemy/dialects/__init__.pyi | 12 + .../sqlalchemy/dialects/mysql/__init__.pyi | 40 ++ .../2and3/sqlalchemy/dialects/mysql/base.pyi | 413 ++++++++++++++++++ .../2and3/sqlalchemy/engine/__init__.pyi | 11 + third_party/2and3/sqlalchemy/engine/base.pyi | 21 + .../2and3/sqlalchemy/engine/strategies.pyi | 39 ++ third_party/2and3/sqlalchemy/engine/url.pyi | 27 ++ third_party/2and3/sqlalchemy/exc.pyi | 77 ++++ third_party/2and3/sqlalchemy/inspection.pyi | 5 + third_party/2and3/sqlalchemy/log.pyi | 14 + third_party/2and3/sqlalchemy/orm/__init__.pyi | 95 ++++ third_party/2and3/sqlalchemy/orm/session.pyi | 93 ++++ third_party/2and3/sqlalchemy/pool.pyi | 118 +++++ third_party/2and3/sqlalchemy/schema.pyi | 50 +++ third_party/2and3/sqlalchemy/sql/__init__.pyi | 66 +++ .../2and3/sqlalchemy/sql/annotation.pyi | 11 + third_party/2and3/sqlalchemy/sql/base.pyi | 42 ++ third_party/2and3/sqlalchemy/sql/ddl.pyi | 25 ++ third_party/2and3/sqlalchemy/sql/dml.pyi | 20 + third_party/2and3/sqlalchemy/sql/elements.pyi | 60 +++ .../2and3/sqlalchemy/sql/expression.pyi | 87 ++++ .../2and3/sqlalchemy/sql/functions.pyi | 47 ++ third_party/2and3/sqlalchemy/sql/naming.pyi | 1 + .../2and3/sqlalchemy/sql/operators.pyi | 99 +++++ third_party/2and3/sqlalchemy/sql/schema.pyi | 126 ++++++ .../2and3/sqlalchemy/sql/selectable.pyi | 74 ++++ third_party/2and3/sqlalchemy/sql/sqltypes.pyi | 62 +++ third_party/2and3/sqlalchemy/sql/type_api.pyi | 9 + third_party/2and3/sqlalchemy/sql/visitors.pyi | 33 ++ third_party/2and3/sqlalchemy/types.pyi | 51 +++ .../2and3/sqlalchemy/util/__init__.pyi | 133 ++++++ .../2and3/sqlalchemy/util/_collections.pyi | 214 +++++++++ third_party/2and3/sqlalchemy/util/compat.pyi | 67 +++ .../2and3/sqlalchemy/util/deprecations.pyi | 13 + .../2and3/sqlalchemy/util/langhelpers.pyi | 134 ++++++ 38 files changed, 2526 insertions(+) create mode 100644 third_party/2and3/sqlalchemy/__init__.pyi create mode 100644 third_party/2and3/sqlalchemy/databases/__init__.pyi create mode 100644 third_party/2and3/sqlalchemy/databases/mysql.pyi create mode 100644 third_party/2and3/sqlalchemy/dialects/__init__.pyi create mode 100644 third_party/2and3/sqlalchemy/dialects/mysql/__init__.pyi create mode 100644 third_party/2and3/sqlalchemy/dialects/mysql/base.pyi create mode 100644 third_party/2and3/sqlalchemy/engine/__init__.pyi create mode 100644 third_party/2and3/sqlalchemy/engine/base.pyi create mode 100644 third_party/2and3/sqlalchemy/engine/strategies.pyi create mode 100644 third_party/2and3/sqlalchemy/engine/url.pyi create mode 100644 third_party/2and3/sqlalchemy/exc.pyi create mode 100644 third_party/2and3/sqlalchemy/inspection.pyi create mode 100644 third_party/2and3/sqlalchemy/log.pyi create mode 100644 third_party/2and3/sqlalchemy/orm/__init__.pyi create mode 100644 third_party/2and3/sqlalchemy/orm/session.pyi create mode 100644 third_party/2and3/sqlalchemy/pool.pyi create mode 100644 third_party/2and3/sqlalchemy/schema.pyi create mode 100644 third_party/2and3/sqlalchemy/sql/__init__.pyi create mode 100644 third_party/2and3/sqlalchemy/sql/annotation.pyi create mode 100644 third_party/2and3/sqlalchemy/sql/base.pyi create mode 100644 third_party/2and3/sqlalchemy/sql/ddl.pyi create mode 100644 third_party/2and3/sqlalchemy/sql/dml.pyi create mode 100644 third_party/2and3/sqlalchemy/sql/elements.pyi create mode 100644 third_party/2and3/sqlalchemy/sql/expression.pyi create mode 100644 third_party/2and3/sqlalchemy/sql/functions.pyi create mode 100644 third_party/2and3/sqlalchemy/sql/naming.pyi create mode 100644 third_party/2and3/sqlalchemy/sql/operators.pyi create mode 100644 third_party/2and3/sqlalchemy/sql/schema.pyi create mode 100644 third_party/2and3/sqlalchemy/sql/selectable.pyi create mode 100644 third_party/2and3/sqlalchemy/sql/sqltypes.pyi create mode 100644 third_party/2and3/sqlalchemy/sql/type_api.pyi create mode 100644 third_party/2and3/sqlalchemy/sql/visitors.pyi create mode 100644 third_party/2and3/sqlalchemy/types.pyi create mode 100644 third_party/2and3/sqlalchemy/util/__init__.pyi create mode 100644 third_party/2and3/sqlalchemy/util/_collections.pyi create mode 100644 third_party/2and3/sqlalchemy/util/compat.pyi create mode 100644 third_party/2and3/sqlalchemy/util/deprecations.pyi create mode 100644 third_party/2and3/sqlalchemy/util/langhelpers.pyi diff --git a/third_party/2and3/sqlalchemy/__init__.pyi b/third_party/2and3/sqlalchemy/__init__.pyi new file mode 100644 index 000000000000..717082c1897c --- /dev/null +++ b/third_party/2and3/sqlalchemy/__init__.pyi @@ -0,0 +1,124 @@ +# Stubs for sqlalchemy (Python 2) + +from .sql import ( + alias, + and_, + asc, + between, + bindparam, + case, + cast, + collate, + column, + delete, + desc, + distinct, + except_, + except_all, + exists, + extract, + false, + func, + funcfilter, + insert, + intersect, + intersect_all, + join, + literal, + literal_column, + modifier, + not_, + null, + or_, + outerjoin, + outparam, + over, + select, + subquery, + table, + text, + true, + tuple_, + type_coerce, + union, + union_all, + update, + ) + +from .types import ( + BIGINT, + BINARY, + BLOB, + BOOLEAN, + BigInteger, + Binary, + Boolean, + CHAR, + CLOB, + DATE, + DATETIME, + DECIMAL, + Date, + DateTime, + Enum, + FLOAT, + Float, + INT, + INTEGER, + Integer, + Interval, + LargeBinary, + NCHAR, + NVARCHAR, + NUMERIC, + Numeric, + PickleType, + REAL, + SMALLINT, + SmallInteger, + String, + TEXT, + TIME, + TIMESTAMP, + Text, + Time, + TypeDecorator, + Unicode, + UnicodeText, + VARBINARY, + VARCHAR, + ) + +from .schema import ( + CheckConstraint, + Column, + ColumnDefault, + Constraint, + DefaultClause, + FetchedValue, + ForeignKey, + ForeignKeyConstraint, + Index, + MetaData, + PassiveDefault, + PrimaryKeyConstraint, + Sequence, + Table, + ThreadLocalMetaData, + UniqueConstraint, + DDL, +) + +from . import sql as sql +from . import schema as schema +from . import types as types +from . import exc as exc +from . import dialects as dialects +from . import pool as pool +# This should re-export orm but orm is totally broken right now +# from . import orm as orm + +from .inspection import inspect +from .engine import create_engine, engine_from_config + +__version__ = ... # type: int diff --git a/third_party/2and3/sqlalchemy/databases/__init__.pyi b/third_party/2and3/sqlalchemy/databases/__init__.pyi new file mode 100644 index 000000000000..b1ac4a4d18a3 --- /dev/null +++ b/third_party/2and3/sqlalchemy/databases/__init__.pyi @@ -0,0 +1,12 @@ +# Stubs for sqlalchemy.databases (Python 2) +# +# NOTE: This dynamically typed stub was automatically generated by stubgen. + +# Names in __all__ with no definition: +# firebird +# mssql +# mysql +# oracle +# postgresql +# sqlite +# sybase diff --git a/third_party/2and3/sqlalchemy/databases/mysql.pyi b/third_party/2and3/sqlalchemy/databases/mysql.pyi new file mode 100644 index 000000000000..c218c50b754f --- /dev/null +++ b/third_party/2and3/sqlalchemy/databases/mysql.pyi @@ -0,0 +1 @@ +from sqlalchemy.dialects.mysql.base import * diff --git a/third_party/2and3/sqlalchemy/dialects/__init__.pyi b/third_party/2and3/sqlalchemy/dialects/__init__.pyi new file mode 100644 index 000000000000..2d261de1b9ff --- /dev/null +++ b/third_party/2and3/sqlalchemy/dialects/__init__.pyi @@ -0,0 +1,12 @@ +# Stubs for sqlalchemy.dialects (Python 2) +# +# NOTE: This dynamically typed stub was automatically generated by stubgen. + +# Names in __all__ with no definition: +# firebird +# mssql +# mysql +# oracle +# postgresql +# sqlite +# sybase diff --git a/third_party/2and3/sqlalchemy/dialects/mysql/__init__.pyi b/third_party/2and3/sqlalchemy/dialects/mysql/__init__.pyi new file mode 100644 index 000000000000..846c3b4fcb7f --- /dev/null +++ b/third_party/2and3/sqlalchemy/dialects/mysql/__init__.pyi @@ -0,0 +1,40 @@ +# Stubs for sqlalchemy.dialects.mysql (Python 2) +# +# NOTE: This dynamically typed stub was automatically generated by stubgen. + +from . import base + +BIGINT = base.BIGINT +BINARY = base.BINARY +BIT = base.BIT +BLOB = base.BLOB +BOOLEAN = base.BOOLEAN +CHAR = base.CHAR +DATE = base.DATE +DATETIME = base.DATETIME +DECIMAL = base.DECIMAL +DOUBLE = base.DOUBLE +ENUM = base.ENUM +FLOAT = base.FLOAT +INTEGER = base.INTEGER +LONGBLOB = base.LONGBLOB +LONGTEXT = base.LONGTEXT +MEDIUMBLOB = base.MEDIUMBLOB +MEDIUMINT = base.MEDIUMINT +MEDIUMTEXT = base.MEDIUMTEXT +NCHAR = base.NCHAR +NVARCHAR = base.NVARCHAR +NUMERIC = base.NUMERIC +SET = base.SET +SMALLINT = base.SMALLINT +REAL = base.REAL +TEXT = base.TEXT +TIME = base.TIME +TIMESTAMP = base.TIMESTAMP +TINYBLOB = base.TINYBLOB +TINYINT = base.TINYINT +TINYTEXT = base.TINYTEXT +VARBINARY = base.VARBINARY +VARCHAR = base.VARCHAR +YEAR = base.YEAR +## dialect = base.dialect diff --git a/third_party/2and3/sqlalchemy/dialects/mysql/base.pyi b/third_party/2and3/sqlalchemy/dialects/mysql/base.pyi new file mode 100644 index 000000000000..ac967d83847d --- /dev/null +++ b/third_party/2and3/sqlalchemy/dialects/mysql/base.pyi @@ -0,0 +1,413 @@ +# Stubs for sqlalchemy.dialects.mysql.base (Python 2) +# +# NOTE: This dynamically typed stub was automatically generated by stubgen. + +from typing import Any +from ... import sql +from ... import engine +from ... import util +from ... import types + +sqltypes = sql.sqltypes +## compiler = sql.compiler +## reflection = engine.reflection +## default = engine.default +## topological = util.topological +DATE = types.DATE +BOOLEAN = types.BOOLEAN +BLOB = types.BLOB +BINARY = types.BINARY +VARBINARY = types.VARBINARY + +RESERVED_WORDS = ... # type: Any +AUTOCOMMIT_RE = ... # type: Any +SET_RE = ... # type: Any + +class _NumericType: + unsigned = ... # type: Any + zerofill = ... # type: Any + def __init__(self, unsigned=..., zerofill=..., **kw) -> None: ... + +class _FloatType(_NumericType, + ## sqltypes.Float + ): + scale = ... # type: Any + def __init__(self, precision=..., scale=..., asdecimal=..., **kw) -> None: ... + +class _IntegerType(_NumericType, + ## sqltypes.Integer + ): + display_width = ... # type: Any + def __init__(self, display_width=..., **kw) -> None: ... + +class _StringType(object, + ## sqltypes.String + ): + charset = ... # type: Any + ascii = ... # type: Any + unicode = ... # type: Any + binary = ... # type: Any + national = ... # type: Any + def __init__(self, charset=..., collation=..., ascii=..., binary=..., unicode=..., national=..., **kw) -> None: ... + +class _MatchType(object, + ## sqltypes.Float, + ## sqltypes.MatchType + ): + def __init__(self, **kw) -> None: ... + +class NUMERIC(_NumericType, + ## sqltypes.NUMERIC + ): + __visit_name__ = ... # type: Any + def __init__(self, precision=..., scale=..., asdecimal=..., **kw) -> None: ... + +class DECIMAL(_NumericType, + ## sqltypes.DECIMAL + ): + __visit_name__ = ... # type: Any + def __init__(self, precision=..., scale=..., asdecimal=..., **kw) -> None: ... + +class DOUBLE(_FloatType): + __visit_name__ = ... # type: Any + def __init__(self, precision=..., scale=..., asdecimal=..., **kw) -> None: ... + +class REAL(_FloatType, + ## sqltypes.REAL + ): + __visit_name__ = ... # type: Any + def __init__(self, precision=..., scale=..., asdecimal=..., **kw) -> None: ... + +class FLOAT(_FloatType, + ## sqltypes.FLOAT + ): + __visit_name__ = ... # type: Any + def __init__(self, precision=..., scale=..., asdecimal=..., **kw) -> None: ... + def bind_processor(self, dialect): ... + +class INTEGER(_IntegerType, + ## sqltypes.INTEGER + ): + __visit_name__ = ... # type: Any + def __init__(self, display_width=..., **kw) -> None: ... + +class BIGINT(_IntegerType, + ## sqltypes.BIGINT + ): + __visit_name__ = ... # type: Any + def __init__(self, display_width=..., **kw) -> None: ... + +class MEDIUMINT(_IntegerType): + __visit_name__ = ... # type: Any + def __init__(self, display_width=..., **kw) -> None: ... + +class TINYINT(_IntegerType): + __visit_name__ = ... # type: Any + def __init__(self, display_width=..., **kw) -> None: ... + +class SMALLINT(_IntegerType, + ## sqltypes.SMALLINT + ): + __visit_name__ = ... # type: Any + def __init__(self, display_width=..., **kw) -> None: ... + +class BIT(object, + ## sqltypes.TypeEngine + ): + __visit_name__ = ... # type: Any + length = ... # type: Any + def __init__(self, length=...) -> None: ... + def result_processor(self, dialect, coltype): ... + +class TIME(object, + ## sqltypes.TIME + ): + __visit_name__ = ... # type: Any + fsp = ... # type: Any + def __init__(self, timezone=..., fsp=...) -> None: ... + def result_processor(self, dialect, coltype): ... + +class TIMESTAMP(object, + ## sqltypes.TIMESTAMP + ): + __visit_name__ = ... # type: Any + fsp = ... # type: Any + def __init__(self, timezone=..., fsp=...) -> None: ... + +class DATETIME(object, + ## sqltypes.DATETIME + ): + __visit_name__ = ... # type: Any + fsp = ... # type: Any + def __init__(self, timezone=..., fsp=...) -> None: ... + +class YEAR(object, + ## sqltypes.TypeEngine + ): + __visit_name__ = ... # type: Any + display_width = ... # type: Any + def __init__(self, display_width=...) -> None: ... + +class TEXT(_StringType, + ## sqltypes.TEXT + ): + __visit_name__ = ... # type: Any + def __init__(self, length=..., **kw) -> None: ... + +class TINYTEXT(_StringType): + __visit_name__ = ... # type: Any + def __init__(self, **kwargs) -> None: ... + +class MEDIUMTEXT(_StringType): + __visit_name__ = ... # type: Any + def __init__(self, **kwargs) -> None: ... + +class LONGTEXT(_StringType): + __visit_name__ = ... # type: Any + def __init__(self, **kwargs) -> None: ... + +class VARCHAR(_StringType, + ## sqltypes.VARCHAR + ): + __visit_name__ = ... # type: Any + def __init__(self, length=..., **kwargs) -> None: ... + +class CHAR(_StringType, + ## sqltypes.CHAR + ): + __visit_name__ = ... # type: Any + def __init__(self, length=..., **kwargs) -> None: ... + +class NVARCHAR(_StringType, + ## sqltypes.NVARCHAR + ): + __visit_name__ = ... # type: Any + def __init__(self, length=..., **kwargs) -> None: ... + +class NCHAR(_StringType, + ## sqltypes.NCHAR + ): + __visit_name__ = ... # type: Any + def __init__(self, length=..., **kwargs) -> None: ... + +class TINYBLOB(object, + ## sqltypes._Binary + ): + __visit_name__ = ... # type: Any + +class MEDIUMBLOB(object, + ## sqltypes._Binary + ): + __visit_name__ = ... # type: Any + +class LONGBLOB(object, + ## sqltypes._Binary + ): + __visit_name__ = ... # type: Any + +class _EnumeratedValues(_StringType): ... + +class ENUM(## sqltypes.Enum, + _EnumeratedValues + ): + __visit_name__ = ... # type: Any + strict = ... # type: Any + def __init__(self, *enums, **kw) -> None: ... + def bind_processor(self, dialect): ... + def adapt(self, cls, **kw): ... + +class SET(_EnumeratedValues): + __visit_name__ = ... # type: Any + retrieve_as_bitwise = ... # type: Any + values = ... # type: Any + def __init__(self, *values, **kw) -> None: ... + def column_expression(self, colexpr): ... + def result_processor(self, dialect, coltype): ... + def bind_processor(self, dialect): ... + def adapt(self, impltype, **kw): ... + +MSTime = ... # type: Any +MSSet = ... # type: Any +MSEnum = ... # type: Any +MSLongBlob = ... # type: Any +MSMediumBlob = ... # type: Any +MSTinyBlob = ... # type: Any +MSBlob = ... # type: Any +MSBinary = ... # type: Any +MSVarBinary = ... # type: Any +MSNChar = ... # type: Any +MSNVarChar = ... # type: Any +MSChar = ... # type: Any +MSString = ... # type: Any +MSLongText = ... # type: Any +MSMediumText = ... # type: Any +MSTinyText = ... # type: Any +MSText = ... # type: Any +MSYear = ... # type: Any +MSTimeStamp = ... # type: Any +MSBit = ... # type: Any +MSSmallInteger = ... # type: Any +MSTinyInteger = ... # type: Any +MSMediumInteger = ... # type: Any +MSBigInteger = ... # type: Any +MSNumeric = ... # type: Any +MSDecimal = ... # type: Any +MSDouble = ... # type: Any +MSReal = ... # type: Any +MSFloat = ... # type: Any +MSInteger = ... # type: Any +colspecs = ... # type: Any +ischema_names = ... # type: Any + +class MySQLExecutionContext(object, + ## default.DefaultExecutionContext + ): + def should_autocommit_text(self, statement): ... + +class MySQLCompiler(object, + ## compiler.SQLCompiler + ): + render_table_with_column_in_update_from = ... # type: Any + extract_map = ... # type: Any + def visit_random_func(self, fn, **kw): ... + def visit_utc_timestamp_func(self, fn, **kw): ... + def visit_sysdate_func(self, fn, **kw): ... + def visit_concat_op_binary(self, binary, operator, **kw): ... + def visit_match_op_binary(self, binary, operator, **kw): ... + def get_from_hint_text(self, table, text): ... + def visit_typeclause(self, typeclause, type_=...): ... + def visit_cast(self, cast, **kwargs): ... + def render_literal_value(self, value, type_): ... + def visit_true(self, element, **kw): ... + def visit_false(self, element, **kw): ... + def get_select_precolumns(self, select, **kw): ... + def visit_join(self, join, asfrom=..., **kwargs): ... + def for_update_clause(self, select, **kw): ... + def limit_clause(self, select, **kw): ... + def update_limit_clause(self, update_stmt): ... + def update_tables_clause(self, update_stmt, from_table, extra_froms, **kw): ... + def update_from_clause(self, update_stmt, from_table, extra_froms, from_hints, **kw): ... + +class MySQLDDLCompiler(object, + ## compiler.DDLCompiler + ): + def create_table_constraints(self, table, **kw): ... + def get_column_specification(self, column, **kw): ... + def post_create_table(self, table): ... + def visit_create_index(self, create): ... + def visit_primary_key_constraint(self, constraint): ... + def visit_drop_index(self, drop): ... + def visit_drop_constraint(self, drop): ... + def define_constraint_match(self, constraint): ... + +class MySQLTypeCompiler(object, + ## compiler.GenericTypeCompiler + ): + def visit_NUMERIC(self, type_, **kw): ... + def visit_DECIMAL(self, type_, **kw): ... + def visit_DOUBLE(self, type_, **kw): ... + def visit_REAL(self, type_, **kw): ... + def visit_FLOAT(self, type_, **kw): ... + def visit_INTEGER(self, type_, **kw): ... + def visit_BIGINT(self, type_, **kw): ... + def visit_MEDIUMINT(self, type_, **kw): ... + def visit_TINYINT(self, type_, **kw): ... + def visit_SMALLINT(self, type_, **kw): ... + def visit_BIT(self, type_, **kw): ... + def visit_DATETIME(self, type_, **kw): ... + def visit_DATE(self, type_, **kw): ... + def visit_TIME(self, type_, **kw): ... + def visit_TIMESTAMP(self, type_, **kw): ... + def visit_YEAR(self, type_, **kw): ... + def visit_TEXT(self, type_, **kw): ... + def visit_TINYTEXT(self, type_, **kw): ... + def visit_MEDIUMTEXT(self, type_, **kw): ... + def visit_LONGTEXT(self, type_, **kw): ... + def visit_VARCHAR(self, type_, **kw): ... + def visit_CHAR(self, type_, **kw): ... + def visit_NVARCHAR(self, type_, **kw): ... + def visit_NCHAR(self, type_, **kw): ... + def visit_VARBINARY(self, type_, **kw): ... + def visit_large_binary(self, type_, **kw): ... + def visit_enum(self, type_, **kw): ... + def visit_BLOB(self, type_, **kw): ... + def visit_TINYBLOB(self, type_, **kw): ... + def visit_MEDIUMBLOB(self, type_, **kw): ... + def visit_LONGBLOB(self, type_, **kw): ... + def visit_ENUM(self, type_, **kw): ... + def visit_SET(self, type_, **kw): ... + def visit_BOOLEAN(self, type, **kw): ... + +class MySQLIdentifierPreparer(object, + ## compiler.IdentifierPreparer + ): + reserved_words = ... # type: Any + def __init__(self, dialect, server_ansiquotes=..., **kw) -> None: ... + +class MySQLDialect(object, + ## default.DefaultDialect + ): + name = ... # type: Any + supports_alter = ... # type: Any + supports_native_boolean = ... # type: Any + max_identifier_length = ... # type: Any + max_index_name_length = ... # type: Any + supports_native_enum = ... # type: Any + supports_sane_rowcount = ... # type: Any + supports_sane_multi_rowcount = ... # type: Any + supports_multivalues_insert = ... # type: Any + default_paramstyle = ... # type: Any + colspecs = ... # type: Any + statement_compiler = ... # type: Any + ddl_compiler = ... # type: Any + type_compiler = ... # type: Any + ischema_names = ... # type: Any + preparer = ... # type: Any + construct_arguments = ... # type: Any + isolation_level = ... # type: Any + def __init__(self, isolation_level=..., **kwargs) -> None: ... + def on_connect(self): ... + def set_isolation_level(self, connection, level): ... + def get_isolation_level(self, connection): ... + def do_commit(self, dbapi_connection): ... + def do_rollback(self, dbapi_connection): ... + def do_begin_twophase(self, connection, xid): ... + def do_prepare_twophase(self, connection, xid): ... + def do_rollback_twophase(self, connection, xid, is_prepared=..., recover=...): ... + def do_commit_twophase(self, connection, xid, is_prepared=..., recover=...): ... + def do_recover_twophase(self, connection): ... + def is_disconnect(self, e, connection, cursor): ... + def has_table(self, connection, table_name, schema=...): ... + identifier_preparer = ... # type: Any + def initialize(self, connection): ... + def get_schema_names(self, connection, **kw): ... + def get_table_names(self, connection, schema=..., **kw): ... + def get_view_names(self, connection, schema=..., **kw): ... + def get_table_options(self, connection, table_name, schema=..., **kw): ... + def get_columns(self, connection, table_name, schema=..., **kw): ... + def get_pk_constraint(self, connection, table_name, schema=..., **kw): ... + def get_foreign_keys(self, connection, table_name, schema=..., **kw): ... + def get_indexes(self, connection, table_name, schema=..., **kw): ... + def get_unique_constraints(self, connection, table_name, schema=..., **kw): ... + def get_view_definition(self, connection, view_name, schema=..., **kw): ... + +class ReflectedState: + columns = ... # type: Any + table_options = ... # type: Any + table_name = ... # type: Any + keys = ... # type: Any + constraints = ... # type: Any + def __init__(self) -> None: ... + +class MySQLTableDefinitionParser: + dialect = ... # type: Any + preparer = ... # type: Any + def __init__(self, dialect, preparer) -> None: ... + def parse(self, show_create, charset): ... + +class _DecodingRowProxy: + rowproxy = ... # type: Any + charset = ... # type: Any + def __init__(self, rowproxy, charset) -> None: ... + def __getitem__(self, index): ... + def __getattr__(self, attr): ... diff --git a/third_party/2and3/sqlalchemy/engine/__init__.pyi b/third_party/2and3/sqlalchemy/engine/__init__.pyi new file mode 100644 index 000000000000..49eca6d67b16 --- /dev/null +++ b/third_party/2and3/sqlalchemy/engine/__init__.pyi @@ -0,0 +1,11 @@ +# Stubs for sqlalchemy.engine (Python 2) +# +# NOTE: This dynamically typed stub was automatically generated by stubgen. + +from .base import Connection as Connection +from .base import Engine as Engine +from .base import RowProxy as RowProxy +from .base import Transaction as Transaction + +def create_engine(*args, **kwargs): ... +def engine_from_config(configuration, prefix=..., **kwargs): ... diff --git a/third_party/2and3/sqlalchemy/engine/base.pyi b/third_party/2and3/sqlalchemy/engine/base.pyi new file mode 100644 index 000000000000..71f6e196afb0 --- /dev/null +++ b/third_party/2and3/sqlalchemy/engine/base.pyi @@ -0,0 +1,21 @@ +from typing import Any, List, Tuple + +# Dummy until I figure out something better. +class Connectable: + pass + +class Connection: + def begin(self): ... + def execute(self, object, *multiparams, **params): ... + +class Engine(object): ... + +class RowProxy: + def items(self) -> List[Tuple[Any, Any]]: ... + def keys(self) -> List[Any]: ... + def values(self) -> List[Any]: ... + def __getitem__(self, key: str): ... + +class Transaction: + def commit(self): ... + def rollback(self): ... diff --git a/third_party/2and3/sqlalchemy/engine/strategies.pyi b/third_party/2and3/sqlalchemy/engine/strategies.pyi new file mode 100644 index 000000000000..372643ce004d --- /dev/null +++ b/third_party/2and3/sqlalchemy/engine/strategies.pyi @@ -0,0 +1,39 @@ +# Stubs for sqlalchemy.engine.strategies (Python 2) +# +# NOTE: This dynamically typed stub was automatically generated by stubgen. + +from typing import Any + +from . import base + +strategies = ... # type: Any + +class EngineStrategy: + def __init__(self) -> None: ... + def create(self, *args, **kwargs): ... + +class DefaultEngineStrategy(EngineStrategy): + def create(self, name_or_url, **kwargs): ... + +class PlainEngineStrategy(DefaultEngineStrategy): + name = ... # type: Any + engine_cls = ... # type: Any + +class ThreadLocalEngineStrategy(DefaultEngineStrategy): + name = ... # type: Any + engine_cls = ... # type: Any + +class MockEngineStrategy(EngineStrategy): + name = ... # type: Any + def create(self, name_or_url, executor, **kwargs): ... + class MockConnection(base.Connectable): + def __init__(self, dialect, execute) -> None: ... + engine = ... # type: Any + dialect = ... # type: Any + name = ... # type: Any + def contextual_connect(self, **kwargs): ... + def execution_options(self, **kw): ... + def compiler(self, statement, parameters, **kwargs): ... + def create(self, entity, **kwargs): ... + def drop(self, entity, **kwargs): ... + def execute(self, object, *multiparams, **params): ... diff --git a/third_party/2and3/sqlalchemy/engine/url.pyi b/third_party/2and3/sqlalchemy/engine/url.pyi new file mode 100644 index 000000000000..b422ec9458b4 --- /dev/null +++ b/third_party/2and3/sqlalchemy/engine/url.pyi @@ -0,0 +1,27 @@ +# Stubs for sqlalchemy.engine.url (Python 2) +# +# NOTE: This dynamically typed stub was automatically generated by stubgen. + +from typing import Any +from .. import dialects + +## registry = dialects.registry + +class URL: + drivername = ... # type: Any + username = ... # type: Any + password = ... # type: Any + host = ... # type: Any + port = ... # type: Any + database = ... # type: Any + query = ... # type: Any + def __init__(self, drivername, username=..., password=..., host=..., port=..., database=..., query=...) -> None: ... + def __to_string__(self, hide_password=...): ... + def __hash__(self): ... + def __eq__(self, other): ... + def get_backend_name(self): ... + def get_driver_name(self): ... + def get_dialect(self): ... + def translate_connect_args(self, names=..., **kw): ... + +def make_url(name_or_url): ... diff --git a/third_party/2and3/sqlalchemy/exc.pyi b/third_party/2and3/sqlalchemy/exc.pyi new file mode 100644 index 000000000000..310770dbb7f5 --- /dev/null +++ b/third_party/2and3/sqlalchemy/exc.pyi @@ -0,0 +1,77 @@ +# Stubs for sqlalchemy.exc (Python 2) +# +# NOTE: This dynamically typed stub was automatically generated by stubgen. + +from typing import Any + +class SQLAlchemyError(Exception): ... +class ArgumentError(SQLAlchemyError): ... +class NoSuchModuleError(ArgumentError): ... +class NoForeignKeysError(ArgumentError): ... +class AmbiguousForeignKeysError(ArgumentError): ... + +class CircularDependencyError(SQLAlchemyError): + cycles = ... # type: Any + edges = ... # type: Any + def __init__(self, message, cycles, edges, msg=...) -> None: ... + def __reduce__(self): ... + +class CompileError(SQLAlchemyError): ... + +class UnsupportedCompilationError(CompileError): + def __init__(self, compiler, element_type) -> None: ... + +class IdentifierError(SQLAlchemyError): ... +class DisconnectionError(SQLAlchemyError): ... +class TimeoutError(SQLAlchemyError): ... +class InvalidRequestError(SQLAlchemyError): ... +class NoInspectionAvailable(InvalidRequestError): ... +class ResourceClosedError(InvalidRequestError): ... +class NoSuchColumnError(KeyError, InvalidRequestError): ... +class NoReferenceError(InvalidRequestError): ... + +class NoReferencedTableError(NoReferenceError): + table_name = ... # type: Any + def __init__(self, message, tname) -> None: ... + def __reduce__(self): ... + +class NoReferencedColumnError(NoReferenceError): + table_name = ... # type: Any + column_name = ... # type: Any + def __init__(self, message, tname, cname) -> None: ... + def __reduce__(self): ... + +class NoSuchTableError(InvalidRequestError): ... +class UnboundExecutionError(InvalidRequestError): ... +class DontWrapMixin: ... + +UnmappedColumnError = ... # type: Any + +class StatementError(SQLAlchemyError): + statement = ... # type: Any + params = ... # type: Any + orig = ... # type: Any + detail = ... # type: Any + def __init__(self, message, statement, params, orig) -> None: ... + def add_detail(self, msg): ... + def __reduce__(self): ... + def __unicode__(self): ... + +class DBAPIError(StatementError): + @classmethod + def instance(cls, statement, params, orig, dbapi_base_err, connection_invalidated=..., dialect=...): ... + def __reduce__(self): ... + connection_invalidated = ... # type: Any + def __init__(self, statement, params, orig, connection_invalidated=...) -> None: ... + +class InterfaceError(DBAPIError): ... +class DatabaseError(DBAPIError): ... +class DataError(DatabaseError): ... +class OperationalError(DatabaseError): ... +class IntegrityError(DatabaseError): ... +class InternalError(DatabaseError): ... +class ProgrammingError(DatabaseError): ... +class NotSupportedError(DatabaseError): ... +class SADeprecationWarning(DeprecationWarning): ... +class SAPendingDeprecationWarning(PendingDeprecationWarning): ... +class SAWarning(RuntimeWarning): ... diff --git a/third_party/2and3/sqlalchemy/inspection.pyi b/third_party/2and3/sqlalchemy/inspection.pyi new file mode 100644 index 000000000000..2d550cd06a34 --- /dev/null +++ b/third_party/2and3/sqlalchemy/inspection.pyi @@ -0,0 +1,5 @@ +# Stubs for sqlalchemy.inspection (Python 2) +# +# NOTE: This dynamically typed stub was automatically generated by stubgen. + +def inspect(subject, raiseerr=...): ... diff --git a/third_party/2and3/sqlalchemy/log.pyi b/third_party/2and3/sqlalchemy/log.pyi new file mode 100644 index 000000000000..8a5b3bf18737 --- /dev/null +++ b/third_party/2and3/sqlalchemy/log.pyi @@ -0,0 +1,14 @@ +import logging +from typing import Any + +rootlogger = ... # type: Any + +class Identified(object): + def _should_log_debug(self) -> bool: ... + def _should_log_info(self) -> bool: ... + +class InstanceLogger(object): ... + +def instance_logger(instance, echoflag) -> None: ... + +class echo_property(object): ... diff --git a/third_party/2and3/sqlalchemy/orm/__init__.pyi b/third_party/2and3/sqlalchemy/orm/__init__.pyi new file mode 100644 index 000000000000..bc1fe4b800b4 --- /dev/null +++ b/third_party/2and3/sqlalchemy/orm/__init__.pyi @@ -0,0 +1,95 @@ +# Stubs for sqlalchemy.orm (Python 2) +# +# NOTE: This dynamically typed stub was automatically generated by stubgen. + +from typing import Any +## from . import mapper +## from . import interfaces +## from . import deprecated_interfaces +## from . import util +## from . import properties +## from . import relationships +## from . import descriptor_props +from . import session +## from . import scoping +## from . import query +from ..util import langhelpers +## from . import strategy_options + +## Mapper = mapper.Mapper +## class_mapper = mapper.class_mapper +## configure_mappers = mapper.configure_mappers +## reconstructor = mapper.reconstructor +## validates = mapper.validates +## EXT_CONTINUE = interfaces.EXT_CONTINUE +## EXT_STOP = interfaces.EXT_STOP +## PropComparator = interfaces.PropComparator +## MapperExtension = deprecated_interfaces.MapperExtension +## SessionExtension = deprecated_interfaces.SessionExtension +## AttributeExtension = deprecated_interfaces.AttributeExtension +## aliased = util.aliased +## join = util.join +## object_mapper = util.object_mapper +## outerjoin = util.outerjoin +## polymorphic_union = util.polymorphic_union +## was_deleted = util.was_deleted +## with_parent = util.with_parent +## with_polymorphic = util.with_polymorphic +## ColumnProperty = properties.ColumnProperty +## RelationshipProperty = relationships.RelationshipProperty +## ComparableProperty = descriptor_props.ComparableProperty +## CompositeProperty = descriptor_props.CompositeProperty +## SynonymProperty = descriptor_props.SynonymProperty +## foreign = relationships.foreign +## remote = relationships.remote +Session = session.Session +object_session = Session.object_session +sessionmaker = session.sessionmaker +## make_transient = session.make_transient +## make_transient_to_detached = session.make_transient_to_detached +## scoped_session = scoping.scoped_session +## AliasOption = query.AliasOption +## Query = query.Query +## Bundle = query.Bundle +public_factory = langhelpers.public_factory + +def create_session(bind=..., **kwargs): ... + +relationship = ... # type: Any + +def relation(*arg, **kw): ... +def dynamic_loader(argument, **kw): ... + +column_property = ... # type: Any +composite = ... # type: Any + +def backref(name, **kwargs): ... +def deferred(*columns, **kw): ... + +synonym = ... # type: Any +comparable_property = ... # type: Any + +def compile_mappers(): ... +def clear_mappers(): ... + +joinedload = ... # type: Any +joinedload_all = ... # type: Any +contains_eager = ... # type: Any +defer = ... # type: Any +undefer = ... # type: Any +undefer_group = ... # type: Any +load_only = ... # type: Any +lazyload = ... # type: Any +lazyload_all = ... # type: Any +subqueryload = ... # type: Any +subqueryload_all = ... # type: Any +immediateload = ... # type: Any +noload = ... # type: Any +defaultload = ... # type: Any + +## Load = strategy_options.Load + +def eagerload(*args, **kwargs): ... +def eagerload_all(*args, **kwargs): ... + +contains_alias = ... # type: Any diff --git a/third_party/2and3/sqlalchemy/orm/session.pyi b/third_party/2and3/sqlalchemy/orm/session.pyi new file mode 100644 index 000000000000..dcdf8b025e3d --- /dev/null +++ b/third_party/2and3/sqlalchemy/orm/session.pyi @@ -0,0 +1,93 @@ +# Stubs for sqlalchemy.orm.session (Python 2) +# +# NOTE: This dynamically typed stub was automatically generated by stubgen. + +from typing import Any + +class _SessionClassMethods: + @classmethod + def close_all(cls): ... + @classmethod + def identity_key(cls, orm_util, *args, **kwargs): ... + @classmethod + def object_session(cls, instance): ... + +class SessionTransaction: + session = ... # type: Any + nested = ... # type: Any + def __init__(self, session, parent=..., nested=...) -> None: ... + @property + def is_active(self): ... + def connection(self, bindkey, execution_options=..., **kwargs): ... + def prepare(self): ... + def commit(self): ... + def rollback(self, _capture_exception=...): ... + def close(self, invalidate=...): ... + def __enter__(self): ... + def __exit__(self, type, value, traceback): ... + +class Session(_SessionClassMethods): + public_methods = ... # type: Any + identity_map = ... # type: Any + bind = ... # type: Any + transaction = ... # type: Any + hash_key = ... # type: Any + autoflush = ... # type: Any + autocommit = ... # type: Any + expire_on_commit = ... # type: Any + twophase = ... # type: Any + def __init__(self, bind=..., autoflush=..., expire_on_commit=..., _enable_transaction_accounting=..., autocommit=..., twophase=..., weak_identity_map=..., binds=..., extension=..., info=..., query_cls=...) -> None: ... + connection_callable = ... # type: Any + def info(self): ... + def begin(self, subtransactions=..., nested=...): ... + def begin_nested(self): ... + def rollback(self): ... + def commit(self): ... + def prepare(self): ... + def connection(self, mapper=..., clause=..., bind=..., close_with_result=..., execution_options=..., **kw): ... + def execute(self, clause, params=..., mapper=..., bind=..., **kw): ... + def scalar(self, clause, params=..., mapper=..., bind=..., **kw): ... + def close(self): ... + def invalidate(self): ... + def expunge_all(self): ... + def bind_mapper(self, mapper, bind): ... + def bind_table(self, table, bind): ... + def get_bind(self, mapper=..., clause=...): ... + def query(self, *entities, **kwargs): ... + @property + def no_autoflush(self): ... + def refresh(self, instance, attribute_names=..., lockmode=...): ... + def expire_all(self): ... + def expire(self, instance, attribute_names=...): ... + def prune(self): ... + def expunge(self, instance): ... + def add(self, instance, _warn=...): ... + def add_all(self, instances): ... + def delete(self, instance): ... + def merge(self, instance, load=...): ... + def enable_relationship_loading(self, obj): ... + def __contains__(self, instance): ... + def __iter__(self): ... + def flush(self, objects=...): ... + def bulk_save_objects(self, objects, return_defaults=..., update_changed_only=...): ... + def bulk_insert_mappings(self, mapper, mappings, return_defaults=...): ... + def bulk_update_mappings(self, mapper, mappings): ... + def is_modified(self, instance, include_collections=..., passive=...): ... + @property + def is_active(self): ... + @property + def dirty(self): ... + @property + def deleted(self): ... + @property + def new(self): ... + +class sessionmaker(_SessionClassMethods): + kw = ... # type: Any + class_ = ... # type: Any + def __init__(self, bind=..., class_=..., autoflush=..., autocommit=..., expire_on_commit=..., info=..., **kw) -> None: ... + def __call__(self, **local_kw): ... + def configure(self, **new_kw): ... + +# Names in __all__ with no definition: +# SessionExtension diff --git a/third_party/2and3/sqlalchemy/pool.pyi b/third_party/2and3/sqlalchemy/pool.pyi new file mode 100644 index 000000000000..7161dc56c8a4 --- /dev/null +++ b/third_party/2and3/sqlalchemy/pool.pyi @@ -0,0 +1,118 @@ +# Stubs for sqlalchemy.pool (Python 2) +# +# NOTE: This dynamically typed stub was automatically generated by stubgen. + +from typing import Any +from . import log +from . import util + +threading = util.threading +memoized_property = util.memoized_property +chop_traceback = util.chop_traceback + +proxies = ... # type: Any + +def manage(module, **params): ... +def clear_managers(): ... + +reset_rollback = ... # type: Any +reset_commit = ... # type: Any +reset_none = ... # type: Any + +class _ConnDialect: + def do_rollback(self, dbapi_connection): ... + def do_commit(self, dbapi_connection): ... + def do_close(self, dbapi_connection): ... + +class Pool(log.Identified): + logging_name = ... # type: Any + echo = ... # type: Any + def __init__(self, creator, recycle=..., echo=..., use_threadlocal=..., logging_name=..., reset_on_return=..., listeners=..., events=..., _dispatch=..., _dialect=...) -> None: ... + def add_listener(self, listener): ... + def unique_connection(self): ... + def recreate(self): ... + def dispose(self): ... + def connect(self): ... + def status(self): ... + + _threadconns = ... # type: Any + _creator = ... # type: Any + _recycle = ... # type: Any + _invalidate_time = ... # type: Any + dispatch = ... # type: Any + _dialect = ... # type: Any + _orig_logging_name = ... # type: Any + _reset_on_return = ... # type: Any + _use_threadlocal = ... # type: Any + +class _ConnectionRecord: + connection = ... # type: Any + finalize_callback = ... # type: Any + def __init__(self, pool) -> None: ... + def info(self): ... + @classmethod + def checkout(cls, pool): ... + fairy_ref = ... # type: Any + def checkin(self): ... + def close(self): ... + def invalidate(self, e=..., soft=...): ... + def get_connection(self): ... + +class _ConnectionFairy: + connection = ... # type: Any + def __init__(self, dbapi_connection, connection_record, echo) -> None: ... + @property + def is_valid(self): ... + def info(self): ... + def invalidate(self, e=..., soft=...): ... + def cursor(self, *args, **kwargs): ... + def __getattr__(self, key): ... + def detach(self): ... + def close(self): ... + +class SingletonThreadPool(Pool): + size = ... # type: Any + def __init__(self, creator, pool_size=..., **kw) -> None: ... + def recreate(self): ... + def dispose(self): ... + def status(self): ... + +class QueuePool(Pool): + def __init__(self, creator, pool_size=..., max_overflow=..., timeout=..., **kw) -> None: ... + def recreate(self): ... + def dispose(self): ... + def status(self): ... + def size(self): ... + def checkedin(self): ... + def overflow(self): ... + def checkedout(self): ... + +class NullPool(Pool): + def status(self): ... + def recreate(self): ... + def dispose(self): ... + +class StaticPool(Pool): + def connection(self): ... + def status(self): ... + def dispose(self): ... + def recreate(self): ... + +class AssertionPool(Pool): + def __init__(self, *args, **kw) -> None: ... + def status(self): ... + def dispose(self): ... + def recreate(self): ... + +class _DBProxy: + module = ... # type: Any + kw = ... # type: Any + poolclass = ... # type: Any + pools = ... # type: Any + def __init__(self, module, poolclass=..., **kw) -> None: ... + def close(self): ... + def __del__(self): ... + def __getattr__(self, key): ... + def get_pool(self, *args, **kw): ... + def connect(self, *args, **kw): ... + def dispose(self, *args, **kw): ... diff --git a/third_party/2and3/sqlalchemy/schema.pyi b/third_party/2and3/sqlalchemy/schema.pyi new file mode 100644 index 000000000000..f788897337c0 --- /dev/null +++ b/third_party/2and3/sqlalchemy/schema.pyi @@ -0,0 +1,50 @@ +# Stubs for sqlalchemy.schema (Python 2) + +from .sql import base +from .sql import schema +from .sql import naming +from .sql import ddl +from .sql import elements + +SchemaVisitor = base.SchemaVisitor +CheckConstraint = schema.CheckConstraint +Column = schema.Column +ColumnDefault = schema.ColumnDefault +Constraint = schema.Constraint +DefaultClause = schema.DefaultClause +DefaultGenerator = schema.DefaultGenerator +FetchedValue = schema.FetchedValue +ForeignKey = schema.ForeignKey +ForeignKeyConstraint = schema.ForeignKeyConstraint +Index = schema.Index +MetaData = schema.MetaData +PassiveDefault = schema.PassiveDefault +PrimaryKeyConstraint = schema.PrimaryKeyConstraint +SchemaItem = schema.SchemaItem +Sequence = schema.Sequence +Table = schema.Table +ThreadLocalMetaData = schema.ThreadLocalMetaData +UniqueConstraint = schema.UniqueConstraint +_get_table_key = schema._get_table_key +ColumnCollectionConstraint = schema.ColumnCollectionConstraint +ColumnCollectionMixin = schema.ColumnCollectionMixin +conv = elements.conv +DDL = ddl.DDL +CreateTable = ddl.CreateTable +DropTable = ddl.DropTable +CreateSequence = ddl.CreateSequence +DropSequence = ddl.DropSequence +CreateIndex = ddl.CreateIndex +DropIndex = ddl.DropIndex +CreateSchema = ddl.CreateSchema +DropSchema = ddl.DropSchema +_DropView = ddl._DropView +CreateColumn = ddl.CreateColumn +AddConstraint = ddl.AddConstraint +DropConstraint = ddl.DropConstraint +DDLBase = ddl.DDLBase +DDLElement = ddl.DDLElement +_CreateDropBase = ddl._CreateDropBase +_DDLCompiles = ddl._DDLCompiles +sort_tables = ddl.sort_tables +sort_tables_and_constraints = ddl.sort_tables_and_constraints diff --git a/third_party/2and3/sqlalchemy/sql/__init__.pyi b/third_party/2and3/sqlalchemy/sql/__init__.pyi new file mode 100644 index 000000000000..91d06d82e238 --- /dev/null +++ b/third_party/2and3/sqlalchemy/sql/__init__.pyi @@ -0,0 +1,66 @@ +# Stubs for sqlalchemy.sql (Python 2) +# +# NOTE: This dynamically typed stub was automatically generated by stubgen. + +from . import expression +from . import visitors + +Alias = expression.Alias +ClauseElement = expression.ClauseElement +ColumnCollection = expression.ColumnCollection +ColumnElement = expression.ColumnElement +CompoundSelect = expression.CompoundSelect +Delete = expression.Delete +FromClause = expression.FromClause +Insert = expression.Insert +Join = expression.Join +Select = expression.Select +Selectable = expression.Selectable +TableClause = expression.TableClause +Update = expression.Update +alias = expression.alias +and_ = expression.and_ +asc = expression.asc +between = expression.between +bindparam = expression.bindparam +case = expression.case +cast = expression.cast +collate = expression.collate +column = expression.column +delete = expression.delete +desc = expression.desc +distinct = expression.distinct +except_ = expression.except_ +except_all = expression.except_all +exists = expression.exists +extract = expression.extract +false = expression.false +False_ = expression.False_ +func = expression.func +funcfilter = expression.funcfilter +insert = expression.insert +intersect = expression.intersect +intersect_all = expression.intersect_all +join = expression.join +label = expression.label +literal = expression.literal +literal_column = expression.literal_column +modifier = expression.modifier +not_ = expression.not_ +null = expression.null +or_ = expression.or_ +outerjoin = expression.outerjoin +outparam = expression.outparam +over = expression.over +select = expression.select +subquery = expression.subquery +table = expression.table +text = expression.text +true = expression.true +True_ = expression.True_ +tuple_ = expression.tuple_ +type_coerce = expression.type_coerce +union = expression.union +union_all = expression.union_all +update = expression.update +ClauseVisitor = visitors.ClauseVisitor diff --git a/third_party/2and3/sqlalchemy/sql/annotation.pyi b/third_party/2and3/sqlalchemy/sql/annotation.pyi new file mode 100644 index 000000000000..ba0aba4378dd --- /dev/null +++ b/third_party/2and3/sqlalchemy/sql/annotation.pyi @@ -0,0 +1,11 @@ +class Annotated(object): + def __new__(cls, *args): ... + def __init__(self, element, values): ... + def _annotate(self, values): ... + def _with_annotations(self, values): ... + def _deannotate(self, values=..., clone: bool=...): ... + def _compiler_dispatch(self, visitor, **kw): ... + def _constructor(self): ... + def _clone(self): ... + def __hash__(self): ... + def __eq__(self): ... diff --git a/third_party/2and3/sqlalchemy/sql/base.pyi b/third_party/2and3/sqlalchemy/sql/base.pyi new file mode 100644 index 000000000000..48e68c70fdbd --- /dev/null +++ b/third_party/2and3/sqlalchemy/sql/base.pyi @@ -0,0 +1,42 @@ +from typing import Any, Iterable + +from .visitors import ClauseVisitor +from .. import util + +class Immutable(object): + def unique_params(self, *optionaldict, **kwargs): ... + def params(self, *optionaldict, **kwargs): ... + def _clone(self) -> Immutable: ... + +class DialectKWArgs(object): + def argument_for(cls, dialect_name, argument_name, default): ... + def kwargs(self): ... + def dialect_options(self): ... + +class Generative(object): ... + +class Executable(Generative): + def execution_options(self, **kw): ... + def execute(self, *multiparams, **params): ... + def scalar(self, *multiparams, **params): ... + + @property + def bind(self): ... + +class SchemaEventTarget(object): ... +class SchemaVisitor(ClauseVisitor): ... +class ColumnCollection(util.OrderedProperties): + def replace(self, column): ... + def add(self, column): ... + def clear(self): ... + def remove(self, column): ... + def update(self, iter: Iterable[Any]): ... + def extend(self, iter: Iterable[Any]): ... + def contains_column(self, col): ... + def as_immutable(self): ... + +class ImmutableColumnCollection(util.ImmutableProperties, ColumnCollection): ... + +class ColumnSet(util.ordered_column_set): ... + +def _bind_or_error(schemaitem, msg): ... diff --git a/third_party/2and3/sqlalchemy/sql/ddl.pyi b/third_party/2and3/sqlalchemy/sql/ddl.pyi new file mode 100644 index 000000000000..06ac96a8ac1f --- /dev/null +++ b/third_party/2and3/sqlalchemy/sql/ddl.pyi @@ -0,0 +1,25 @@ +from .elements import ClauseElement +from .base import Executable, SchemaVisitor + +class _DDLCompiles(ClauseElement): ... +class DDLElement(Executable, _DDLCompiles): ... +class DDL(DDLElement): ... +class _CreateDropBase(DDLElement): ... +class CreateSchema(_CreateDropBase): ... +class DropSchema(_CreateDropBase): ... +class CreateTable(_CreateDropBase): ... +class _DropView(_CreateDropBase): ... +class CreateColumn(_DDLCompiles): ... +class DropTable(_CreateDropBase): ... +class CreateSequence(_CreateDropBase): ... +class DropSequence(_CreateDropBase): ... +class CreateIndex(_CreateDropBase): ... +class DropIndex(_CreateDropBase): ... +class AddConstraint(_CreateDropBase): ... +class DropConstraint(_CreateDropBase): ... +class DDLBase(SchemaVisitor): ... +class SchemaGenerator(DDLBase): ... +class SchemaDropper(DDLBase): ... + +def sort_tables(tables, skip_fn=..., extra_dependencies=...): ... +def sort_tables_and_constraints(tables, filter_fn=..., extra_dependencies=...): ... diff --git a/third_party/2and3/sqlalchemy/sql/dml.pyi b/third_party/2and3/sqlalchemy/sql/dml.pyi new file mode 100644 index 000000000000..79cb201d22b4 --- /dev/null +++ b/third_party/2and3/sqlalchemy/sql/dml.pyi @@ -0,0 +1,20 @@ +from typing import AnyStr + +from .base import Executable, DialectKWArgs +from .elements import ClauseElement +from .selectable import HasPrefixes + +class UpdateBase(DialectKWArgs, HasPrefixes, Executable, ClauseElement): + def params(self, *arg, **kw): ... + @property + def bind(self): ... + def returning(self, *cols): ... + def with_hint(self, text, selectable=..., dialect_name: AnyStr=...): ... + +class ValuesBase(UpdateBase): + def values(self, *args, **kwargs): ... + def return_defaults(self, *cols): ... + +class Insert(ValuesBase): ... +class Update(ValuesBase): ... +class Delete(UpdateBase): ... diff --git a/third_party/2and3/sqlalchemy/sql/elements.pyi b/third_party/2and3/sqlalchemy/sql/elements.pyi new file mode 100644 index 000000000000..e2a8d38b2c5a --- /dev/null +++ b/third_party/2and3/sqlalchemy/sql/elements.pyi @@ -0,0 +1,60 @@ + +from .visitors import Visitable +from .annotation import Annotated +from .base import Executable, Immutable +from .operators import ColumnOperators +from .. import util + +class ClauseElement(Visitable): ... + +class ColumnElement(ColumnOperators, ClauseElement): ... + +class BindParameter(ColumnElement): ... +class BinaryExpression(ColumnElement): ... + +class TypeClause(ClauseElement): ... +class TextClause(Executable, ClauseElement): ... + +class Null(ColumnElement): ... +class False_(ColumnElement): ... +class True_(ColumnElement): ... + +class ClauseList(ClauseElement): ... +class BooleanClauseList(ClauseList, ColumnElement): ... +class Tuple(ClauseList, ColumnElement): ... +class Case(ColumnElement): ... +class Cast(ColumnElement): ... +class Extract(ColumnElement): ... +class _label_reference(ColumnElement): ... + +class _textual_label_reference(ColumnElement): ... +class UnaryExpression(ColumnElement): ... +class AsBoolean(UnaryExpression): ... +class Grouping(ColumnElement): ... +class Over(ColumnElement): ... +class FunctionFilter(ColumnElement): ... +class Label(ColumnElement): ... +class ColumnClause(Immutable, ColumnElement): ... +class _IdentifiedClause(Executable, ClauseElement): ... +class SavepointClause(_IdentifiedClause): ... +class RollbackToSavepointClause(_IdentifiedClause): ... +class ReleaseSavepointClause(_IdentifiedClause): ... +class quoted_name(util.MemoizedSlots, util.text_type): ... +class _truncated_label(quoted_name): ... +class conv(_truncated_label): ... +class _defer_name(_truncated_label): ... +class _defer_none_name(_defer_name): ... +class _anonymous_label(_truncated_label): ... +class AnnotatedColumnElement(Annotated): ... + +def _clone(element, **kw): ... +def _type_from_args(args): ... +def _literal_as_binds(element, name, type_=None): ... + +def collate(expression, collation) -> BinaryExpression: ... +def between(expr, lower_bound, upper_bound, symmetric: bool=...): ... +def literal(value, type_=None) -> BindParameter: ... +def outparam(key, type_=None) -> BindParameter: ... +def type_coerce(expression, type_): ... +def not_(clause): ... +def literal_column(text, type_=None): ... diff --git a/third_party/2and3/sqlalchemy/sql/expression.pyi b/third_party/2and3/sqlalchemy/sql/expression.pyi new file mode 100644 index 000000000000..fd24299eefe3 --- /dev/null +++ b/third_party/2and3/sqlalchemy/sql/expression.pyi @@ -0,0 +1,87 @@ +# Stubs for sqlalchemy.sql.expression (Python 2) + +from typing import Any +from . import functions +from . import elements +from . import base +from . import selectable +from . import dml + +func = functions.func # type: functions._FunctionGenerator +modifier = functions.modifier # type: functions._FunctionGenerator + +from .visitors import Visitable + +from .elements import ClauseElement, ColumnElement,\ + BindParameter, UnaryExpression, BooleanClauseList, \ + Label, Cast, Case, ColumnClause, TextClause, Over, Null, \ + True_, False_, BinaryExpression, Tuple, TypeClause, Extract, \ + Grouping, not_, \ + collate, literal_column, between,\ + literal, outparam, type_coerce, ClauseList, FunctionFilter +from .elements import SavepointClause, RollbackToSavepointClause, \ + ReleaseSavepointClause +from .base import ColumnCollection, Generative, Executable +from .selectable import Alias, Join, Select, Selectable, TableClause, \ + CompoundSelect, CTE, FromClause, FromGrouping, SelectBase, \ + alias, GenerativeSelect, \ + subquery, HasPrefixes, HasSuffixes, Exists, ScalarSelect, TextAsFrom +from .dml import Insert, Update, Delete, UpdateBase, ValuesBase + +and_ = ... # type: Any +or_ = ... # type: Any +bindparam = ... # type: Any +select = ... # type: Any +text = ... # type: Any +table = ... # type: Any +column = ... # type: Any +over = ... # type: Any +label = ... # type: Any +case = ... # type: Any +cast = ... # type: Any +extract = ... # type: Any +tuple_ = ... # type: Any +except_ = ... # type: Any +except_all = ... # type: Any +intersect = ... # type: Any +intersect_all = ... # type: Any +union = ... # type: Any +union_all = ... # type: Any +exists = ... # type: Any +nullsfirst = ... # type: Any +nullslast = ... # type: Any +asc = ... # type: Any +desc = ... # type: Any +distinct = ... # type: Any +true = ... # type: Any +false = ... # type: Any +null = ... # type: Any +join = ... # type: Any +outerjoin = ... # type: Any +insert = ... # type: Any +update = ... # type: Any +delete = ... # type: Any +funcfilter = ... # type: Any + +# old names for compatibility +_Executable = Executable +_BindParamClause = BindParameter +_Label = Label +_SelectBase = SelectBase +_BinaryExpression = BinaryExpression +_Cast = Cast +_Null = Null +_False = False_ +_True = True_ +_TextClause = TextClause +_UnaryExpression = UnaryExpression +_Case = Case +_Tuple = Tuple +_Over = Over +_Generative = Generative +_TypeClause = TypeClause +_Extract = Extract +_Exists = Exists +_Grouping = Grouping +_FromGrouping = FromGrouping +_ScalarSelect = ScalarSelect diff --git a/third_party/2and3/sqlalchemy/sql/functions.pyi b/third_party/2and3/sqlalchemy/sql/functions.pyi new file mode 100644 index 000000000000..4be9907b55bd --- /dev/null +++ b/third_party/2and3/sqlalchemy/sql/functions.pyi @@ -0,0 +1,47 @@ + +from .base import Executable, ColumnCollection +from .elements import ClauseList, Cast, Extract, _literal_as_binds, \ + literal_column, _type_from_args, ColumnElement, _clone,\ + Over, BindParameter, FunctionFilter +from .selectable import FromClause, Select, Alias +from .visitors import VisitableType + +class FunctionElement(Executable, ColumnElement, FromClause): ... + +class _FunctionGenerator(object): + def __init__(self, **opts): ... + def __getattr__(self, name): ... + def __call__(self, *c, **kwargs) -> Function: ... + +func = ... # type: _FunctionGenerator +modifier = ... # type: _FunctionGenerator + +class Function(FunctionElement): ... + +class _GenericMeta(VisitableType): ... +# TODO: Use GenericFunction(util.with_metaclass(_GenericMeta, Function)) +class GenericFunction(_GenericMeta, Function): ... +class next_value(GenericFunction): ... + +class AnsiFunction(GenericFunction): ... +class ReturnTypeFromArgs(GenericFunction): ... + +class coalesce(ReturnTypeFromArgs): ... +class max(ReturnTypeFromArgs): ... +class min(ReturnTypeFromArgs): ... +class sum(ReturnTypeFromArgs): ... +class now(GenericFunction): ... +class concat(GenericFunction): ... + +class char_length(GenericFunction): ... +class random(GenericFunction): ... +class count(GenericFunction): ... +class current_date(AnsiFunction): ... +class current_time(AnsiFunction): ... +class current_timestamp(AnsiFunction): ... +class current_user(AnsiFunction): ... +class localtime(AnsiFunction): ... +class localtimestamp(AnsiFunction): ... +class session_user(AnsiFunction): ... +class sysdate(AnsiFunction): ... +class user(AnsiFunction): ... diff --git a/third_party/2and3/sqlalchemy/sql/naming.pyi b/third_party/2and3/sqlalchemy/sql/naming.pyi new file mode 100644 index 000000000000..d9172c48037b --- /dev/null +++ b/third_party/2and3/sqlalchemy/sql/naming.pyi @@ -0,0 +1 @@ +class ConventionDict(object): ... diff --git a/third_party/2and3/sqlalchemy/sql/operators.pyi b/third_party/2and3/sqlalchemy/sql/operators.pyi new file mode 100644 index 000000000000..5ae39cd502c5 --- /dev/null +++ b/third_party/2and3/sqlalchemy/sql/operators.pyi @@ -0,0 +1,99 @@ +from typing import Any, AnyStr, Callable + +class Operators(object): + def op(self, opstring: AnyStr, precedence: int, is_comparison: bool): ... + def operate(self, op: Callable[[Any], Any], *other, **kwargs): ... + def reverse_operator(self, op: Callable[[Any], Any], *other, **kwargs): ... + def __and__(self, other): ... + def __or__(self, other): ... + def __invert__(self): ... + + +class ColumnOperators(Operators): + def concat(self, other): ... + def like(self, other, escape=None): ... + def ilike(self, other, escape=None): ... + def notlike(self, other, escape=None): ... + def notilike(self, other, escape=None): ... + def in_(self, other): ... + def notin_(self, other): ... + def is_(self, other): ... + def startswith(self, other, **kwargs): ... + def endswith(self, other, **kwargs): ... + def contains(self, other, **kwargs): ... + def match(self, other, **kwargs): ... + def desc(self): ... + def asc(self): ... + def nullsfirst(self): ... + def nullslast(self): ... + def collate(self, collation): ... + def between(self, cleft, cright, symmetric: bool = ...): ... + def distinct(self): ... + + def __lt__(self, other): ... + def __le__(self, other): ... + def __eq__(self, other): ... + def __ne__(self, other): ... + def __gt__(self, other): ... + def __ge__(self, other): ... + def __neg__(self, other): ... + def __getitem__(self, index): ... + def __lshift__(self, other): ... + def __rshift__(self, other): ... + + def __radd__(self, other): ... + def __rsub__(self, other): ... + def __rmul__(self, other): ... + def __rdiv__(self, other): ... + def __rmod__(self, other): ... + def __add__(self, other): ... + def __sub__(self, other): ... + def __mul__(self, other): ... + def __div__(self, other): ... + def __mod__(self, other): ... + def __truediv__(self, other): ... + def __rtruediv__(self, other): ... + +def from_(): ... +def as_(): ... +def exists(): ... +def istrue(a): ... +def isfalse(a): ... +def is_(a, b): ... +def isnot(a, b): ... +def collate(a, b): ... +def op(a, opstring, b): ... + +def like_op(a, b, escape=None): ... +def notlike_op(a, b, escape=None): ... +def ilike_op(a, b, escape=None): ... +def notilike_op(a, b, escape=None): ... +def between_op(a, b, symmetric: bool): ... +def notbetween_(a, b, symmetric: bool): ... + +def in_op(a, b): ... +def notin_op(a, b): ... +def distinct_op(a): ... + +def startswith_op(a, b, escape=None): ... +def notstartswith_op(a, b, escape=None): ... +def endswith_op(a, b, escape=None): ... +def notendswith_op(a, b, escape=None): ... +def contains_op(a, b, escape=None): ... +def notcontains_op(a, b, escape=None): ... + +def match_op(a, b, **kw): ... +def notmatch_op(a, b, **kw): ... + +def comma_op(a, b): ... +def concat_op(a, b): ... + +def desc_op(a): ... +def asc_op(a): ... +def nullsfirst_op(a): ... +def nullslast_op(a): ... + +def is_comparison(op): ... +def is_commutative(op): ... +def is_ordering_modified(op): ... +def is_precedent(operator, against): ... diff --git a/third_party/2and3/sqlalchemy/sql/schema.pyi b/third_party/2and3/sqlalchemy/sql/schema.pyi new file mode 100644 index 000000000000..4e03ff28a399 --- /dev/null +++ b/third_party/2and3/sqlalchemy/sql/schema.pyi @@ -0,0 +1,126 @@ +from typing import Any, AnyStr + +from .base import SchemaEventTarget, DialectKWArgs +from .base import ColumnCollection +from .elements import ClauseElement, ColumnClause, TextClause, \ + ColumnElement +from .selectable import TableClause + +from . import visitors + +class SchemaItem(SchemaEventTarget, visitors.Visitable): + def _execute_on_connection(self, connection, multiparams, params): ... + @property + def info(self): ... + @property + def quote(self): ... + def get_children(self, **kwargs): ... + def _init_items(self, *args): ... + def _schema_item_copy(self, schema_item): ... + def __repr__(self): ... + + +class Table(DialectKWArgs, SchemaItem, TableClause): + def __init__(self, name, metadata, *args, **kwargs): ... + @property + def key(self): ... + @property + def primary_key(self): ... + def __repr__(self): ... + def __str__(self): ... + def append_column(self, column): ... + def append_constraint(self, constraint): ... + def append_ddl_listener(self, event, listener): ... + def get_children(self, column_collections=True, schema_visitor=False, **kwargs): ... + def exists(self, bind=None): ... + def create(self, bind=None, checkfirst=False): ... + def drop(self, bind=None, checkfirst=False): ... + def tometadata(self, metadata, schema=None): ... + c = ... # type: ColumnCollection + constraints = ... # type: Set[Constraint] + + +class Column(SchemaItem, ColumnClause): + primary_key = ... # type: Any + def __init__(self, *args, **kwargs): ... + def references(self, column): ... + def append_foreign_key(self, fk): ... + def __repr__(self): ... + def _set_parent(self, table): ... + def _setup_on_memoized_fks(self, fn): ... + def _on_table_attach(self, fn): ... + def copy(self, **kw): ... + def _make_proxy(self, selectable, name=None, key=None, + name_is_truncatable=False, **kw): ... + def get_children(self, schema_visitor=False, **kwargs): ... + + +class ForeignKey(DialectKWArgs, SchemaItem): + def __init__(self, column, _constraint=None, use_alter=False, name=None, + onupdate=None, ondelete=None, deferrable=None, + initially=None, link_to_name=False, match=None, + info=None, **dialect_kw) -> None: ... + def __repr__(self): ... + def copy(self, schema=None): ... + def _get_colspec(self, schema=None, table_name=None): ... + @property + def _referred_schema(self): ... + def _table_key(self): ... + def references(self, table): ... + def get_referent(self, table): ... + @property + def _column_tokens(self): ... + def _resolve_col_tokens(self): ... + def _link_to_col_by_colstring(self, parenttable, table, colname): ... + def _set_target_column(self, column): ... + @property + def column(self): ... + def _set_parent(self, column): ... + def _set_remote_table(self, table): ... + def _remove_from_metadata(self, metadata): ... + def _set_table(self, column, table): ... + +class _NotAColumnExpr(object): ... +class DefaultGenerator(_NotAColumnExpr, SchemaItem): ... +class ColumnDefault(DefaultGenerator): ... +class Sequence(DefaultGenerator): ... +class FetchedValue(_NotAColumnExpr, SchemaEventTarget): ... +class DefaultClause(FetchedValue): ... +class PassiveDefault(DefaultClause): ... + +class Constraint(DialectKWArgs, SchemaItem): + def __init__(self, name=None, deferrable=None, initially=None): ... + def __contains__(self, x): ... + def contains_column(self, col): ... + def keys(self): ... + def __add__(self, other): ... + def __iter__(self): ... + def __len__(self): ... + def copy(self, **kw): ... + +class ColumnCollectionMixin(object): + columns = ... # type: Any + def __init__(self, *columns, **kw): ... + @classmethod + def _extract_col_expression_collection(cls, expressions): ... + def _check_attach(self, evt=False): ... + def _set_parent(self, table): ... + +class ColumnCollectionConstraint(ColumnCollectionMixin, Constraint): + def __init__(self, *columns, **kw): ... + def _set_parent(self, table): ... + def __contains__(self, x): ... + def copy(self, **kw): ... + def contains_column(self, col): ... + def __iter__(self): ... + def __len__(self): ... + +class CheckConstraint(ColumnCollectionConstraint): ... +class ForeignKeyConstraint(ColumnCollectionConstraint): ... +class PrimaryKeyConstraint(ColumnCollectionConstraint): ... +class UniqueConstraint(ColumnCollectionConstraint): ... +class Index(DialectKWArgs, ColumnCollectionMixin, SchemaItem): ... +class MetaData(SchemaItem): ... +class ThreadLocalMetaData(MetaData): ... + +def _get_table_key(name: AnyStr, schema: AnyStr): ... diff --git a/third_party/2and3/sqlalchemy/sql/selectable.pyi b/third_party/2and3/sqlalchemy/sql/selectable.pyi new file mode 100644 index 000000000000..a3b19253577c --- /dev/null +++ b/third_party/2and3/sqlalchemy/sql/selectable.pyi @@ -0,0 +1,74 @@ +from .base import Immutable, Executable, \ + ColumnCollection, ColumnSet, Generative +from .elements import ClauseElement, TextClause, ClauseList, \ + Grouping, UnaryExpression, BindParameter +from .annotation import Annotated +from .visitors import Visitable +from .. import util + +def subquery(alias, *args, **kwargs): ... +def alias(selectable, name=..., flat: bool=...): ... + +class Selectable(ClauseElement): + def selectable(self): ... + +class HasPrefixes(object): + def prefix_with(self, *expr, **kw): ... + +class HasSuffixes(object): + def suffix_with(self, *expr, **kw): ... + +class FromClause(Selectable): + def count(self, functions, whereclause=None, **params): ... + def select(self, whereclause=None, **params): ... + def join(self, right, onclause=None, isouter: bool=False): ... + def outerjoin(self, right, onclause=None): ... + def alias(self, name=None, flat: bool=False): ... + def is_derived_from(self, fromclause): ... + def _is_lexical_equivalent(self, other): ... + def replace_selectable(self, sqlutil, old, alias): ... + def correspond_on_equivalents(self, column, equivalents): ... + def corresponding_column(self, column, require_embedded: bool=False): ... + @property + def description(self): ... + def _reset_exported(self): ... + @property + def columns(self): ... + @property + def primary_key(self): ... + @property + def foreign_keys(self): ... + def _init_collections(self): ... + @property + def _cols_populated(self): ... + def _populate_column_collection(self): ... + def _refresh_for_new_column(self, column): ... + +class Join(FromClause): ... +class Alias(FromClause): ... +class CTE(Generative, HasSuffixes, Alias): ... +class FromGrouping(FromClause): ... + +class TableClause(Immutable, FromClause): + def __init__(self, name, *columns): ... + def _export_columns(self): ... + @util.memoized_property + def description(self): ... + def append_column(self, c): ... + def get_children(self, **kwargs): ... + def count(self, whereclause=None, **params): ... + def insert(self, values=None, inline=False, **kwargs): ... + def update(self, whereclause=None, values=None, inline=False, **kwargs): ... + def delete(self, whereclause=None, **kwargs): ... + @property + def _from_objects(self): ... + +class ForUpdateArg(ClauseElement): ... +class SelectBase(Executable, FromClause): ... +class GenerativeSelect(SelectBase): ... +class CompoundSelect(GenerativeSelect): ... +class Select(HasPrefixes, HasSuffixes, GenerativeSelect): ... +class ScalarSelect(Generative, Grouping): ... +class Exists(UnaryExpression): ... +class TextAsFrom(SelectBase): ... +class AnnotatedFromClause(Annotated): ... diff --git a/third_party/2and3/sqlalchemy/sql/sqltypes.pyi b/third_party/2and3/sqlalchemy/sql/sqltypes.pyi new file mode 100644 index 000000000000..9c9806a87812 --- /dev/null +++ b/third_party/2and3/sqlalchemy/sql/sqltypes.pyi @@ -0,0 +1,62 @@ +from .type_api import TypeEngine, TypeDecorator +from .base import SchemaEventTarget + +class _DateAffinity(object): ... +class Concatenable(object): ... +class String(TypeEngine, Concatenable): + def __init__(self, length=None, collation=None, + convert_unicode=False, + unicode_error=None, + _warn_on_bytestring=False): ... + def literal_processor(self, dialect): ... + def bind_processor(self, dialect): ... + def result_processor(self, dialect, coltype): ... + @property + def python_type(self): ... + def get_dbapi_type(self, dbapi): ... + +class Text(String): ... +class Unicode(String): ... +class UnicodeText(Text): ... +class Integer(TypeEngine, _DateAffinity): ... +class SmallInteger(Integer): ... +class BigInteger(Integer): ... +class Numeric(TypeEngine, _DateAffinity): ... +class Float(Numeric): ... +class DateTime(TypeEngine, _DateAffinity): ... +class Date(TypeEngine, _DateAffinity): ... +class Time(TypeEngine, _DateAffinity): ... +class _Binary(TypeEngine): ... +class LargeBinary(_Binary): ... +class Binary(LargeBinary): ... +class SchemaType(SchemaEventTarget): ... +class Enum(String, SchemaType): ... +class PickleType(TypeDecorator): ... +class Boolean(TypeEngine, SchemaType): ... +class Interval(_DateAffinity, TypeDecorator): ... + +class REAL(Float): ... +class FLOAT(Float): ... +class NUMERIC(Numeric): ... +class DECIMAL(Numeric): ... +class INTEGER(Integer): ... +# In code it's INT=INTEGER +class INT(Integer): ... +class SMALLINT(SmallInteger): ... +class BIGINT(BigInteger): ... +class TIMESTAMP(DateTime): ... +class DATETIME(DateTime): ... +class DATE(Date): ... +class TIME(Time): ... +class TEXT(Text): ... +class CLOB(Text): ... +class VARCHAR(String): ... +class NVARCHAR(Unicode): ... +class CHAR(String): ... +class NCHAR(Unicode): ... +class BLOB(LargeBinary): ... +class BINARY(_Binary): ... +class VARBINARY(_Binary): ... +class BOOLEAN(Boolean): ... +class NullType(TypeEngine): ... +class MatchType(Boolean): ... diff --git a/third_party/2and3/sqlalchemy/sql/type_api.pyi b/third_party/2and3/sqlalchemy/sql/type_api.pyi new file mode 100644 index 000000000000..ccc0870c0d88 --- /dev/null +++ b/third_party/2and3/sqlalchemy/sql/type_api.pyi @@ -0,0 +1,9 @@ +from .. import util +from .visitors import Visitable, VisitableType + +class TypeEngine(Visitable): ... +class VisitableCheckKWArg(util.EnsureKWArgType, VisitableType): ... +# TODO: class UserDefinedType(util.with_metaclass(VisitableCheckKWArg, TypeEngine)): +class UserDefinedType(VisitableCheckKWArg, TypeEngine): ... +class TypeDecorator(TypeEngine): ... +class Variant(TypeDecorator): ... diff --git a/third_party/2and3/sqlalchemy/sql/visitors.pyi b/third_party/2and3/sqlalchemy/sql/visitors.pyi new file mode 100644 index 000000000000..3b549b487e33 --- /dev/null +++ b/third_party/2and3/sqlalchemy/sql/visitors.pyi @@ -0,0 +1,33 @@ +# Stubs for sqlalchemy.sql.visitors (Python 2) +# +# NOTE: This dynamically typed stub was automatically generated by stubgen. + +from typing import Any + +class VisitableType(type): + def __init__(cls, clsname, bases, clsdict) -> None: ... + +class Visitable: ... + +class ClauseVisitor: + __traverse_options__ = ... # type: Any + def traverse_single(self, obj, **kw): ... + def iterate(self, obj): ... + def traverse(self, obj): ... + def chain(self, visitor): ... + +class CloningVisitor(ClauseVisitor): + def copy_and_process(self, list_): ... + def traverse(self, obj): ... + +class ReplacingCloningVisitor(CloningVisitor): + def replace(self, elem): ... + def traverse(self, obj): ... + +def iterate(obj, opts): ... +def iterate_depthfirst(obj, opts): ... +def traverse_using(iterator, obj, visitors): ... +def traverse(obj, opts, visitors): ... +def traverse_depthfirst(obj, opts, visitors): ... +def cloned_traverse(obj, opts, visitors): ... +def replacement_traverse(obj, opts, replace): ... diff --git a/third_party/2and3/sqlalchemy/types.pyi b/third_party/2and3/sqlalchemy/types.pyi new file mode 100644 index 000000000000..7aa160cab678 --- /dev/null +++ b/third_party/2and3/sqlalchemy/types.pyi @@ -0,0 +1,51 @@ +# Stubs for sqlalchemy.types (Python 2) +# +# NOTE: This dynamically typed stub was automatically generated by stubgen. + +from .sql import type_api +from .sql import sqltypes + +TypeEngine = type_api.TypeEngine +TypeDecorator = type_api.TypeDecorator +UserDefinedType = type_api.UserDefinedType +BIGINT = sqltypes.BIGINT +BINARY = sqltypes.BINARY +BLOB = sqltypes.BLOB +BOOLEAN = sqltypes.BOOLEAN +BigInteger = sqltypes.BigInteger +Binary = sqltypes.Binary +Boolean = sqltypes.Boolean +CHAR = sqltypes.CHAR +CLOB = sqltypes.CLOB +Concatenable = sqltypes.Concatenable +DATE = sqltypes.DATE +DATETIME = sqltypes.DATETIME +DECIMAL = sqltypes.DECIMAL +Date = sqltypes.Date +DateTime = sqltypes.DateTime +Enum = sqltypes.Enum +FLOAT = sqltypes.FLOAT +Float = sqltypes.Float +INT = sqltypes.INT +INTEGER = sqltypes.INTEGER +Integer = sqltypes.Integer +Interval = sqltypes.Interval +LargeBinary = sqltypes.LargeBinary +NCHAR = sqltypes.NCHAR +NVARCHAR = sqltypes.NVARCHAR +NUMERIC = sqltypes.NUMERIC +Numeric = sqltypes.Numeric +PickleType = sqltypes.PickleType +REAL = sqltypes.REAL +SMALLINT = sqltypes.SMALLINT +SmallInteger = sqltypes.SmallInteger +String = sqltypes.String +TEXT = sqltypes.TEXT +TIME = sqltypes.TIME +TIMESTAMP = sqltypes.TIMESTAMP +Text = sqltypes.Text +Time = sqltypes.Time +Unicode = sqltypes.Unicode +UnicodeText = sqltypes.UnicodeText +VARBINARY = sqltypes.VARBINARY +VARCHAR = sqltypes.VARCHAR diff --git a/third_party/2and3/sqlalchemy/util/__init__.pyi b/third_party/2and3/sqlalchemy/util/__init__.pyi new file mode 100644 index 000000000000..a42c2ce0d533 --- /dev/null +++ b/third_party/2and3/sqlalchemy/util/__init__.pyi @@ -0,0 +1,133 @@ +# Stubs for sqlalchemy.util (Python 2) +# +# NOTE: This dynamically typed stub was automatically generated by stubgen. + +from . import compat +from . import _collections +from . import langhelpers +from . import deprecations + +callable = compat.callable +cmp = compat.cmp +reduce = compat.reduce +threading = compat.threading +py3k = compat.py3k +py33 = compat.py33 +py2k = compat.py2k +jython = compat.jython +pypy = compat.pypy +cpython = compat.cpython +win32 = compat.win32 +pickle = compat.pickle +dottedgetter = compat.dottedgetter +parse_qsl = compat.parse_qsl +namedtuple = compat.namedtuple +next = compat.next +reraise = compat.reraise +raise_from_cause = compat.raise_from_cause +text_type = compat.text_type +safe_kwarg = compat.safe_kwarg +string_types = compat.string_types +int_types = compat.int_types +binary_type = compat.binary_type +nested = compat.nested +quote_plus = compat.quote_plus +with_metaclass = compat.with_metaclass +print_ = compat.print_ +itertools_filterfalse = compat.itertools_filterfalse +u = compat.u +ue = compat.ue +b = compat.b +unquote_plus = compat.unquote_plus +unquote = compat.unquote +b64decode = compat.b64decode +b64encode = compat.b64encode +byte_buffer = compat.byte_buffer +itertools_filter = compat.itertools_filter +iterbytes = compat.iterbytes +StringIO = compat.StringIO +inspect_getargspec = compat.inspect_getargspec +zip_longest = compat.zip_longest +KeyedTuple = _collections.KeyedTuple +ImmutableContainer = _collections.ImmutableContainer +immutabledict = _collections.immutabledict +Properties = _collections.Properties +OrderedProperties = _collections.OrderedProperties +ImmutableProperties = _collections.ImmutableProperties +OrderedDict = _collections.OrderedDict +OrderedSet = _collections.OrderedSet +IdentitySet = _collections.IdentitySet +OrderedIdentitySet = _collections.OrderedIdentitySet +column_set = _collections.column_set +column_dict = _collections.column_dict +ordered_column_set = _collections.ordered_column_set +populate_column_dict = _collections.populate_column_dict +unique_list = _collections.unique_list +UniqueAppender = _collections.UniqueAppender +PopulateDict = _collections.PopulateDict +EMPTY_SET = _collections.EMPTY_SET +to_list = _collections.to_list +to_set = _collections.to_set +to_column_set = _collections.to_column_set +update_copy = _collections.update_copy +flatten_iterator = _collections.flatten_iterator +has_intersection = _collections.has_intersection +LRUCache = _collections.LRUCache +ScopedRegistry = _collections.ScopedRegistry +ThreadLocalRegistry = _collections.ThreadLocalRegistry +WeakSequence = _collections.WeakSequence +coerce_generator_arg = _collections.coerce_generator_arg +lightweight_named_tuple = _collections.lightweight_named_tuple +iterate_attributes = langhelpers.iterate_attributes +class_hierarchy = langhelpers.class_hierarchy +portable_instancemethod = langhelpers.portable_instancemethod +unbound_method_to_callable = langhelpers.unbound_method_to_callable +getargspec_init = langhelpers.getargspec_init +format_argspec_init = langhelpers.format_argspec_init +format_argspec_plus = langhelpers.format_argspec_plus +get_func_kwargs = langhelpers.get_func_kwargs +get_cls_kwargs = langhelpers.get_cls_kwargs +decorator = langhelpers.decorator +as_interface = langhelpers.as_interface +memoized_property = langhelpers.memoized_property +memoized_instancemethod = langhelpers.memoized_instancemethod +md5_hex = langhelpers.md5_hex +group_expirable_memoized_property = langhelpers.group_expirable_memoized_property +dependencies = langhelpers.dependencies +decode_slice = langhelpers.decode_slice +monkeypatch_proxied_specials = langhelpers.monkeypatch_proxied_specials +asbool = langhelpers.asbool +bool_or_str = langhelpers.bool_or_str +coerce_kw_type = langhelpers.coerce_kw_type +duck_type_collection = langhelpers.duck_type_collection +assert_arg_type = langhelpers.assert_arg_type +symbol = langhelpers.symbol +dictlike_iteritems = langhelpers.dictlike_iteritems +classproperty = langhelpers.classproperty +set_creation_order = langhelpers.set_creation_order +warn_exception = langhelpers.warn_exception +warn = langhelpers.warn +NoneType = langhelpers.NoneType +constructor_copy = langhelpers.constructor_copy +methods_equivalent = langhelpers.methods_equivalent +chop_traceback = langhelpers.chop_traceback +asint = langhelpers.asint +generic_repr = langhelpers.generic_repr +counter = langhelpers.counter +PluginLoader = langhelpers.PluginLoader +hybridproperty = langhelpers.hybridproperty +hybridmethod = langhelpers.hybridmethod +safe_reraise = langhelpers.safe_reraise +get_callable_argspec = langhelpers.get_callable_argspec +only_once = langhelpers.only_once +attrsetter = langhelpers.attrsetter +ellipses_string = langhelpers.ellipses_string +warn_limited = langhelpers.warn_limited +map_bits = langhelpers.map_bits +MemoizedSlots = langhelpers.MemoizedSlots +EnsureKWArgType = langhelpers.EnsureKWArgType +warn_deprecated = deprecations.warn_deprecated +warn_pending_deprecation = deprecations.warn_pending_deprecation +deprecated = deprecations.deprecated +pending_deprecation = deprecations.pending_deprecation +inject_docstring_text = deprecations.inject_docstring_text diff --git a/third_party/2and3/sqlalchemy/util/_collections.pyi b/third_party/2and3/sqlalchemy/util/_collections.pyi new file mode 100644 index 000000000000..a25c7e989af1 --- /dev/null +++ b/third_party/2and3/sqlalchemy/util/_collections.pyi @@ -0,0 +1,214 @@ +# Stubs for sqlalchemy.util._collections (Python 2) +# +# NOTE: This dynamically typed stub was automatically generated by stubgen. + +from typing import Any +from . import compat + +threading = compat.threading +itertools_filterfalse = compat.itertools_filterfalse +string_types = compat.string_types + +EMPTY_SET = ... # type: Any + +class AbstractKeyedTuple(tuple): + def keys(self): ... + +class KeyedTuple(AbstractKeyedTuple): + def __new__(cls, vals, labels=...): ... + def __setattr__(self, key, value): ... + +class _LW(AbstractKeyedTuple): + def __new__(cls, vals): ... + def __reduce__(self): ... + +class ImmutableContainer: + __delitem__ = ... # type: Any + +class immutabledict(ImmutableContainer, dict): + clear = ... # type: Any + def __new__(cls, *args): ... + def __init__(self, *args) -> None: ... + def __reduce__(self): ... + def union(self, d): ... + +class Properties: + def __init__(self, data) -> None: ... + def __len__(self): ... + def __iter__(self): ... + def __add__(self, other): ... + def __setitem__(self, key, object): ... + def __getitem__(self, key): ... + def __delitem__(self, key): ... + def __setattr__(self, key, obj): ... + def __getattr__(self, key): ... + def __contains__(self, key): ... + def as_immutable(self): ... + def update(self, value): ... + def get(self, key, default=...): ... + def keys(self): ... + def values(self): ... + def items(self): ... + def has_key(self, key): ... + def clear(self): ... + +class OrderedProperties(Properties): + def __init__(self) -> None: ... + +class ImmutableProperties(ImmutableContainer, Properties): ... + +class OrderedDict(dict): + def __reduce__(self): ... + def __init__(self, ____sequence=..., **kwargs) -> None: ... + def clear(self): ... + def copy(self): ... + def __copy__(self): ... + def sort(self, *arg, **kw): ... + def update(self, ____sequence=..., **kwargs): ... + def setdefault(self, key, value): ... + def __iter__(self): ... + def keys(self): ... + def values(self): ... + def items(self): ... + def itervalues(self): ... + def iterkeys(self): ... + def iteritems(self): ... + def __setitem__(self, key, object): ... + def __delitem__(self, key): ... + def pop(self, key, *default): ... + def popitem(self): ... + +class OrderedSet(set): + def __init__(self, d=...) -> None: ... + def add(self, element): ... + def remove(self, element): ... + def insert(self, pos, element): ... + def discard(self, element): ... + def clear(self): ... + def __getitem__(self, key): ... + def __iter__(self): ... + def __add__(self, other): ... + def update(self, iterable): ... + __ior__ = ... # type: Any + def union(self, other): ... + __or__ = ... # type: Any + def intersection(self, other): ... + __and__ = ... # type: Any + def symmetric_difference(self, other): ... + __xor__ = ... # type: Any + def difference(self, other): ... + __sub__ = ... # type: Any + def intersection_update(self, other): ... + __iand__ = ... # type: Any + def symmetric_difference_update(self, other): ... + __ixor__ = ... # type: Any + def difference_update(self, other): ... + __isub__ = ... # type: Any + +class IdentitySet: + def __init__(self, iterable=...) -> None: ... + def add(self, value): ... + def __contains__(self, value): ... + def remove(self, value): ... + def discard(self, value): ... + def pop(self): ... + def clear(self): ... + def __cmp__(self, other): ... + def __eq__(self, other): ... + def __ne__(self, other): ... + def issubset(self, iterable): ... + def __le__(self, other): ... + def __lt__(self, other): ... + def issuperset(self, iterable): ... + def __ge__(self, other): ... + def __gt__(self, other): ... + def union(self, iterable): ... + def __or__(self, other): ... + def update(self, iterable): ... + def __ior__(self, other): ... + def difference(self, iterable): ... + def __sub__(self, other): ... + def difference_update(self, iterable): ... + def __isub__(self, other): ... + def intersection(self, iterable): ... + def __and__(self, other): ... + def intersection_update(self, iterable): ... + def __iand__(self, other): ... + def symmetric_difference(self, iterable): ... + def __xor__(self, other): ... + def symmetric_difference_update(self, iterable): ... + def __ixor__(self, other): ... + def copy(self): ... + __copy__ = ... # type: Any + def __len__(self): ... + def __iter__(self): ... + def __hash__(self): ... + +class WeakSequence: + def __init__(self, __elements=...) -> None: ... + def append(self, item): ... + def __len__(self): ... + def __iter__(self): ... + def __getitem__(self, index): ... + +class OrderedIdentitySet(IdentitySet): + class _working_set(OrderedSet): + __sa_hash_exempt__ = ... # type: Any + def __init__(self, iterable=...) -> None: ... + +class PopulateDict(dict): + creator = ... # type: Any + def __init__(self, creator) -> None: ... + def __missing__(self, key): ... + +column_set = set +column_dict = dict +ordered_column_set = OrderedSet +populate_column_dict = PopulateDict + +def unique_list(seq, hashfunc=...): ... + +class UniqueAppender: + data = ... # type: Any + def __init__(self, data, via=...) -> None: ... + def append(self, item): ... + def __iter__(self): ... + +def coerce_generator_arg(arg): ... +def to_list(x, default=...): ... +def has_intersection(set_, iterable): ... +def to_set(x): ... +def to_column_set(x): ... +def update_copy(d, _new=..., **kw): ... +def flatten_iterator(x): ... + +class LRUCache(dict): + capacity = ... # type: Any + threshold = ... # type: Any + def __init__(self, capacity=..., threshold=...) -> None: ... + def get(self, key, default=...): ... + def __getitem__(self, key): ... + def values(self): ... + def setdefault(self, key, value): ... + def __setitem__(self, key, value): ... + +def lightweight_named_tuple(name, fields): ... + +class ScopedRegistry: + createfunc = ... # type: Any + scopefunc = ... # type: Any + registry = ... # type: Any + def __init__(self, createfunc, scopefunc) -> None: ... + def __call__(self): ... + def has(self): ... + def set(self, obj): ... + def clear(self): ... + +class ThreadLocalRegistry(ScopedRegistry): + createfunc = ... # type: Any + registry = ... # type: Any + def __init__(self, createfunc) -> None: ... + def __call__(self): ... + def has(self): ... + def set(self, obj): ... + def clear(self): ... diff --git a/third_party/2and3/sqlalchemy/util/compat.pyi b/third_party/2and3/sqlalchemy/util/compat.pyi new file mode 100644 index 000000000000..c9afae67dad3 --- /dev/null +++ b/third_party/2and3/sqlalchemy/util/compat.pyi @@ -0,0 +1,67 @@ +# Stubs for sqlalchemy.util.compat (Python 2) + +from typing import Any +from collections import namedtuple + +import threading +import pickle +from six.moves.urllib.parse import (quote_plus, unquote_plus, + parse_qsl, quote, unquote) +# import configparser +from six.moves import StringIO + +from io import BytesIO as byte_buffer + +from operator import attrgetter as dottedgetter + +from six.moves import zip_longest + +py33 = ... # type: Any +py32 = ... # type: Any +py3k = ... # type: Any +py2k = ... # type: Any +py265 = ... # type: Any +jython = ... # type: Any +pypy = ... # type: Any +win32 = ... # type: Any +cpython = ... # type: Any +next = ... # type: Any +safe_kwarg = ... # type: Any + +ArgSpec = namedtuple('ArgSpec', ['args', 'varargs', 'keywords', 'defaults']) + +def inspect_getargspec(func): ... + +string_types = ... # type: Any +binary_type = ... # type: Any +text_type = str +int_types = ... # type: Any + +def callable(fn): ... +def cmp(a, b): ... + +itertools_filterfalse = ... # type: Any +itertools_filter = ... # type: Any +itertools_imap = ... # type: Any + +def b64encode(x): ... +def b64decode(x): ... + +def iterbytes(buf): ... +def u(s): ... +def ue(s): ... +def b(s): ... +def import_(*args): ... + +reduce = ... # type: Any + +def print_(*args, **kwargs): ... + +time_func = ... # type: Any + +def reraise(tp, value, tb=..., cause=...): ... +def raise_from_cause(exception, exc_info=...): ... + +def exec_(func_text, globals_, lcl=...): ... +def with_metaclass(meta, *bases): ... +def nested(*managers): ... diff --git a/third_party/2and3/sqlalchemy/util/deprecations.pyi b/third_party/2and3/sqlalchemy/util/deprecations.pyi new file mode 100644 index 000000000000..49940cf6bdc9 --- /dev/null +++ b/third_party/2and3/sqlalchemy/util/deprecations.pyi @@ -0,0 +1,13 @@ +# Stubs for sqlalchemy.util.deprecations (Python 2) +# +# NOTE: This dynamically typed stub was automatically generated by stubgen. + +from . import langhelpers + +decorator = langhelpers.decorator + +def warn_deprecated(msg, stacklevel=...): ... +def warn_pending_deprecation(msg, stacklevel=...): ... +def deprecated(version, message=..., add_deprecation_to_docstring=...): ... +def pending_deprecation(version, message=..., add_deprecation_to_docstring=...): ... +def inject_docstring_text(doctext, injecttext, pos): ... diff --git a/third_party/2and3/sqlalchemy/util/langhelpers.pyi b/third_party/2and3/sqlalchemy/util/langhelpers.pyi new file mode 100644 index 000000000000..c688ba33dfb5 --- /dev/null +++ b/third_party/2and3/sqlalchemy/util/langhelpers.pyi @@ -0,0 +1,134 @@ +# Stubs for sqlalchemy.util.langhelpers (Python 2) +# +# NOTE: This dynamically typed stub was automatically generated by stubgen. + +from typing import Any +from . import compat + +def md5_hex(x): ... + +class safe_reraise: + def __enter__(self): ... + def __exit__(self, type_, value, traceback): ... + +def decode_slice(slc): ... +def map_bits(fn, n): ... +def decorator(target): ... +def public_factory(target, location): ... + +class PluginLoader: + group = ... # type: Any + impls = ... # type: Any + auto_fn = ... # type: Any + def __init__(self, group, auto_fn=...) -> None: ... + def load(self, name): ... + def register(self, name, modulepath, objname): ... + +def get_cls_kwargs(cls, _set=...): ... +def inspect_func_args(fn): ... +def get_func_kwargs(func): ... +def get_callable_argspec(fn, no_self=..., _is_init=...): ... +def format_argspec_plus(fn, grouped=...): ... +def format_argspec_init(method, grouped=...): ... +def getargspec_init(method): ... +def unbound_method_to_callable(func_or_cls): ... +def generic_repr(obj, additional_kw=..., to_inspect=..., omit_kwarg=...): ... + +class portable_instancemethod: + target = ... # type: Any + name = ... # type: Any + def __init__(self, meth) -> None: ... + def __call__(self, *arg, **kw): ... + +def class_hierarchy(cls): ... +def iterate_attributes(cls): ... +def monkeypatch_proxied_specials(into_cls, from_cls, skip=..., only=..., name=..., from_instance=...): ... +def methods_equivalent(meth1, meth2): ... +def as_interface(obj, cls=..., methods=..., required=...): ... + +class memoized_property: + fget = ... # type: Any + __name__ = ... # type: Any + def __init__(self, fget, doc=...) -> None: ... + def __get__(self, obj, cls): ... + @classmethod + def reset(cls, obj, name): ... + +def memoized_instancemethod(fn): ... + +class group_expirable_memoized_property: + attributes = ... # type: Any + def __init__(self, attributes=...) -> None: ... + def expire_instance(self, instance): ... + def __call__(self, fn): ... + def method(self, fn): ... + +class MemoizedSlots: + def __getattr__(self, key): ... + +def dependency_for(modulename): ... + +class dependencies: + import_deps = ... # type: Any + def __init__(self, *deps) -> None: ... + def __call__(self, fn): ... + @classmethod + def resolve_all(cls, path): ... + class _importlater: + def __new__(cls, path, addtl): ... + def __init__(self, path, addtl) -> None: ... + def module(self): ... + def __getattr__(self, key): ... + +def asbool(obj): ... +def bool_or_str(*text): ... +def asint(value): ... +def coerce_kw_type(kw, key, type_, flexi_bool=...): ... +def constructor_copy(obj, cls, *args, **kw): ... +def counter(): ... +def duck_type_collection(specimen, default=...): ... +def assert_arg_type(arg, argtype, name): ... +def dictlike_iteritems(dictlike): ... + +class classproperty: + def __init__(self, fget, *arg, **kw) -> None: ... + def __get__(desc, self, cls): ... + +class hybridproperty: + func = ... # type: Any + def __init__(self, func) -> None: ... + def __get__(self, instance, owner): ... + +class hybridmethod: + func = ... # type: Any + def __init__(self, func) -> None: ... + def __get__(self, instance, owner): ... + +class _symbol(int): + def __new__(self, name, doc=..., canonical=...): ... + def __reduce__(self): ... + +class symbol: + symbols = ... # type: Any + def __new__(cls, name, doc=..., canonical=...): ... + +def set_creation_order(instance): ... +def warn_exception(func, *args, **kwargs): ... +def ellipses_string(value, len_=...): ... + +class _hash_limit_string(compat.text_type): + def __new__(cls, value, num, args): ... + def __hash__(self): ... + def __eq__(self, other): ... + +def warn(msg): ... +def warn_limited(msg, args): ... +def only_once(fn): ... +def chop_traceback(tb, exclude_prefix=..., exclude_suffix=...): ... + +NoneType = ... # type: Any + +def attrsetter(attrname): ... + +class EnsureKWArgType(type): + def __init__(cls, clsname, bases, clsdict) -> None: ... From 761859fa1a01f6a34e3fcd7e92184fa79a80602d Mon Sep 17 00:00:00 2001 From: Guido van Rossum Date: Tue, 13 Dec 2016 15:22:53 -0800 Subject: [PATCH 4/4] Update a comment. This is just to trigger the test to run again -- I have reasons to believe this PR is out of date. --- third_party/2and3/sqlalchemy/__init__.pyi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/third_party/2and3/sqlalchemy/__init__.pyi b/third_party/2and3/sqlalchemy/__init__.pyi index 717082c1897c..2ee839746de3 100644 --- a/third_party/2and3/sqlalchemy/__init__.pyi +++ b/third_party/2and3/sqlalchemy/__init__.pyi @@ -1,4 +1,4 @@ -# Stubs for sqlalchemy (Python 2) +# Stubs for sqlalchemy (Python 2 and 3) from .sql import ( alias,