Skip to content

Commit 69b83ee

Browse files
committed
[pycurl] Update stubs to 7.46.0
1 parent 483fd73 commit 69b83ee

2 files changed

Lines changed: 174 additions & 21 deletions

File tree

stubs/pycurl/METADATA.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
version = "7.45.7"
1+
version = "7.46.0"
22
upstream-repository = "https://github.com/pycurl/pycurl"
33

44
[tool.stubtest]

stubs/pycurl/pycurl.pyi

Lines changed: 173 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,54 @@
11
import sys
2-
from _typeshed import Incomplete
3-
from typing import Any, Final, final
4-
from typing_extensions import Self
2+
from _typeshed import Incomplete, ReadableBuffer, WriteableBuffer
3+
from collections.abc import Callable
4+
from datetime import datetime
5+
from types import TracebackType
6+
from typing import Any, Final, NamedTuple
7+
from typing_extensions import Self, disjoint_base
58

69
version: str
710

811
def global_init(option: int) -> None: ...
912
def global_cleanup() -> None: ...
10-
def version_info() -> (
11-
tuple[int, str, int, str, int, str, int, str, tuple[str, ...], Incomplete | None, int, Incomplete | None]
12-
): ...
13+
def version_info(
14+
stamp: int = ...,
15+
) -> tuple[int, str, int, str, int, str, int, str, tuple[str, ...], Incomplete | None, int, Incomplete | None]: ...
1316

14-
class error(Exception): ...
17+
class error(Exception):
18+
# libcurl protocol errors raise (code, message); arg-parse errors raise (message,).
19+
args: tuple[int, str] | tuple[str]
1520

16-
@final
21+
class WsFrame(NamedTuple):
22+
age: int
23+
flags: int
24+
offset: int
25+
bytesleft: int
26+
len: int
27+
28+
class HstsEntry(NamedTuple):
29+
host: bytes
30+
expire: datetime | None
31+
include_subdomains: bool
32+
33+
class HstsIndex(NamedTuple):
34+
index: int # type: ignore[assignment]
35+
total: int
36+
37+
class KhKey(NamedTuple):
38+
key: bytes
39+
keytype: int
40+
41+
class CurlSockAddr(NamedTuple):
42+
family: int
43+
socktype: int
44+
protocol: int
45+
addr: tuple[str, int] | tuple[str, int, int, int] | bytes
46+
47+
@disjoint_base
1748
class Curl:
1849
USERPWD: int
1950
def close(self) -> None: ...
51+
def closed(self) -> bool: ...
2052
def setopt(self, option: int, value) -> None: ...
2153
def setopt_string(self, option: int, value: str) -> None: ...
2254
def perform(self) -> None: ...
@@ -27,17 +59,35 @@ class Curl:
2759
def getinfo(self, info: int) -> Any: ...
2860
def getinfo_raw(self, info: int) -> Any: ...
2961
def reset(self) -> None: ...
30-
def unsetopt(self, option: int): ...
31-
def pause(self, bitmask): ...
62+
def unsetopt(self, option: int) -> None: ...
63+
def pause(self, bitmask: int = ...) -> None: ...
64+
def unpause(self) -> None: ...
3265
def errstr(self) -> str: ...
3366
def duphandle(self) -> Self: ...
3467
def errstr_raw(self) -> bytes: ...
68+
def multi(self) -> CurlMulti | None: ...
69+
def share(self) -> CurlShare | None: ...
70+
def recv(self, buffersize: int, /) -> bytes: ...
71+
def recv_into(self, buffer: WriteableBuffer, nbytes: int = 0) -> int: ...
72+
def send(self, data: ReadableBuffer, /) -> int: ...
73+
def ws_send(
74+
self, data: ReadableBuffer | str, flags: int | None = None, fragsize: int = 0, encoding: str = "utf-8"
75+
) -> int: ...
76+
def ws_recv(self, buffersize: int, /) -> tuple[bytes, WsFrame]: ...
77+
def ws_recv_into(self, buffer: WriteableBuffer, nbytes: int = 0) -> tuple[int, WsFrame]: ...
78+
def ws_meta(self) -> WsFrame | None: ...
79+
def ws_close(self, code: int | None = None, reason: ReadableBuffer | str | None = None, encoding: str = "utf-8") -> int: ...
80+
def __enter__(self) -> Self: ...
81+
def __exit__(
82+
self, exc_type: type[BaseException] | None, exc_value: BaseException | None, traceback: TracebackType | None, /
83+
) -> None: ...
3584
if sys.platform == "linux" or sys.platform == "darwin":
36-
def set_ca_certs(self, value: bytes | str, /) -> None: ...
85+
def set_ca_certs(self, value: str | bytes, /) -> None: ...
3786

38-
@final
87+
@disjoint_base
3988
class CurlMulti:
4089
def close(self) -> None: ...
90+
def closed(self) -> bool: ...
4191
def add_handle(self, obj: Curl) -> None: ...
4292
def remove_handle(self, obj: Curl) -> None: ...
4393
def setopt(self, option: int, value) -> None: ...
@@ -46,14 +96,83 @@ class CurlMulti:
4696
def select(self, timeout: float) -> int: ...
4797
def info_read(self, max_objects: int = ...) -> tuple[int, list[Incomplete], list[Incomplete]]: ...
4898
def socket_action(self, sockfd: int, ev_bitmask: int) -> tuple[int, int]: ...
49-
def assign(self, sockfd: int, socket, /): ...
99+
def assign(self, sockfd: int, obj, /) -> None: ...
100+
def unassign(self, sock_fd: int, /) -> None: ...
50101
def socket_all(self) -> tuple[int, int]: ...
51102
def timeout(self) -> int: ...
103+
def __contains__(self, key: Curl, /) -> bool: ...
104+
def __enter__(self) -> Self: ...
105+
def __exit__(
106+
self, exc_type: type[BaseException] | None, exc_value: BaseException | None, traceback: TracebackType | None, /
107+
) -> None: ...
52108

53-
@final
109+
@disjoint_base
54110
class CurlShare:
55111
def close(self) -> None: ...
56-
def setopt(self, option: int, value): ...
112+
def closed(self) -> bool: ...
113+
def setopt(self, option: int, value) -> None: ...
114+
def __enter__(self) -> Self: ...
115+
def __exit__(
116+
self, exc_type: type[BaseException] | None, exc_value: BaseException | None, traceback: TracebackType | None, /
117+
) -> None: ...
118+
119+
@disjoint_base
120+
class CurlMime:
121+
def __new__(cls, curl: Curl) -> Self: ...
122+
def add(
123+
self,
124+
name: str | bytes | None = None,
125+
data: ReadableBuffer | str | None = None,
126+
file: str | bytes | None = None,
127+
filename: str | bytes | None = None,
128+
content_type: str | bytes | None = None,
129+
headers: list[str | bytes] | tuple[str | bytes, ...] | None = None,
130+
encoder: str | bytes | None = None,
131+
) -> CurlMimePart: ...
132+
def add_field(
133+
self,
134+
name: str | bytes,
135+
value: str | bytes,
136+
content_type: str | bytes | None = None,
137+
encoder: str | bytes | None = None,
138+
headers: list[str | bytes] | tuple[str | bytes, ...] | None = None,
139+
) -> CurlMimePart: ...
140+
def add_file(
141+
self,
142+
name: str | bytes,
143+
path: str | bytes,
144+
filename: str | bytes | None = None,
145+
content_type: str | bytes | None = None,
146+
headers: list[str | bytes] | tuple[str | bytes, ...] | None = None,
147+
encoder: str | bytes | None = None,
148+
) -> CurlMimePart: ...
149+
def add_multipart(self, name: str | bytes | None = None, subtype: str | bytes | None = None) -> CurlMime: ...
150+
def addpart(self) -> CurlMimePart: ...
151+
def close(self) -> None: ...
152+
def closed(self) -> bool: ...
153+
def __enter__(self) -> Self: ...
154+
def __exit__(
155+
self, exc_type: type[BaseException] | None, exc_value: BaseException | None, traceback: TracebackType | None, /
156+
) -> None: ...
157+
158+
@disjoint_base
159+
class CurlMimePart:
160+
def name(self, name: str | bytes, /) -> None: ...
161+
def data(self, data: ReadableBuffer | str, /) -> None: ...
162+
def data_cb(
163+
self,
164+
datasize: int | None,
165+
read: Callable[[Any, int], ReadableBuffer | str | int],
166+
seek: Callable[[Any, int, int], int | None] | None = None,
167+
free: Callable[[Any], object] | None = None,
168+
userdata: Any = None,
169+
) -> None: ...
170+
def filedata(self, path: str | bytes, /) -> None: ...
171+
def filename(self, name: str | bytes, /) -> None: ...
172+
def type(self, content_type: str | bytes, /) -> None: ...
173+
def encoder(self, name: str | bytes, /) -> None: ...
174+
def headers(self, headers: list[str | bytes] | tuple[str | bytes, ...] | None, /) -> None: ...
175+
def subparts(self, mime: CurlMime, /) -> None: ...
57176

58177
APPCONNECT_TIME_T: Final[int] = ...
59178
CONNECT_TIME_T: Final[int] = ...
@@ -75,6 +194,7 @@ TOTAL_TIME_T: Final[int] = ...
75194

76195
ACCEPTTIMEOUT_MS: Final = 212
77196
ACCEPT_ENCODING: Final = 10102
197+
ACTIVESOCKET: Final[int]
78198
ADDRESS_SCOPE: Final = 171
79199
APPCONNECT_TIME: Final = 3145761
80200
APPEND: Final = 50
@@ -108,6 +228,11 @@ CRLFILE: Final = 10169
108228
CSELECT_ERR: Final = 4
109229
CSELECT_IN: Final = 1
110230
CSELECT_OUT: Final = 2
231+
CURLHSTS_ENABLE: Final[int]
232+
CURLHSTS_READONLYFILE: Final[int]
233+
CURLSTS_DONE: Final[int]
234+
CURLSTS_FAIL: Final[int]
235+
CURLSTS_OK: Final[int]
111236
CURL_HTTP_VERSION_1_0: Final = 1
112237
CURL_HTTP_VERSION_1_1: Final = 2
113238
CURL_HTTP_VERSION_2: Final = 3
@@ -264,6 +389,11 @@ E_USE_SSL_FAILED: Final = 64
264389
E_WRITE_ERROR: Final = 23
265390
FAILONERROR: Final = 45
266391
FILE: Final = 10001
392+
FNMATCHFUNC_FAIL: Final[int]
393+
FNMATCHFUNC_MATCH: Final[int]
394+
FNMATCHFUNC_NOMATCH: Final[int]
395+
FNMATCH_DATA: Final[int]
396+
FNMATCH_FUNCTION: Final[int]
267397
FOLLOWLOCATION: Final = 52
268398
FORBID_REUSE: Final = 75
269399
FORM_BUFFER: Final = 11
@@ -319,11 +449,17 @@ HEADEROPT: Final = 229
319449
HEADER_SEPARATE: Final = 1
320450
HEADER_SIZE: Final = 2097163
321451
HEADER_UNIFIED: Final = 0
452+
HSTS: Final[int]
453+
HSTSREADDATA: Final[int]
454+
HSTSREADFUNCTION: Final[int]
455+
HSTSWRITEDATA: Final[int]
456+
HSTSWRITEFUNCTION: Final[int]
457+
HSTS_CTRL: Final[int]
322458
HTTP09_ALLOWED: Final = 285
323459
HTTP200ALIASES: Final = 10104
324460
HTTPAUTH: Final = 107
325-
HTTPAUTH_ANY: Final = -17
326-
HTTPAUTH_ANYSAFE: Final = -18
461+
HTTPAUTH_ANY: Final[int]
462+
HTTPAUTH_ANYSAFE: Final[int]
327463
HTTPAUTH_AVAIL: Final = 2097175
328464
HTTPAUTH_BASIC: Final = 1
329465
HTTPAUTH_DIGEST: Final = 2
@@ -416,6 +552,7 @@ PREREQFUNC_ABORT: Final = 1
416552
MAXREDIRS: Final = 68
417553
MAX_RECV_SPEED_LARGE: Final = 30146
418554
MAX_SEND_SPEED_LARGE: Final = 30145
555+
MIMEPOST: Final[int]
419556
M_CHUNK_LENGTH_PENALTY_SIZE: Final = 30010
420557
M_CONTENT_LENGTH_PENALTY_SIZE: Final = 30009
421558
M_MAXCONNECTS: Final = 6
@@ -483,7 +620,7 @@ PRIMARY_IP: Final = 1048608
483620
PRIMARY_PORT: Final = 2097192
484621
PROGRESSFUNCTION: Final = 20056
485622
PROTOCOLS: Final = 181
486-
PROTO_ALL: Final = -1
623+
PROTO_ALL: Final[int]
487624
PROTO_DICT: Final = 512
488625
PROTO_FILE: Final = 1024
489626
PROTO_FTP: Final = 4
@@ -572,6 +709,8 @@ REFERER: Final = 10016
572709
REQUEST_SIZE: Final = 2097164
573710
REQUEST_TARGET: Final = 10266
574711
RESOLVE: Final = 10203
712+
RESOLVER_START_DATA: Final[int]
713+
RESOLVER_START_FUNCTION: Final[int]
575714
RESPONSE_CODE: Final = 2097154
576715
RESUME_FROM: Final = 30116
577716
RESUME_FROM_LARGE: Final = 30116
@@ -612,8 +751,8 @@ SOCKTYPE_IPCXN: Final = 0
612751
SPEED_DOWNLOAD: Final = 3145737
613752
SPEED_UPLOAD: Final = 3145738
614753
SSH_AUTH_AGENT: Final = 16
615-
SSH_AUTH_ANY: Final = -1
616-
SSH_AUTH_DEFAULT: Final = -1
754+
SSH_AUTH_ANY: Final[int]
755+
SSH_AUTH_DEFAULT: Final[int]
617756
SSH_AUTH_HOST: Final = 4
618757
SSH_AUTH_KEYBOARD: Final = 8
619758
SSH_AUTH_NONE: Final = 0
@@ -684,6 +823,10 @@ TLSAUTH_PASSWORD: Final = 10205
684823
TLSAUTH_TYPE: Final = 10206
685824
TLSAUTH_USERNAME: Final = 10204
686825
TOTAL_TIME: Final = 3145731
826+
TRAILERDATA: Final[int]
827+
TRAILERFUNCTION: Final[int]
828+
TRAILERFUNC_ABORT: Final[int]
829+
TRAILERFUNC_OK: Final[int]
687830
TRANSFERTEXT: Final = 53
688831
TRANSFER_ENCODING: Final = 207
689832
UNIX_SOCKET_PATH: Final = 10231
@@ -735,5 +878,15 @@ WRITEDATA: Final = 10001
735878
WRITEFUNCTION: Final = 20011
736879
WRITEFUNC_PAUSE: Final = 268435457
737880
WRITEHEADER: Final = 10029
881+
WS_BINARY: Final[int]
882+
WS_CLOSE: Final[int]
883+
WS_CONT: Final[int]
884+
WS_NOAUTOPONG: Final[int]
885+
WS_OFFSET: Final[int]
886+
WS_OPTIONS: Final[int]
887+
WS_PING: Final[int]
888+
WS_PONG: Final[int]
889+
WS_RAW_MODE: Final[int]
890+
WS_TEXT: Final[int]
738891
XFERINFOFUNCTION: Final = 20219
739892
XOAUTH2_BEARER: Final = 10220

0 commit comments

Comments
 (0)