basedpyright 1.13.2 → 1.13.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/pyright-langserver.js +1 -1
- package/dist/pyright-langserver.js.map +1 -1
- package/dist/pyright.js +1 -1
- package/dist/pyright.js.map +1 -1
- package/dist/typeshed-fallback/commit.txt +1 -1
- package/dist/typeshed-fallback/stdlib/VERSIONS +2 -0
- package/dist/typeshed-fallback/stdlib/_ast.pyi +42 -279
- package/dist/typeshed-fallback/stdlib/_bisect.pyi +221 -221
- package/dist/typeshed-fallback/stdlib/_bootlocale.pyi +1 -1
- package/dist/typeshed-fallback/stdlib/_collections_abc.pyi +15 -5
- package/dist/typeshed-fallback/stdlib/_csv.pyi +213 -213
- package/dist/typeshed-fallback/stdlib/_decimal.pyi +0 -18
- package/dist/typeshed-fallback/stdlib/_dummy_thread.pyi +33 -33
- package/dist/typeshed-fallback/stdlib/_dummy_threading.pyi +180 -164
- package/dist/typeshed-fallback/stdlib/_heapq.pyi +67 -67
- package/dist/typeshed-fallback/stdlib/_interpqueues.pyi +16 -0
- package/dist/typeshed-fallback/stdlib/_interpreters.pyi +50 -0
- package/dist/typeshed-fallback/stdlib/_json.pyi +92 -92
- package/dist/typeshed-fallback/stdlib/_lsprof.pyi +92 -92
- package/dist/typeshed-fallback/stdlib/_msi.pyi +94 -92
- package/dist/typeshed-fallback/stdlib/_operator.pyi +0 -24
- package/dist/typeshed-fallback/stdlib/_random.pyi +30 -30
- package/dist/typeshed-fallback/stdlib/_tkinter.pyi +6 -2
- package/dist/typeshed-fallback/stdlib/_weakrefset.pyi +7 -1
- package/dist/typeshed-fallback/stdlib/abc.pyi +12 -4
- package/dist/typeshed-fallback/stdlib/argparse.pyi +3 -1
- package/dist/typeshed-fallback/stdlib/array.pyi +281 -281
- package/dist/typeshed-fallback/stdlib/asynchat.pyi +21 -21
- package/dist/typeshed-fallback/stdlib/asyncio/events.pyi +35 -4
- package/dist/typeshed-fallback/stdlib/asyncio/futures.pyi +107 -15
- package/dist/typeshed-fallback/stdlib/asyncio/locks.pyi +9 -3
- package/dist/typeshed-fallback/stdlib/asyncio/queues.pyi +10 -2
- package/dist/typeshed-fallback/stdlib/asyncio/sslproto.pyi +23 -4
- package/dist/typeshed-fallback/stdlib/asyncio/tasks.pyi +107 -12
- package/dist/typeshed-fallback/stdlib/asyncio/windows_events.pyi +86 -86
- package/dist/typeshed-fallback/stdlib/asyncio/windows_utils.pyi +49 -49
- package/dist/typeshed-fallback/stdlib/asyncore.pyi +90 -90
- package/dist/typeshed-fallback/stdlib/audioop.pyi +95 -95
- package/dist/typeshed-fallback/stdlib/binascii.pyi +123 -123
- package/dist/typeshed-fallback/stdlib/binhex.pyi +45 -45
- package/dist/typeshed-fallback/stdlib/builtins.pyi +0 -1
- package/dist/typeshed-fallback/stdlib/bz2.pyi +59 -6
- package/dist/typeshed-fallback/stdlib/cmath.pyi +112 -112
- package/dist/typeshed-fallback/stdlib/codecs.pyi +18 -6
- package/dist/typeshed-fallback/stdlib/collections/__init__.pyi +200 -56
- package/dist/typeshed-fallback/stdlib/concurrent/futures/__init__.pyi +33 -14
- package/dist/typeshed-fallback/stdlib/concurrent/futures/_base.pyi +7 -1
- package/dist/typeshed-fallback/stdlib/concurrent/futures/thread.pyi +7 -1
- package/dist/typeshed-fallback/stdlib/contextvars.pyi +99 -16
- package/dist/typeshed-fallback/stdlib/csv.pyi +14 -2
- package/dist/typeshed-fallback/stdlib/ctypes/__init__.pyi +7 -1
- package/dist/typeshed-fallback/stdlib/ctypes/_endian.pyi +6 -2
- package/dist/typeshed-fallback/stdlib/curses/panel.pyi +16 -4
- package/dist/typeshed-fallback/stdlib/dataclasses.pyi +7 -1
- package/dist/typeshed-fallback/stdlib/datetime.pyi +346 -104
- package/dist/typeshed-fallback/stdlib/dbm/gnu.pyi +52 -2
- package/dist/typeshed-fallback/stdlib/dbm/ndbm.pyi +26 -2
- package/dist/typeshed-fallback/stdlib/difflib.pyi +7 -1
- package/dist/typeshed-fallback/stdlib/distutils/__init__.pyi +5 -5
- package/dist/typeshed-fallback/stdlib/distutils/archive_util.pyi +35 -35
- package/dist/typeshed-fallback/stdlib/distutils/bcppcompiler.pyi +3 -3
- package/dist/typeshed-fallback/stdlib/distutils/ccompiler.pyi +173 -173
- package/dist/typeshed-fallback/stdlib/distutils/cmd.pyi +99 -99
- package/dist/typeshed-fallback/stdlib/distutils/command/bdist.pyi +25 -25
- package/dist/typeshed-fallback/stdlib/distutils/command/bdist_dumb.pyi +21 -21
- package/dist/typeshed-fallback/stdlib/distutils/command/bdist_msi.pyi +45 -45
- package/dist/typeshed-fallback/stdlib/distutils/command/bdist_rpm.pyi +52 -52
- package/dist/typeshed-fallback/stdlib/distutils/command/bdist_wininst.pyi +16 -16
- package/dist/typeshed-fallback/stdlib/distutils/command/build.pyi +33 -33
- package/dist/typeshed-fallback/stdlib/distutils/command/build_clib.pyi +27 -27
- package/dist/typeshed-fallback/stdlib/distutils/command/build_ext.pyi +50 -50
- package/dist/typeshed-fallback/stdlib/distutils/command/build_py.pyi +44 -44
- package/dist/typeshed-fallback/stdlib/distutils/command/build_scripts.pyi +24 -24
- package/dist/typeshed-fallback/stdlib/distutils/command/check.pyi +39 -39
- package/dist/typeshed-fallback/stdlib/distutils/command/clean.pyi +17 -17
- package/dist/typeshed-fallback/stdlib/distutils/command/config.pyi +84 -84
- package/dist/typeshed-fallback/stdlib/distutils/command/install.pyi +65 -65
- package/dist/typeshed-fallback/stdlib/distutils/command/install_data.pyi +19 -19
- package/dist/typeshed-fallback/stdlib/distutils/command/install_egg_info.pyi +18 -18
- package/dist/typeshed-fallback/stdlib/distutils/command/install_headers.pyi +16 -16
- package/dist/typeshed-fallback/stdlib/distutils/command/install_lib.pyi +25 -25
- package/dist/typeshed-fallback/stdlib/distutils/command/install_scripts.pyi +18 -18
- package/dist/typeshed-fallback/stdlib/distutils/command/register.pyi +20 -20
- package/dist/typeshed-fallback/stdlib/distutils/command/sdist.pyi +44 -44
- package/dist/typeshed-fallback/stdlib/distutils/command/upload.pyi +17 -17
- package/dist/typeshed-fallback/stdlib/distutils/config.pyi +17 -17
- package/dist/typeshed-fallback/stdlib/distutils/core.pyi +57 -57
- package/dist/typeshed-fallback/stdlib/distutils/cygwinccompiler.pyi +20 -20
- package/dist/typeshed-fallback/stdlib/distutils/debug.pyi +1 -1
- package/dist/typeshed-fallback/stdlib/distutils/dep_util.pyi +14 -14
- package/dist/typeshed-fallback/stdlib/distutils/dir_util.pyi +23 -23
- package/dist/typeshed-fallback/stdlib/distutils/dist.pyi +149 -149
- package/dist/typeshed-fallback/stdlib/distutils/errors.pyi +19 -19
- package/dist/typeshed-fallback/stdlib/distutils/extension.pyi +36 -36
- package/dist/typeshed-fallback/stdlib/distutils/fancy_getopt.pyi +34 -34
- package/dist/typeshed-fallback/stdlib/distutils/file_util.pyi +38 -38
- package/dist/typeshed-fallback/stdlib/distutils/filelist.pyi +58 -58
- package/dist/typeshed-fallback/stdlib/distutils/log.pyi +25 -25
- package/dist/typeshed-fallback/stdlib/distutils/msvccompiler.pyi +3 -3
- package/dist/typeshed-fallback/stdlib/distutils/spawn.pyi +6 -6
- package/dist/typeshed-fallback/stdlib/distutils/sysconfig.pyi +33 -33
- package/dist/typeshed-fallback/stdlib/distutils/text_file.pyi +21 -21
- package/dist/typeshed-fallback/stdlib/distutils/unixccompiler.pyi +3 -3
- package/dist/typeshed-fallback/stdlib/distutils/util.pyi +50 -50
- package/dist/typeshed-fallback/stdlib/distutils/version.pyi +38 -36
- package/dist/typeshed-fallback/stdlib/dummy_threading.pyi +2 -2
- package/dist/typeshed-fallback/stdlib/email/_header_value_parser.pyi +3 -1
- package/dist/typeshed-fallback/stdlib/email/charset.pyi +3 -1
- package/dist/typeshed-fallback/stdlib/email/header.pyi +3 -1
- package/dist/typeshed-fallback/stdlib/email/headerregistry.pyi +6 -1
- package/dist/typeshed-fallback/stdlib/enum.pyi +8 -1
- package/dist/typeshed-fallback/stdlib/filecmp.pyi +7 -1
- package/dist/typeshed-fallback/stdlib/fileinput.pyi +7 -1
- package/dist/typeshed-fallback/stdlib/formatter.pyi +88 -88
- package/dist/typeshed-fallback/stdlib/fractions.pyi +6 -2
- package/dist/typeshed-fallback/stdlib/functools.pyi +65 -13
- package/dist/typeshed-fallback/stdlib/graphlib.pyi +7 -1
- package/dist/typeshed-fallback/stdlib/gzip.pyi +3 -1
- package/dist/typeshed-fallback/stdlib/hashlib.pyi +42 -14
- package/dist/typeshed-fallback/stdlib/heapq.pyi +3 -1
- package/dist/typeshed-fallback/stdlib/hmac.pyi +30 -2
- package/dist/typeshed-fallback/stdlib/http/cookies.pyi +7 -1
- package/dist/typeshed-fallback/stdlib/imp.pyi +62 -62
- package/dist/typeshed-fallback/stdlib/importlib/abc.pyi +3 -1
- package/dist/typeshed-fallback/stdlib/importlib/machinery.pyi +3 -1
- package/dist/typeshed-fallback/stdlib/importlib/metadata/__init__.pyi +79 -15
- package/dist/typeshed-fallback/stdlib/importlib/metadata/_meta.pyi +3 -1
- package/dist/typeshed-fallback/stdlib/importlib/resources/simple.pyi +3 -1
- package/dist/typeshed-fallback/stdlib/io.pyi +428 -44
- package/dist/typeshed-fallback/stdlib/ipaddress.pyi +153 -28
- package/dist/typeshed-fallback/stdlib/itertools.pyi +5 -1
- package/dist/typeshed-fallback/stdlib/json/encoder.pyi +14 -2
- package/dist/typeshed-fallback/stdlib/keyword.pyi +6 -2
- package/dist/typeshed-fallback/stdlib/lib2to3/pytree.pyi +12 -2
- package/dist/typeshed-fallback/stdlib/logging/__init__.pyi +17 -3
- package/dist/typeshed-fallback/stdlib/lzma.pyi +107 -9
- package/dist/typeshed-fallback/stdlib/mailbox.pyi +14 -2
- package/dist/typeshed-fallback/stdlib/math.pyi +424 -424
- package/dist/typeshed-fallback/stdlib/mmap.pyi +160 -160
- package/dist/typeshed-fallback/stdlib/msilib/__init__.pyi +177 -177
- package/dist/typeshed-fallback/stdlib/msilib/schema.pyi +94 -94
- package/dist/typeshed-fallback/stdlib/msilib/sequence.pyi +13 -13
- package/dist/typeshed-fallback/stdlib/msilib/text.pyi +7 -7
- package/dist/typeshed-fallback/stdlib/multiprocessing/connection.pyi +9 -3
- package/dist/typeshed-fallback/stdlib/multiprocessing/context.pyi +12 -2
- package/dist/typeshed-fallback/stdlib/multiprocessing/dummy/__init__.pyi +3 -1
- package/dist/typeshed-fallback/stdlib/multiprocessing/managers.pyi +10 -2
- package/dist/typeshed-fallback/stdlib/multiprocessing/pool.pyi +7 -1
- package/dist/typeshed-fallback/stdlib/multiprocessing/popen_spawn_win32.pyi +30 -30
- package/dist/typeshed-fallback/stdlib/multiprocessing/process.pyi +15 -4
- package/dist/typeshed-fallback/stdlib/multiprocessing/queues.pyi +14 -2
- package/dist/typeshed-fallback/stdlib/multiprocessing/shared_memory.pyi +19 -5
- package/dist/typeshed-fallback/stdlib/nis.pyi +31 -4
- package/dist/typeshed-fallback/stdlib/numbers.pyi +26 -6
- package/dist/typeshed-fallback/stdlib/opcode.pyi +3 -1
- package/dist/typeshed-fallback/stdlib/optparse.pyi +3 -1
- package/dist/typeshed-fallback/stdlib/os/__init__.pyi +1447 -217
- package/dist/typeshed-fallback/stdlib/pathlib.pyi +42 -11
- package/dist/typeshed-fallback/stdlib/pickle.pyi +200 -12
- package/dist/typeshed-fallback/stdlib/posixpath.pyi +6 -2
- package/dist/typeshed-fallback/stdlib/pyexpat/errors.pyi +2 -0
- package/dist/typeshed-fallback/stdlib/pyexpat/model.pyi +2 -0
- package/dist/typeshed-fallback/stdlib/queue.pyi +57 -9
- package/dist/typeshed-fallback/stdlib/re.pyi +219 -57
- package/dist/typeshed-fallback/stdlib/sched.pyi +8 -1
- package/dist/typeshed-fallback/stdlib/signal.pyi +95 -19
- package/dist/typeshed-fallback/stdlib/smtpd.pyi +91 -91
- package/dist/typeshed-fallback/stdlib/socket.pyi +12 -2
- package/dist/typeshed-fallback/stdlib/sqlite3/dbapi2.pyi +417 -83
- package/dist/typeshed-fallback/stdlib/ssl.pyi +133 -22
- package/dist/typeshed-fallback/stdlib/statistics.pyi +20 -5
- package/dist/typeshed-fallback/stdlib/struct.pyi +114 -13
- package/dist/typeshed-fallback/stdlib/subprocess.pyi +14 -2
- package/dist/typeshed-fallback/stdlib/symbol.pyi +93 -93
- package/dist/typeshed-fallback/stdlib/symtable.pyi +30 -1
- package/dist/typeshed-fallback/stdlib/sys/__init__.pyi +7 -3
- package/dist/typeshed-fallback/stdlib/tarfile.pyi +6 -2
- package/dist/typeshed-fallback/stdlib/tempfile.pyi +17 -3
- package/dist/typeshed-fallback/stdlib/threading.pyi +68 -7
- package/dist/typeshed-fallback/stdlib/tkinter/__init__.pyi +3 -1
- package/dist/typeshed-fallback/stdlib/turtle.pyi +11 -3
- package/dist/typeshed-fallback/stdlib/types.pyi +306 -79
- package/dist/typeshed-fallback/stdlib/typing.pyi +310 -31
- package/dist/typeshed-fallback/stdlib/typing_extensions.pyi +42 -11
- package/dist/typeshed-fallback/stdlib/unittest/__init__.pyi +6 -1
- package/dist/typeshed-fallback/stdlib/unittest/case.pyi +7 -1
- package/dist/typeshed-fallback/stdlib/unittest/mock.pyi +3 -1
- package/dist/typeshed-fallback/stdlib/urllib/parse.pyi +51 -3
- package/dist/typeshed-fallback/stdlib/weakref.pyi +6 -2
- package/dist/typeshed-fallback/stdlib/winsound.pyi +44 -28
- package/dist/typeshed-fallback/stdlib/xml/dom/minicompat.pyi +6 -2
- package/dist/typeshed-fallback/stdlib/xml/dom/minidom.pyi +33 -11
- package/dist/typeshed-fallback/stdlib/xml/etree/ElementTree.pyi +30 -10
- package/dist/typeshed-fallback/stdlib/xml/parsers/expat/errors.pyi +2 -0
- package/dist/typeshed-fallback/stdlib/xml/parsers/expat/model.pyi +2 -0
- package/dist/typeshed-fallback/stdlib/xxlimited.pyi +19 -4
- package/dist/typeshed-fallback/stdlib/zipimport.pyi +31 -0
- package/dist/typeshed-fallback/stdlib/zlib.pyi +157 -157
- package/dist/typeshed-fallback/stdlib/zoneinfo/__init__.pyi +18 -6
- package/dist/typeshed-fallback/stubs/assertpy/assertpy/extracting.pyi +2 -2
- package/dist/typeshed-fallback/stubs/docker/docker/_types.pyi +18 -1
- package/dist/typeshed-fallback/stubs/docker/docker/api/container.pyi +5 -19
- package/dist/typeshed-fallback/stubs/docker/docker/api/daemon.pyi +2 -1
- package/dist/typeshed-fallback/stubs/docker/docker/models/containers.pyi +268 -6
- package/dist/typeshed-fallback/stubs/docker/docker/types/containers.pyi +3 -7
- package/dist/typeshed-fallback/stubs/docker/docker/types/daemon.pyi +10 -4
- package/dist/typeshed-fallback/stubs/docutils/docutils/parsers/rst/states.pyi +47 -0
- package/dist/typeshed-fallback/stubs/gdb/gdb/__init__.pyi +1 -1
- package/dist/typeshed-fallback/stubs/networkx/networkx/algorithms/shortest_paths/generic.pyi +1 -1
- package/dist/typeshed-fallback/stubs/openpyxl/METADATA.toml +1 -1
- package/dist/typeshed-fallback/stubs/openpyxl/openpyxl/packaging/extended.pyi +0 -2
- package/dist/typeshed-fallback/stubs/openpyxl/openpyxl/styles/named_styles.pyi +2 -1
- package/dist/typeshed-fallback/stubs/pygit2/METADATA.toml +1 -1
- package/dist/typeshed-fallback/stubs/pytest-lazy-fixture/pytest_lazyfixture.pyi +2 -2
- package/dist/typeshed-fallback/stubs/python-crontab/METADATA.toml +1 -1
- package/dist/typeshed-fallback/stubs/reportlab/METADATA.toml +1 -1
- package/dist/typeshed-fallback/stubs/reportlab/reportlab/lib/rl_safe_eval.pyi +23 -11
- package/dist/typeshed-fallback/stubs/reportlab/reportlab/pdfbase/pdfdoc.pyi +6 -0
- package/dist/typeshed-fallback/stubs/setuptools/METADATA.toml +1 -1
- package/dist/typeshed-fallback/stubs/setuptools/setuptools/_distutils/archive_util.pyi +8 -8
- package/dist/typeshed-fallback/stubs/setuptools/setuptools/_distutils/ccompiler.pyi +11 -17
- package/dist/typeshed-fallback/stubs/setuptools/setuptools/_distutils/cmd.pyi +11 -11
- package/dist/typeshed-fallback/stubs/setuptools/setuptools/_distutils/command/build_py.pyi +1 -2
- package/dist/typeshed-fallback/stubs/setuptools/setuptools/_distutils/filelist.pyi +4 -12
- package/dist/typeshed-fallback/stubs/setuptools/setuptools/_distutils/sysconfig.pyi +2 -4
- package/dist/typeshed-fallback/stubs/setuptools/setuptools/_distutils/util.pyi +5 -8
- package/dist/typeshed-fallback/stubs/str2bool/METADATA.toml +2 -0
- package/dist/typeshed-fallback/stubs/str2bool/str2bool/__init__.pyi +7 -0
- package/package.json +1 -1
|
@@ -1,157 +1,157 @@
|
|
|
1
|
-
"""
|
|
2
|
-
The functions in this module allow compression and decompression using the
|
|
3
|
-
zlib library, which is based on GNU zip.
|
|
4
|
-
|
|
5
|
-
adler32(string[, start]) -- Compute an Adler-32 checksum.
|
|
6
|
-
compress(data[, level]) -- Compress data, with compression level 0-9 or -1.
|
|
7
|
-
compressobj([level[, ...]]) -- Return a compressor object.
|
|
8
|
-
crc32(string[, start]) -- Compute a CRC-32 checksum.
|
|
9
|
-
decompress(string,[wbits],[bufsize]) -- Decompresses a compressed string.
|
|
10
|
-
decompressobj([wbits[, zdict]]]) -- Return a decompressor object.
|
|
11
|
-
|
|
12
|
-
'wbits' is window buffer size and container format.
|
|
13
|
-
Compressor objects support compress() and flush() methods; decompressor
|
|
14
|
-
objects support decompress() and flush().
|
|
15
|
-
"""
|
|
16
|
-
|
|
17
|
-
import sys
|
|
18
|
-
from _typeshed import ReadableBuffer
|
|
19
|
-
from typing import Literal
|
|
20
|
-
|
|
21
|
-
DEFLATED: Literal[8]
|
|
22
|
-
DEF_MEM_LEVEL: int # can change
|
|
23
|
-
DEF_BUF_SIZE: Literal[16384]
|
|
24
|
-
MAX_WBITS: int
|
|
25
|
-
ZLIB_VERSION: str # can change
|
|
26
|
-
ZLIB_RUNTIME_VERSION: str # can change
|
|
27
|
-
Z_NO_COMPRESSION: Literal[0]
|
|
28
|
-
Z_PARTIAL_FLUSH: Literal[1]
|
|
29
|
-
Z_BEST_COMPRESSION: Literal[9]
|
|
30
|
-
Z_BEST_SPEED: Literal[1]
|
|
31
|
-
Z_BLOCK: Literal[5]
|
|
32
|
-
Z_DEFAULT_COMPRESSION: Literal[-1]
|
|
33
|
-
Z_DEFAULT_STRATEGY: Literal[0]
|
|
34
|
-
Z_FILTERED: Literal[1]
|
|
35
|
-
Z_FINISH: Literal[4]
|
|
36
|
-
Z_FIXED: Literal[4]
|
|
37
|
-
Z_FULL_FLUSH: Literal[3]
|
|
38
|
-
Z_HUFFMAN_ONLY: Literal[2]
|
|
39
|
-
Z_NO_FLUSH: Literal[0]
|
|
40
|
-
Z_RLE: Literal[3]
|
|
41
|
-
Z_SYNC_FLUSH: Literal[2]
|
|
42
|
-
Z_TREES: Literal[6]
|
|
43
|
-
|
|
44
|
-
class error(Exception): ...
|
|
45
|
-
|
|
46
|
-
class _Compress:
|
|
47
|
-
def compress(self, data: ReadableBuffer) -> bytes: ...
|
|
48
|
-
def flush(self, mode: int = ...) -> bytes: ...
|
|
49
|
-
def copy(self) -> _Compress: ...
|
|
50
|
-
|
|
51
|
-
class _Decompress:
|
|
52
|
-
unused_data: bytes
|
|
53
|
-
unconsumed_tail: bytes
|
|
54
|
-
eof: bool
|
|
55
|
-
def decompress(self, data: ReadableBuffer, max_length: int = ...) -> bytes: ...
|
|
56
|
-
def flush(self, length: int = ...) -> bytes: ...
|
|
57
|
-
def copy(self) -> _Decompress: ...
|
|
58
|
-
|
|
59
|
-
def adler32(data: ReadableBuffer, value: int = 1, /) -> int:
|
|
60
|
-
"""
|
|
61
|
-
Compute an Adler-32 checksum of data.
|
|
62
|
-
|
|
63
|
-
value
|
|
64
|
-
Starting value of the checksum.
|
|
65
|
-
|
|
66
|
-
The returned checksum is an integer.
|
|
67
|
-
"""
|
|
68
|
-
...
|
|
69
|
-
|
|
70
|
-
if sys.version_info >= (3, 11):
|
|
71
|
-
def compress(data: ReadableBuffer, /, level: int = -1, wbits: int = 15) -> bytes:
|
|
72
|
-
"""
|
|
73
|
-
Returns a bytes object containing compressed data.
|
|
74
|
-
|
|
75
|
-
data
|
|
76
|
-
Binary data to be compressed.
|
|
77
|
-
level
|
|
78
|
-
Compression level, in 0-9 or -1.
|
|
79
|
-
wbits
|
|
80
|
-
The window buffer size and container format.
|
|
81
|
-
"""
|
|
82
|
-
...
|
|
83
|
-
|
|
84
|
-
else:
|
|
85
|
-
def compress(data: ReadableBuffer, /, level: int = -1) -> bytes:
|
|
86
|
-
"""
|
|
87
|
-
Returns a bytes object containing compressed data.
|
|
88
|
-
|
|
89
|
-
data
|
|
90
|
-
Binary data to be compressed.
|
|
91
|
-
level
|
|
92
|
-
Compression level, in 0-9 or -1.
|
|
93
|
-
"""
|
|
94
|
-
...
|
|
95
|
-
|
|
96
|
-
def compressobj(
|
|
97
|
-
level: int = -1, method: int = 8, wbits: int = 15, memLevel: int = 8, strategy: int = 0, zdict: ReadableBuffer | None = None
|
|
98
|
-
) -> _Compress:
|
|
99
|
-
"""
|
|
100
|
-
Return a compressor object.
|
|
101
|
-
|
|
102
|
-
level
|
|
103
|
-
The compression level (an integer in the range 0-9 or -1; default is
|
|
104
|
-
currently equivalent to 6). Higher compression levels are slower,
|
|
105
|
-
but produce smaller results.
|
|
106
|
-
method
|
|
107
|
-
The compression algorithm. If given, this must be DEFLATED.
|
|
108
|
-
wbits
|
|
109
|
-
+9 to +15: The base-two logarithm of the window size. Include a zlib
|
|
110
|
-
container.
|
|
111
|
-
-9 to -15: Generate a raw stream.
|
|
112
|
-
+25 to +31: Include a gzip container.
|
|
113
|
-
memLevel
|
|
114
|
-
Controls the amount of memory used for internal compression state.
|
|
115
|
-
Valid values range from 1 to 9. Higher values result in higher memory
|
|
116
|
-
usage, faster compression, and smaller output.
|
|
117
|
-
strategy
|
|
118
|
-
Used to tune the compression algorithm. Possible values are
|
|
119
|
-
Z_DEFAULT_STRATEGY, Z_FILTERED, and Z_HUFFMAN_ONLY.
|
|
120
|
-
zdict
|
|
121
|
-
The predefined compression dictionary - a sequence of bytes
|
|
122
|
-
containing subsequences that are likely to occur in the input data.
|
|
123
|
-
"""
|
|
124
|
-
...
|
|
125
|
-
def crc32(data: ReadableBuffer, value: int = 0, /) -> int:
|
|
126
|
-
"""
|
|
127
|
-
Compute a CRC-32 checksum of data.
|
|
128
|
-
|
|
129
|
-
value
|
|
130
|
-
Starting value of the checksum.
|
|
131
|
-
|
|
132
|
-
The returned checksum is an integer.
|
|
133
|
-
"""
|
|
134
|
-
...
|
|
135
|
-
def decompress(data: ReadableBuffer, /, wbits: int = 15, bufsize: int = 16384) -> bytes:
|
|
136
|
-
"""
|
|
137
|
-
Returns a bytes object containing the uncompressed data.
|
|
138
|
-
|
|
139
|
-
data
|
|
140
|
-
Compressed data.
|
|
141
|
-
wbits
|
|
142
|
-
The window buffer size and container format.
|
|
143
|
-
bufsize
|
|
144
|
-
The initial output buffer size.
|
|
145
|
-
"""
|
|
146
|
-
...
|
|
147
|
-
def decompressobj(wbits: int = 15, zdict: ReadableBuffer = b"") -> _Decompress:
|
|
148
|
-
"""
|
|
149
|
-
Return a decompressor object.
|
|
150
|
-
|
|
151
|
-
wbits
|
|
152
|
-
The window buffer size and container format.
|
|
153
|
-
zdict
|
|
154
|
-
The predefined compression dictionary. This must be the same
|
|
155
|
-
dictionary as used by the compressor that produced the input data.
|
|
156
|
-
"""
|
|
157
|
-
...
|
|
1
|
+
"""
|
|
2
|
+
The functions in this module allow compression and decompression using the
|
|
3
|
+
zlib library, which is based on GNU zip.
|
|
4
|
+
|
|
5
|
+
adler32(string[, start]) -- Compute an Adler-32 checksum.
|
|
6
|
+
compress(data[, level]) -- Compress data, with compression level 0-9 or -1.
|
|
7
|
+
compressobj([level[, ...]]) -- Return a compressor object.
|
|
8
|
+
crc32(string[, start]) -- Compute a CRC-32 checksum.
|
|
9
|
+
decompress(string,[wbits],[bufsize]) -- Decompresses a compressed string.
|
|
10
|
+
decompressobj([wbits[, zdict]]]) -- Return a decompressor object.
|
|
11
|
+
|
|
12
|
+
'wbits' is window buffer size and container format.
|
|
13
|
+
Compressor objects support compress() and flush() methods; decompressor
|
|
14
|
+
objects support decompress() and flush().
|
|
15
|
+
"""
|
|
16
|
+
|
|
17
|
+
import sys
|
|
18
|
+
from _typeshed import ReadableBuffer
|
|
19
|
+
from typing import Literal
|
|
20
|
+
|
|
21
|
+
DEFLATED: Literal[8]
|
|
22
|
+
DEF_MEM_LEVEL: int # can change
|
|
23
|
+
DEF_BUF_SIZE: Literal[16384]
|
|
24
|
+
MAX_WBITS: int
|
|
25
|
+
ZLIB_VERSION: str # can change
|
|
26
|
+
ZLIB_RUNTIME_VERSION: str # can change
|
|
27
|
+
Z_NO_COMPRESSION: Literal[0]
|
|
28
|
+
Z_PARTIAL_FLUSH: Literal[1]
|
|
29
|
+
Z_BEST_COMPRESSION: Literal[9]
|
|
30
|
+
Z_BEST_SPEED: Literal[1]
|
|
31
|
+
Z_BLOCK: Literal[5]
|
|
32
|
+
Z_DEFAULT_COMPRESSION: Literal[-1]
|
|
33
|
+
Z_DEFAULT_STRATEGY: Literal[0]
|
|
34
|
+
Z_FILTERED: Literal[1]
|
|
35
|
+
Z_FINISH: Literal[4]
|
|
36
|
+
Z_FIXED: Literal[4]
|
|
37
|
+
Z_FULL_FLUSH: Literal[3]
|
|
38
|
+
Z_HUFFMAN_ONLY: Literal[2]
|
|
39
|
+
Z_NO_FLUSH: Literal[0]
|
|
40
|
+
Z_RLE: Literal[3]
|
|
41
|
+
Z_SYNC_FLUSH: Literal[2]
|
|
42
|
+
Z_TREES: Literal[6]
|
|
43
|
+
|
|
44
|
+
class error(Exception): ...
|
|
45
|
+
|
|
46
|
+
class _Compress:
|
|
47
|
+
def compress(self, data: ReadableBuffer) -> bytes: ...
|
|
48
|
+
def flush(self, mode: int = ...) -> bytes: ...
|
|
49
|
+
def copy(self) -> _Compress: ...
|
|
50
|
+
|
|
51
|
+
class _Decompress:
|
|
52
|
+
unused_data: bytes
|
|
53
|
+
unconsumed_tail: bytes
|
|
54
|
+
eof: bool
|
|
55
|
+
def decompress(self, data: ReadableBuffer, max_length: int = ...) -> bytes: ...
|
|
56
|
+
def flush(self, length: int = ...) -> bytes: ...
|
|
57
|
+
def copy(self) -> _Decompress: ...
|
|
58
|
+
|
|
59
|
+
def adler32(data: ReadableBuffer, value: int = 1, /) -> int:
|
|
60
|
+
"""
|
|
61
|
+
Compute an Adler-32 checksum of data.
|
|
62
|
+
|
|
63
|
+
value
|
|
64
|
+
Starting value of the checksum.
|
|
65
|
+
|
|
66
|
+
The returned checksum is an integer.
|
|
67
|
+
"""
|
|
68
|
+
...
|
|
69
|
+
|
|
70
|
+
if sys.version_info >= (3, 11):
|
|
71
|
+
def compress(data: ReadableBuffer, /, level: int = -1, wbits: int = 15) -> bytes:
|
|
72
|
+
"""
|
|
73
|
+
Returns a bytes object containing compressed data.
|
|
74
|
+
|
|
75
|
+
data
|
|
76
|
+
Binary data to be compressed.
|
|
77
|
+
level
|
|
78
|
+
Compression level, in 0-9 or -1.
|
|
79
|
+
wbits
|
|
80
|
+
The window buffer size and container format.
|
|
81
|
+
"""
|
|
82
|
+
...
|
|
83
|
+
|
|
84
|
+
else:
|
|
85
|
+
def compress(data: ReadableBuffer, /, level: int = -1) -> bytes:
|
|
86
|
+
"""
|
|
87
|
+
Returns a bytes object containing compressed data.
|
|
88
|
+
|
|
89
|
+
data
|
|
90
|
+
Binary data to be compressed.
|
|
91
|
+
level
|
|
92
|
+
Compression level, in 0-9 or -1.
|
|
93
|
+
"""
|
|
94
|
+
...
|
|
95
|
+
|
|
96
|
+
def compressobj(
|
|
97
|
+
level: int = -1, method: int = 8, wbits: int = 15, memLevel: int = 8, strategy: int = 0, zdict: ReadableBuffer | None = None
|
|
98
|
+
) -> _Compress:
|
|
99
|
+
"""
|
|
100
|
+
Return a compressor object.
|
|
101
|
+
|
|
102
|
+
level
|
|
103
|
+
The compression level (an integer in the range 0-9 or -1; default is
|
|
104
|
+
currently equivalent to 6). Higher compression levels are slower,
|
|
105
|
+
but produce smaller results.
|
|
106
|
+
method
|
|
107
|
+
The compression algorithm. If given, this must be DEFLATED.
|
|
108
|
+
wbits
|
|
109
|
+
+9 to +15: The base-two logarithm of the window size. Include a zlib
|
|
110
|
+
container.
|
|
111
|
+
-9 to -15: Generate a raw stream.
|
|
112
|
+
+25 to +31: Include a gzip container.
|
|
113
|
+
memLevel
|
|
114
|
+
Controls the amount of memory used for internal compression state.
|
|
115
|
+
Valid values range from 1 to 9. Higher values result in higher memory
|
|
116
|
+
usage, faster compression, and smaller output.
|
|
117
|
+
strategy
|
|
118
|
+
Used to tune the compression algorithm. Possible values are
|
|
119
|
+
Z_DEFAULT_STRATEGY, Z_FILTERED, and Z_HUFFMAN_ONLY.
|
|
120
|
+
zdict
|
|
121
|
+
The predefined compression dictionary - a sequence of bytes
|
|
122
|
+
containing subsequences that are likely to occur in the input data.
|
|
123
|
+
"""
|
|
124
|
+
...
|
|
125
|
+
def crc32(data: ReadableBuffer, value: int = 0, /) -> int:
|
|
126
|
+
"""
|
|
127
|
+
Compute a CRC-32 checksum of data.
|
|
128
|
+
|
|
129
|
+
value
|
|
130
|
+
Starting value of the checksum.
|
|
131
|
+
|
|
132
|
+
The returned checksum is an integer.
|
|
133
|
+
"""
|
|
134
|
+
...
|
|
135
|
+
def decompress(data: ReadableBuffer, /, wbits: int = 15, bufsize: int = 16384) -> bytes:
|
|
136
|
+
"""
|
|
137
|
+
Returns a bytes object containing the uncompressed data.
|
|
138
|
+
|
|
139
|
+
data
|
|
140
|
+
Compressed data.
|
|
141
|
+
wbits
|
|
142
|
+
The window buffer size and container format.
|
|
143
|
+
bufsize
|
|
144
|
+
The initial output buffer size.
|
|
145
|
+
"""
|
|
146
|
+
...
|
|
147
|
+
def decompressobj(wbits: int = 15, zdict: ReadableBuffer = b"") -> _Decompress:
|
|
148
|
+
"""
|
|
149
|
+
Return a decompressor object.
|
|
150
|
+
|
|
151
|
+
wbits
|
|
152
|
+
The window buffer size and container format.
|
|
153
|
+
zdict
|
|
154
|
+
The predefined compression dictionary. This must be the same
|
|
155
|
+
dictionary as used by the compressor that produced the input data.
|
|
156
|
+
"""
|
|
157
|
+
...
|
|
@@ -15,14 +15,26 @@ class ZoneInfo(tzinfo):
|
|
|
15
15
|
def key(self) -> str: ...
|
|
16
16
|
def __init__(self, key: str) -> None: ...
|
|
17
17
|
@classmethod
|
|
18
|
-
def no_cache(cls, key: str) -> Self:
|
|
18
|
+
def no_cache(cls, key: str) -> Self:
|
|
19
|
+
"""Get a new instance of ZoneInfo, bypassing the cache."""
|
|
20
|
+
...
|
|
19
21
|
@classmethod
|
|
20
|
-
def from_file(cls, fobj: _IOBytes, /, key: str | None = None) -> Self:
|
|
22
|
+
def from_file(cls, fobj: _IOBytes, /, key: str | None = None) -> Self:
|
|
23
|
+
"""Create a ZoneInfo file from a file object."""
|
|
24
|
+
...
|
|
21
25
|
@classmethod
|
|
22
|
-
def clear_cache(cls, *, only_keys: Iterable[str] | None = None) -> None:
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
def
|
|
26
|
+
def clear_cache(cls, *, only_keys: Iterable[str] | None = None) -> None:
|
|
27
|
+
"""Clear the ZoneInfo cache."""
|
|
28
|
+
...
|
|
29
|
+
def tzname(self, dt: datetime | None, /) -> str | None:
|
|
30
|
+
"""Retrieve a string containing the abbreviation for the time zone that applies in a zone at a given datetime."""
|
|
31
|
+
...
|
|
32
|
+
def utcoffset(self, dt: datetime | None, /) -> timedelta | None:
|
|
33
|
+
"""Retrieve a timedelta representing the UTC offset in a zone at the given datetime."""
|
|
34
|
+
...
|
|
35
|
+
def dst(self, dt: datetime | None, /) -> timedelta | None:
|
|
36
|
+
"""Retrieve a timedelta representing the amount of DST applied in a zone at the given datetime."""
|
|
37
|
+
...
|
|
26
38
|
|
|
27
39
|
# Note: Both here and in clear_cache, the types allow the use of `str` where
|
|
28
40
|
# a sequence of strings is required. This should be remedied if a solution
|
|
@@ -8,6 +8,6 @@ class ExtractingMixin:
|
|
|
8
8
|
def extracting(
|
|
9
9
|
self,
|
|
10
10
|
*names: str,
|
|
11
|
-
filter: str | Mapping[str, Any] | Callable[[Any], bool]
|
|
12
|
-
sort: str | _Iterable[str] | Callable[[Any], Any]
|
|
11
|
+
filter: str | Mapping[str, Any] | Callable[[Any], bool] = ...,
|
|
12
|
+
sort: str | _Iterable[str] | Callable[[Any], Any] = ...,
|
|
13
13
|
) -> Self: ...
|
|
@@ -1,8 +1,25 @@
|
|
|
1
1
|
# Internal-use module for types shared by multiple modules.
|
|
2
2
|
# This does not match a module in docker-py.
|
|
3
3
|
|
|
4
|
-
from
|
|
4
|
+
from pathlib import Path
|
|
5
|
+
from typing import TypedDict, type_check_only
|
|
6
|
+
from typing_extensions import NotRequired, TypeAlias
|
|
5
7
|
|
|
6
8
|
# Type alias for JSON, explained at:
|
|
7
9
|
# https://github.com/python/typing/issues/182#issuecomment-1320974824.
|
|
8
10
|
JSON: TypeAlias = dict[str, JSON] | list[JSON] | str | int | float | bool | None
|
|
11
|
+
|
|
12
|
+
@type_check_only
|
|
13
|
+
class ContainerWeightDevice(TypedDict):
|
|
14
|
+
Path: Path
|
|
15
|
+
Weight: int
|
|
16
|
+
|
|
17
|
+
# See https://docs.docker.com/engine/api/v1.42/#tag/Container/operation/ContainerWait
|
|
18
|
+
@type_check_only
|
|
19
|
+
class _WaitErrorDetails(TypedDict):
|
|
20
|
+
Message: str
|
|
21
|
+
|
|
22
|
+
@type_check_only
|
|
23
|
+
class WaitContainerResponse(TypedDict):
|
|
24
|
+
StatusCode: int
|
|
25
|
+
Error: NotRequired[_WaitErrorDetails]
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import datetime
|
|
2
2
|
from _typeshed import Incomplete
|
|
3
3
|
from typing import Literal, TypedDict, overload, type_check_only
|
|
4
|
-
from typing_extensions import
|
|
4
|
+
from typing_extensions import TypeAlias
|
|
5
5
|
|
|
6
|
+
from docker._types import WaitContainerResponse
|
|
6
7
|
from docker.types.daemon import CancellableStream
|
|
7
8
|
|
|
8
9
|
from ..types import ContainerConfig, EndpointConfig, HostConfig, NetworkingConfig
|
|
@@ -15,21 +16,6 @@ class _HasId(TypedDict):
|
|
|
15
16
|
class _HasID(TypedDict):
|
|
16
17
|
ID: str
|
|
17
18
|
|
|
18
|
-
@type_check_only
|
|
19
|
-
class _WaitErrorDetails(TypedDict):
|
|
20
|
-
Message: str
|
|
21
|
-
|
|
22
|
-
@type_check_only
|
|
23
|
-
class _WaitContainerExistsResponse(TypedDict):
|
|
24
|
-
StatusCode: int
|
|
25
|
-
Error: NotRequired[_WaitErrorDetails]
|
|
26
|
-
|
|
27
|
-
@type_check_only
|
|
28
|
-
class _WaitNoSuchContainerErrorResponse(TypedDict):
|
|
29
|
-
message: str
|
|
30
|
-
|
|
31
|
-
_WaitContainerResponseType: TypeAlias = _WaitContainerExistsResponse | _WaitNoSuchContainerErrorResponse
|
|
32
|
-
|
|
33
19
|
_Container: TypeAlias = _HasId | _HasID | str
|
|
34
20
|
|
|
35
21
|
class ContainerApiMixin:
|
|
@@ -119,7 +105,7 @@ class ContainerApiMixin:
|
|
|
119
105
|
since: datetime.datetime | float | None = None,
|
|
120
106
|
follow: bool | None = None,
|
|
121
107
|
until: datetime.datetime | float | None = None,
|
|
122
|
-
) -> CancellableStream: ...
|
|
108
|
+
) -> CancellableStream[bytes]: ...
|
|
123
109
|
@overload
|
|
124
110
|
def logs(
|
|
125
111
|
self,
|
|
@@ -132,7 +118,7 @@ class ContainerApiMixin:
|
|
|
132
118
|
since: datetime.datetime | float | None = None,
|
|
133
119
|
follow: bool | None = None,
|
|
134
120
|
until: datetime.datetime | float | None = None,
|
|
135
|
-
) -> CancellableStream: ...
|
|
121
|
+
) -> CancellableStream[bytes]: ...
|
|
136
122
|
@overload
|
|
137
123
|
def logs(
|
|
138
124
|
self,
|
|
@@ -179,4 +165,4 @@ class ContainerApiMixin:
|
|
|
179
165
|
container: _Container,
|
|
180
166
|
timeout: int | None = None,
|
|
181
167
|
condition: Literal["not-running", "next-exit", "removed"] | None = None,
|
|
182
|
-
) ->
|
|
168
|
+
) -> WaitContainerResponse: ...
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
from _typeshed import Incomplete
|
|
1
2
|
from datetime import datetime
|
|
2
3
|
from typing import Any
|
|
3
4
|
|
|
@@ -11,7 +12,7 @@ class DaemonApiMixin:
|
|
|
11
12
|
until: datetime | int | None = None,
|
|
12
13
|
filters: dict[str, Any] | None = None,
|
|
13
14
|
decode: bool | None = None,
|
|
14
|
-
) -> CancellableStream: ...
|
|
15
|
+
) -> CancellableStream[Incomplete]: ...
|
|
15
16
|
def info(self) -> dict[str, Any]: ...
|
|
16
17
|
def login(
|
|
17
18
|
self,
|