types-uWSGI 2.0.0.0__tar.gz

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.
@@ -0,0 +1,12 @@
1
+ ## 2.0.0.0 (2023-07-24)
2
+
3
+ Adds stubs for uWSGI (#10432)
4
+
5
+ This adds stubs for the uWSGI Python API.
6
+
7
+ Similarly to GDB the Python API is only accessible within a uWSGI process, some parts of the API also only exist if certain configuration options are enabled. This makes running stubtest a bit of pain.
8
+
9
+ Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
10
+ Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
11
+ Co-authored-by: Akuli <akuviljanen17@gmail.com>
12
+
@@ -0,0 +1 @@
1
+ include CHANGELOG.md
@@ -0,0 +1,33 @@
1
+ Metadata-Version: 2.1
2
+ Name: types-uWSGI
3
+ Version: 2.0.0.0
4
+ Summary: Typing stubs for uWSGI
5
+ Home-page: https://github.com/python/typeshed
6
+ License: Apache-2.0 license
7
+ Project-URL: GitHub, https://github.com/python/typeshed
8
+ Project-URL: Changes, https://github.com/typeshed-internal/stub_uploader/blob/main/data/changelogs/uWSGI.md
9
+ Project-URL: Issue tracker, https://github.com/python/typeshed/issues
10
+ Project-URL: Chat, https://gitter.im/python/typing
11
+ Classifier: License :: OSI Approved :: Apache Software License
12
+ Classifier: Programming Language :: Python :: 3
13
+ Classifier: Typing :: Stubs Only
14
+ Description-Content-Type: text/markdown
15
+
16
+ ## Typing stubs for uWSGI
17
+
18
+ This is a PEP 561 type stub package for the `uWSGI` package. It
19
+ can be used by type-checking tools like
20
+ [mypy](https://github.com/python/mypy/),
21
+ [pyright](https://github.com/microsoft/pyright),
22
+ [pytype](https://github.com/google/pytype/),
23
+ PyCharm, etc. to check code that uses
24
+ `uWSGI`. The source for this package can be found at
25
+ https://github.com/python/typeshed/tree/main/stubs/uWSGI. All fixes for
26
+ types and metadata should be contributed there.
27
+
28
+ Type hints for uWSGI's [Python API](https://uwsgi-docs.readthedocs.io/en/latest/PythonModule.html). Note that this API is available only when running Python code inside a uWSGI process and some parts of the API are only present when corresponding configuration options have been enabled.
29
+
30
+ See https://github.com/python/typeshed/blob/main/README.md for more details.
31
+ This package was generated from typeshed commit `21cb2cb546e1bd120091d6fe7087c847e0297d39` and was tested
32
+ with mypy 1.4.1, pyright 1.1.318, and
33
+ pytype 2023.7.21.
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+
@@ -0,0 +1,47 @@
1
+ from setuptools import setup
2
+
3
+ name = "types-uWSGI"
4
+ description = "Typing stubs for uWSGI"
5
+ long_description = '''
6
+ ## Typing stubs for uWSGI
7
+
8
+ This is a PEP 561 type stub package for the `uWSGI` package. It
9
+ can be used by type-checking tools like
10
+ [mypy](https://github.com/python/mypy/),
11
+ [pyright](https://github.com/microsoft/pyright),
12
+ [pytype](https://github.com/google/pytype/),
13
+ PyCharm, etc. to check code that uses
14
+ `uWSGI`. The source for this package can be found at
15
+ https://github.com/python/typeshed/tree/main/stubs/uWSGI. All fixes for
16
+ types and metadata should be contributed there.
17
+
18
+ Type hints for uWSGI's [Python API](https://uwsgi-docs.readthedocs.io/en/latest/PythonModule.html). Note that this API is available only when running Python code inside a uWSGI process and some parts of the API are only present when corresponding configuration options have been enabled.
19
+
20
+ See https://github.com/python/typeshed/blob/main/README.md for more details.
21
+ This package was generated from typeshed commit `21cb2cb546e1bd120091d6fe7087c847e0297d39` and was tested
22
+ with mypy 1.4.1, pyright 1.1.318, and
23
+ pytype 2023.7.21.
24
+ '''.lstrip()
25
+
26
+ setup(name=name,
27
+ version="2.0.0.0",
28
+ description=description,
29
+ long_description=long_description,
30
+ long_description_content_type="text/markdown",
31
+ url="https://github.com/python/typeshed",
32
+ project_urls={
33
+ "GitHub": "https://github.com/python/typeshed",
34
+ "Changes": "https://github.com/typeshed-internal/stub_uploader/blob/main/data/changelogs/uWSGI.md",
35
+ "Issue tracker": "https://github.com/python/typeshed/issues",
36
+ "Chat": "https://gitter.im/python/typing",
37
+ },
38
+ install_requires=[],
39
+ packages=['uwsgi-stubs', 'uwsgidecorators-stubs'],
40
+ package_data={'uwsgi-stubs': ['__init__.pyi', 'METADATA.toml'], 'uwsgidecorators-stubs': ['__init__.pyi', 'METADATA.toml']},
41
+ license="Apache-2.0 license",
42
+ classifiers=[
43
+ "License :: OSI Approved :: Apache Software License",
44
+ "Programming Language :: Python :: 3",
45
+ "Typing :: Stubs Only",
46
+ ]
47
+ )
@@ -0,0 +1,33 @@
1
+ Metadata-Version: 2.1
2
+ Name: types-uWSGI
3
+ Version: 2.0.0.0
4
+ Summary: Typing stubs for uWSGI
5
+ Home-page: https://github.com/python/typeshed
6
+ License: Apache-2.0 license
7
+ Project-URL: GitHub, https://github.com/python/typeshed
8
+ Project-URL: Changes, https://github.com/typeshed-internal/stub_uploader/blob/main/data/changelogs/uWSGI.md
9
+ Project-URL: Issue tracker, https://github.com/python/typeshed/issues
10
+ Project-URL: Chat, https://gitter.im/python/typing
11
+ Classifier: License :: OSI Approved :: Apache Software License
12
+ Classifier: Programming Language :: Python :: 3
13
+ Classifier: Typing :: Stubs Only
14
+ Description-Content-Type: text/markdown
15
+
16
+ ## Typing stubs for uWSGI
17
+
18
+ This is a PEP 561 type stub package for the `uWSGI` package. It
19
+ can be used by type-checking tools like
20
+ [mypy](https://github.com/python/mypy/),
21
+ [pyright](https://github.com/microsoft/pyright),
22
+ [pytype](https://github.com/google/pytype/),
23
+ PyCharm, etc. to check code that uses
24
+ `uWSGI`. The source for this package can be found at
25
+ https://github.com/python/typeshed/tree/main/stubs/uWSGI. All fixes for
26
+ types and metadata should be contributed there.
27
+
28
+ Type hints for uWSGI's [Python API](https://uwsgi-docs.readthedocs.io/en/latest/PythonModule.html). Note that this API is available only when running Python code inside a uWSGI process and some parts of the API are only present when corresponding configuration options have been enabled.
29
+
30
+ See https://github.com/python/typeshed/blob/main/README.md for more details.
31
+ This package was generated from typeshed commit `21cb2cb546e1bd120091d6fe7087c847e0297d39` and was tested
32
+ with mypy 1.4.1, pyright 1.1.318, and
33
+ pytype 2023.7.21.
@@ -0,0 +1,11 @@
1
+ CHANGELOG.md
2
+ MANIFEST.in
3
+ setup.py
4
+ types_uWSGI.egg-info/PKG-INFO
5
+ types_uWSGI.egg-info/SOURCES.txt
6
+ types_uWSGI.egg-info/dependency_links.txt
7
+ types_uWSGI.egg-info/top_level.txt
8
+ uwsgi-stubs/METADATA.toml
9
+ uwsgi-stubs/__init__.pyi
10
+ uwsgidecorators-stubs/METADATA.toml
11
+ uwsgidecorators-stubs/__init__.pyi
@@ -0,0 +1,2 @@
1
+ uwsgi-stubs
2
+ uwsgidecorators-stubs
@@ -0,0 +1,15 @@
1
+ version = "2.0.*"
2
+ upstream_repository = "https://github.com/unbit/uwsgi"
3
+ extra_description = """\
4
+ Type hints for uWSGI's \
5
+ [Python API](https://uwsgi-docs.readthedocs.io/en/latest/PythonModule.html). \
6
+ Note that this API is available only when running Python code inside a uWSGI process \
7
+ and some parts of the API are only present when corresponding configuration options \
8
+ have been enabled.
9
+ """
10
+
11
+ [tool.stubtest]
12
+ # Run stubtest on MacOS as well, to check that the
13
+ # uWSGI-specific parts of stubtest_third_party.py
14
+ # also work there
15
+ platforms = ["linux", "darwin"]
@@ -0,0 +1,240 @@
1
+ from _typeshed import HasFileno, OptExcInfo, ReadOnlyBuffer
2
+ from _typeshed.wsgi import WSGIApplication
3
+ from collections.abc import Callable
4
+ from types import ModuleType
5
+ from typing import Any, Protocol, overload
6
+ from typing_extensions import Literal, Self, TypeAlias, final
7
+
8
+ import uwsgidecorators
9
+
10
+ _TrueOrNone: TypeAlias = Literal[True] | None
11
+
12
+ class _RPCCallable(Protocol):
13
+ def __call__(self, *args: bytes) -> bytes | None: ...
14
+
15
+ # FIXME: Technically we know the exact layout of _AppsDict and _WorkerDict
16
+ # but TypedDict does not support bytes keys, so for now we use type
17
+ # aliases to a more generic dict
18
+ _WorkerDict: TypeAlias = dict[bytes, Any]
19
+
20
+ SPOOL_IGNORE: Literal[0]
21
+ SPOOL_OK: Literal[-2]
22
+ SPOOL_RETRY: Literal[-1]
23
+ applications: dict[str, WSGIApplication | str] | None
24
+ buffer_size: int
25
+ cores: int
26
+ has_threads: int
27
+ hostname: bytes
28
+ is_a_reload: bool
29
+ loop: bytes | None
30
+ magic_table: dict[bytes, bytes]
31
+ numproc: int
32
+ opt: dict[str, bytes | Literal[True] | list[bytes | Literal[True]]]
33
+ sockets: list[int]
34
+ started_on: int
35
+ unbit: _TrueOrNone
36
+ version: bytes
37
+ version_info: tuple[int, int, int, int, bytes]
38
+ spoolers: tuple[bytes, ...]
39
+ queue_size: int
40
+
41
+ decorators = uwsgidecorators
42
+ spooler = uwsgidecorators.manage_spool_request
43
+ post_fork_hook = uwsgidecorators.postfork_chain_hook
44
+
45
+ @final
46
+ class SymbolsImporter:
47
+ def find_module(self, __fullname: str) -> Self | None: ...
48
+ def load_module(self, __fullname: str) -> ModuleType | None: ...
49
+
50
+ @final
51
+ class SymbolsZipImporter:
52
+ def __init__(self, __name: str) -> None: ...
53
+ def find_module(self, __fullname: str) -> Self | None: ...
54
+ def load_module(self, __fullname: str) -> ModuleType | None: ...
55
+
56
+ @final
57
+ class ZipImporter:
58
+ def __init__(self, __name: str) -> None: ...
59
+ def find_module(self, __fullname: str) -> Self | None: ...
60
+ def load_module(self, __fullname: str) -> ModuleType | None: ...
61
+
62
+ def accepting(__accepting: bool = True) -> None: ...
63
+ def add_cron(__signum: int, __minute: int, __hour: int, __day: int, __month: int, __weekday: int) -> Literal[True]: ...
64
+ def add_file_monitor(__signum: int, __filename: str) -> None: ...
65
+ def add_rb_timer(__signum: int, __seconds: int, __iterations: int = 0) -> None: ...
66
+ def add_timer(__signum: int, __seconds: int) -> None: ...
67
+ def add_var(__key: bytes | str, __val: bytes | str) -> Literal[True]: ...
68
+ def alarm(__alarm: str, __msg: bytes | ReadOnlyBuffer | str) -> None: ...
69
+ def async_connect(__socket_name: str) -> int: ...
70
+ def async_sleep(__timeout: float) -> Literal[b""]: ...
71
+ def cache_clear(__cache_name: str = ...) -> _TrueOrNone: ...
72
+ def cache_dec(__key: str | bytes, __decrement: int = 1, __expires: int = 0, __cache_name: str = ...) -> _TrueOrNone: ...
73
+ def cache_del(__key: str | bytes, __cache_name: str = ...) -> _TrueOrNone: ...
74
+ def cache_div(__key: str | bytes, __divisor: int = 2, __expires: int = 0, __cache_name: str = ...) -> _TrueOrNone: ...
75
+ def cache_exists(__key: str | bytes, __cache_name: str = ...) -> _TrueOrNone: ...
76
+ def cache_get(__key: str | bytes, __cache_name: str = ...) -> bytes | None: ...
77
+ def cache_inc(__key: str | bytes, __increment: int = 1, __expires: int = 0, __cache_name: str = ...) -> _TrueOrNone: ...
78
+ def cache_keys(__cache_name: str = ...) -> list[bytes]: ...
79
+ def cache_mul(__key: str | bytes, __factor: int = 2, __expires: int = 0, __cache_name: str = ...) -> _TrueOrNone: ...
80
+ def cache_num(__key: str | bytes, __cache_name: str = ...) -> int: ...
81
+ def cache_set(
82
+ __key: str | bytes, __value: str | bytes | ReadOnlyBuffer, __expires: int = 0, __cache_name: str = ...
83
+ ) -> _TrueOrNone: ...
84
+ def cache_update(
85
+ __key: str | bytes, __value: str | bytes | ReadOnlyBuffer, __expires: int = 0, __cache_name: str = ...
86
+ ) -> _TrueOrNone: ...
87
+ def queue_get(__index: int) -> bytes | None: ...
88
+ def queue_set(__index: int, __message: str | bytes | ReadOnlyBuffer) -> _TrueOrNone: ...
89
+ @overload
90
+ def queue_last(__num: Literal[0] = 0) -> bytes | None: ... # type:ignore[misc]
91
+ @overload
92
+ def queue_last(__num: int) -> list[bytes | None]: ...
93
+ def queue_push(__message: str | bytes | ReadOnlyBuffer) -> _TrueOrNone: ...
94
+ def queue_pull() -> bytes | None: ...
95
+ def queue_pop() -> bytes | None: ...
96
+ def queue_slot() -> int: ...
97
+ def queue_pull_slot() -> int: ...
98
+ def snmp_set_community(__snmp_community: str) -> Literal[True]: ...
99
+ def snmp_set_counter32(__oid_num: int, __value: int) -> _TrueOrNone: ...
100
+ def snmp_set_counter64(__oid_num: int, __value: int) -> _TrueOrNone: ...
101
+ def snmp_set_gauge(__oid_num: int, __value: int) -> _TrueOrNone: ...
102
+ def snmp_incr_counter32(__oid_num: int, __increment: int) -> _TrueOrNone: ...
103
+ def snmp_incr_counter64(__oid_num: int, __increment: int) -> _TrueOrNone: ...
104
+ def snmp_incr_gauge(__oid_num: int, __increment: int) -> _TrueOrNone: ...
105
+ def snmp_decr_counter32(__oid_num: int, __decrement: int) -> _TrueOrNone: ...
106
+ def snmp_decr_counter64(__oid_num: int, __decrement: int) -> _TrueOrNone: ...
107
+ def snmp_decr_gauge(__oid_num: int, __decrement: int) -> _TrueOrNone: ...
108
+ @overload
109
+ def send_to_spooler(__mesage_dict: dict[bytes, bytes]) -> bytes | None: ...
110
+ @overload
111
+ def send_to_spooler(
112
+ *, spooler: bytes = ..., priority: bytes = ..., at: bytes = ..., body: bytes = ..., **kwargs: bytes
113
+ ) -> bytes | None: ...
114
+
115
+ spool = send_to_spooler
116
+
117
+ def set_spooler_frequency(__frequency: int) -> Literal[True]: ...
118
+ def spooler_jobs() -> list[bytes]: ...
119
+ def spooler_pid() -> int: ...
120
+ def spooler_pids() -> list[int]: ...
121
+ def spooler_get_task(__task_path: str) -> dict[bytes, bytes] | None: ...
122
+ def call(__rpc_name: str, *args: bytes) -> bytes | None: ...
123
+ def chunked_read(__timeout: int = 0) -> bytes: ...
124
+ def chunked_read_nb() -> bytes: ...
125
+ def cl() -> int: ...
126
+ def close(__fd: int) -> None: ...
127
+ def connect(__socket_name: str, timeout: int = 0) -> int: ...
128
+ def connection_fd() -> int: ...
129
+ def disconnect() -> None: ...
130
+ def embedded_data(__name: str) -> bytes: ...
131
+ def extract(__name: str) -> bytes | None: ...
132
+ def farm_get_msg() -> bytes | None: ...
133
+ def farm_msg(__farm_name: str, __message: str | bytes | ReadOnlyBuffer) -> None: ...
134
+ def get_logvar(__key: str | bytes) -> bytes | None: ...
135
+ def green_schedule() -> Literal[True]: ...
136
+ def i_am_the_lord(__legion_name: str) -> bool: ...
137
+ def i_am_the_spooler() -> _TrueOrNone: ...
138
+ def in_farm(__farm_name: str = ...) -> _TrueOrNone: ...
139
+ def is_connected(__fd: int) -> bool: ...
140
+ def is_locked(__lock_num: int = 0) -> bool: ...
141
+ def listen_queue(__id: int = 0) -> int: ...
142
+ def lock(__lock_num: int = 0) -> None: ...
143
+ def log(__logline: str) -> Literal[True]: ...
144
+ def log_this_request() -> None: ...
145
+ def logsize() -> int: ...
146
+ def lord_scroll(__legion_name: str) -> bytes | None: ...
147
+ def masterpid() -> int: ...
148
+ def mem() -> tuple[int, int]: ...
149
+ def metric_dec(__key: str, __decrement: int = 1) -> _TrueOrNone: ...
150
+ def metric_div(__key: str, __divisor: int = 1) -> _TrueOrNone: ...
151
+ def metric_get(__key: str) -> int: ...
152
+ def metric_inc(__key: str, __increment: int = 1) -> _TrueOrNone: ...
153
+ def metric_mul(__key: str, __factor: int = 1) -> _TrueOrNone: ...
154
+ def metric_set(__key: str, __value: int = 1) -> _TrueOrNone: ...
155
+ def metric_set_max(__key: str, __value: int = 1) -> _TrueOrNone: ...
156
+ def metric_set_min(__key: str, __value: int = 1) -> _TrueOrNone: ...
157
+ def micros() -> int: ...
158
+ def mule_get_msg(signals: bool = True, farms: bool = True, buffer_size: int = 65536, timeout: int = -1) -> bytes: ...
159
+ def mule_id() -> int: ...
160
+ @overload
161
+ def mule_msg(__mesage: str | bytes | ReadOnlyBuffer) -> bool: ...
162
+ @overload
163
+ def mule_msg(__mesage: str | bytes | ReadOnlyBuffer, __mule_id: int) -> bool: ...
164
+ @overload
165
+ def mule_msg(__mesage: str | bytes | ReadOnlyBuffer, __farm_name: str) -> bool: ...
166
+ def offload(__filename: str, __len: int = 0) -> Literal[b""]: ...
167
+ def parsefile(__filename: str) -> dict[bytes, bytes] | None: ...
168
+ def ready() -> _TrueOrNone: ...
169
+ def ready_fd() -> int: ...
170
+ def recv(__fd: int, __max_size: int = 4096) -> bytes | None: ...
171
+ @overload
172
+ def register_rpc(__name: str, __func: Callable[[], bytes | None]) -> Literal[True]: ...
173
+ @overload
174
+ def register_rpc(__name: str, __func: Callable[[bytes], bytes | None], arg_count: Literal[1]) -> Literal[True]: ...
175
+ @overload
176
+ def register_rpc(__name: str, __func: Callable[[bytes, bytes], bytes | None], arg_count: Literal[2]) -> Literal[True]: ...
177
+ @overload
178
+ def register_rpc(__name: str, __func: _RPCCallable, arg_count: int) -> Literal[True]: ...
179
+ def register_signal(__signum: int, __who: str, __handler: Callable[[int], Any]) -> None: ...
180
+ def reload() -> _TrueOrNone: ...
181
+ def request_id() -> int: ...
182
+ def route(__router_name: str, __router_args: str) -> int: ...
183
+ def rpc(__node: str | bytes, __rpc_name: bytes, *rpc_args: bytes) -> bytes | None: ...
184
+ def rpc_list() -> tuple[bytes, ...]: ...
185
+ def scrolls(__legion_name: str) -> list[bytes] | None: ...
186
+ @overload
187
+ def send(__data: bytes) -> _TrueOrNone: ...
188
+ @overload
189
+ def send(__fd: int, __data: bytes) -> _TrueOrNone: ...
190
+ def sendfile(
191
+ __filename_or_fd: str | bytes | int | HasFileno, __chunk: int = 0, __pos: int = 0, filesize: int = 0
192
+ ) -> _TrueOrNone: ...
193
+ def set_logvar(__key: str | bytes, __val: str | bytes) -> None: ...
194
+ def set_user_harakiri(__seconds: int) -> None: ...
195
+ def set_warning_message(__message: str) -> Literal[True]: ...
196
+ def setprocname(__name: str) -> None: ...
197
+ def signal(__signum: int = ..., __node: str = ...) -> None: ...
198
+ def signal_received() -> int: ...
199
+ def signal_registered(__signum: int) -> _TrueOrNone: ...
200
+ def signal_wait(__signum: int = ...) -> Literal[b""]: ...
201
+ def start_response(
202
+ __status: str, __headers: list[tuple[str, str]], __exc_info: OptExcInfo | None = ...
203
+ ) -> Callable[[bytes], None]: ...
204
+ def stop() -> _TrueOrNone: ...
205
+ def suspend() -> Literal[True]: ...
206
+ def total_requests() -> int: ...
207
+ def unlock(__lock_num: int = 0) -> None: ...
208
+ def wait_fd_read(__fd: int, __timeout: int = 0) -> Literal[b""]: ...
209
+ def wait_fd_write(__fd: int, __timeout: int = 0) -> Literal[b""]: ...
210
+ def websocket_handshake(__key: str | bytes = ..., __origin: str | bytes = ..., __proto: str | bytes = ...) -> None: ...
211
+ def websocket_recv() -> bytes: ...
212
+ def websocket_recv_nb() -> bytes: ...
213
+ def websocket_send(message: str | bytes | ReadOnlyBuffer) -> None: ...
214
+ def websocket_send_binary(message: str | bytes | ReadOnlyBuffer) -> None: ...
215
+ def worker_id() -> int: ...
216
+ def workers() -> tuple[_WorkerDict, ...] | None: ...
217
+ def sharedarea_read(__id: int, __position: int, __length: int) -> bytes: ...
218
+ def sharedarea_write(__id: int, __position: int, __value: str | bytes | ReadOnlyBuffer) -> None: ...
219
+ def sharedarea_readbyte(__id: int, __position: int) -> int: ...
220
+ def sharedarea_writebyte(__id: int, __position: int, __value: int) -> None: ...
221
+ def sharedarea_read8(__id: int, __position: int) -> int: ...
222
+ def sharedarea_write8(__id: int, __position: int, __value: int) -> None: ...
223
+ def sharedarea_readlong(__id: int, __position: int) -> int: ...
224
+ def sharedarea_writelong(__id: int, __position: int, __value: int) -> None: ...
225
+ def sharedarea_read64(__id: int, __position: int) -> int: ...
226
+ def sharedarea_write64(__id: int, __position: int, __value: int) -> None: ...
227
+ def sharedarea_read32(__id: int, __position: int) -> int: ...
228
+ def sharedarea_write32(__id: int, __position: int, __value: int) -> None: ...
229
+ def sharedarea_read16(__id: int, __position: int) -> int: ...
230
+ def sharedarea_write16(__id: int, __position: int, __value: int) -> None: ...
231
+ def sharedarea_inclong(__id: int, __position: int, __increment: int = 1) -> None: ...
232
+ def sharedarea_inc64(__id: int, __position: int, __increment: int = 1) -> None: ...
233
+ def sharedarea_inc32(__id: int, __position: int, __increment: int = 1) -> None: ...
234
+ def sharedarea_dec64(__id: int, __position: int, __decrement: int = 1) -> None: ...
235
+ def sharedarea_dec32(__id: int, __position: int, __decrement: int = 1) -> None: ...
236
+ def sharedarea_rlock(__id: int) -> None: ...
237
+ def sharedarea_wlock(__id: int) -> None: ...
238
+ def sharedarea_unlock(__id: int) -> None: ...
239
+ def sharedarea_object(__id: int) -> bytearray: ...
240
+ def sharedarea_memoryview(__id: int) -> memoryview: ...
@@ -0,0 +1,15 @@
1
+ version = "2.0.*"
2
+ upstream_repository = "https://github.com/unbit/uwsgi"
3
+ extra_description = """\
4
+ Type hints for uWSGI's \
5
+ [Python API](https://uwsgi-docs.readthedocs.io/en/latest/PythonModule.html). \
6
+ Note that this API is available only when running Python code inside a uWSGI process \
7
+ and some parts of the API are only present when corresponding configuration options \
8
+ have been enabled.
9
+ """
10
+
11
+ [tool.stubtest]
12
+ # Run stubtest on MacOS as well, to check that the
13
+ # uWSGI-specific parts of stubtest_third_party.py
14
+ # also work there
15
+ platforms = ["linux", "darwin"]
@@ -0,0 +1,180 @@
1
+ from collections.abc import Callable
2
+ from typing import Any, Generic, TypeVar, overload
3
+ from typing_extensions import Literal, ParamSpec
4
+
5
+ from uwsgi import _RPCCallable
6
+
7
+ _T = TypeVar("_T")
8
+ _T2 = TypeVar("_T2")
9
+ _SR = TypeVar("_SR", bound=Literal[0, -1, -2] | None)
10
+ _SignalCallbackT = TypeVar("_SignalCallbackT", bound=Callable[[int], Any])
11
+ _RPCCallableT = TypeVar("_RPCCallableT", bound=_RPCCallable)
12
+ _P = ParamSpec("_P")
13
+ _P2 = ParamSpec("_P2")
14
+
15
+ spooler_functions: dict[str, Callable[..., Literal[0, -1, -2] | None]]
16
+ mule_functions: dict[str, Callable[..., Any]]
17
+ postfork_chain: list[Callable[[], None]]
18
+
19
+ def get_free_signal() -> int: ...
20
+ def manage_spool_request(vars: dict[bytes, Any]) -> Literal[0, -1, -2]: ...
21
+ def postfork_chain_hook() -> None: ...
22
+
23
+ class postfork(Generic[_P, _T]):
24
+ wid: int
25
+ f: Callable[_P, _T] | None
26
+ @overload
27
+ def __init__(self: postfork[..., Any], f: int) -> None: ...
28
+ @overload
29
+ def __init__(self: postfork[_P, _T], f: Callable[_P, _T]) -> None: ...
30
+ @overload
31
+ def __call__(self, __f: Callable[_P2, _T2]) -> postfork[_P2, _T2]: ...
32
+ @overload
33
+ def __call__(self, *args: _P.args, **kwargs: _P.kwargs) -> _T: ...
34
+
35
+ class _spoolraw(Generic[_P, _SR]):
36
+ f: Callable[_P, _SR]
37
+ pass_arguments: bool
38
+ base_dict: dict[str, Any]
39
+ def __init__(self, f: Callable[_P, _SR], pass_arguments: bool) -> None: ...
40
+ def __call__(self, *args: _P.args, **kwargs: _P.kwargs) -> _SR: ...
41
+ def spool(self, *args: _P.args, **kwargs: _P.kwargs) -> _SR: ...
42
+
43
+ class _spool(_spoolraw[_P, _SR]): ...
44
+ class _spoolforever(_spoolraw[_P, _SR]): ...
45
+
46
+ @overload
47
+ def spool_decorate(
48
+ f: Callable[_P, _SR], pass_arguments: bool = False, _class: type[_spoolraw[_P, _SR]] = ...
49
+ ) -> _spoolraw[_P, _SR]: ...
50
+ @overload
51
+ def spool_decorate(
52
+ f: None = None, pass_arguments: bool = False, _class: type[_spoolraw[..., Any]] = ...
53
+ ) -> Callable[[Callable[_P, _SR]], _spoolraw[_P, _SR]]: ...
54
+ @overload
55
+ def spoolraw(f: Callable[_P, _SR], pass_arguments: bool = False) -> _spoolraw[_P, _SR]: ...
56
+ @overload
57
+ def spoolraw(f: None = None, pass_arguments: bool = False) -> Callable[[Callable[_P, _SR]], _spoolraw[_P, _SR]]: ...
58
+ @overload
59
+ def spool(f: Callable[_P, _SR], pass_arguments: bool = False) -> _spool[_P, _SR]: ...
60
+ @overload
61
+ def spool(f: None = None, pass_arguments: bool = False) -> Callable[[Callable[_P, _SR]], _spool[_P, _SR]]: ...
62
+ @overload
63
+ def spoolforever(f: Callable[_P, _SR], pass_arguments: bool = False) -> _spoolforever[_P, _SR]: ...
64
+ @overload
65
+ def spoolforever(f: None = None, pass_arguments: bool = False) -> Callable[[Callable[_P, _SR]], _spoolforever[_P, _SR]]: ...
66
+
67
+ class mulefunc(Generic[_P, _T]):
68
+ fname: str | None
69
+ mule: int
70
+ @overload
71
+ def __init__(self: mulefunc[..., Any], f: int) -> None: ...
72
+ @overload
73
+ def __init__(self: mulefunc[_P, _T], f: Callable[_P, _T]) -> None: ...
74
+ def real_call(self, *args: _P.args, **kwargs: _P.kwargs) -> None: ...
75
+ @overload
76
+ def __call__(self, __f: Callable[_P2, _T2]) -> mulefunc[_P2, _T2]: ...
77
+ @overload
78
+ def __call__(self, *args: _P.args, **kwargs: _P.kwargs) -> _T: ...
79
+
80
+ def mule_msg_dispatcher(message: bytes) -> Any: ...
81
+
82
+ class rpc:
83
+ name: str
84
+ def __init__(self, name: str) -> None: ...
85
+ def __call__(self, f: _RPCCallableT) -> _RPCCallableT: ...
86
+
87
+ class farm_loop:
88
+ f: Callable[[bytes], Any]
89
+ farm: str | None
90
+ def __init__(self, f: Callable[[bytes], Any], farm: str | None) -> None: ...
91
+ def __call__(self) -> None: ...
92
+
93
+ class farm:
94
+ name: str
95
+ def __init__(self, name: str | None = None, **kwargs: Any) -> None: ...
96
+ def __call__(self, f: Callable[[bytes], Any]) -> None: ...
97
+
98
+ class mule_brain:
99
+ f: Callable[[], Any]
100
+ num: int
101
+ def __init__(self, f: Callable[[], Any], num: int) -> None: ...
102
+ def __call__(self) -> None: ...
103
+
104
+ class mule_brainloop(mule_brain): ...
105
+
106
+ class mule:
107
+ num: int
108
+ def __init__(self, num: int) -> None: ...
109
+ def __call__(self, f: Callable[[], Any]) -> None: ...
110
+
111
+ class muleloop(mule): ...
112
+
113
+ class mulemsg_loop:
114
+ f: Callable[[bytes], Any]
115
+ num: int
116
+ def __init__(self, f: Callable[[bytes], Any], num: int) -> None: ...
117
+ def __call__(self) -> None: ...
118
+
119
+ class mulemsg:
120
+ num: int
121
+ def __init__(self, num: int) -> None: ...
122
+ def __call__(self, f: Callable[[bytes], Any]) -> None: ...
123
+
124
+ class signal:
125
+ num: int
126
+ target: str
127
+ def __init__(self, num: int, *, target: str = "", **kwargs: Any) -> None: ...
128
+ def __call__(self, f: _SignalCallbackT) -> _SignalCallbackT: ...
129
+
130
+ class timer:
131
+ num: int
132
+ secs: int
133
+ target: str
134
+ def __init__(self, secs: int, *, signum: int = ..., target: str = "", **kwargs: Any) -> None: ...
135
+ def __call__(self, f: _SignalCallbackT) -> _SignalCallbackT: ...
136
+
137
+ class cron:
138
+ num: int
139
+ minute: int
140
+ hour: int
141
+ day: int
142
+ month: int
143
+ dayweek: int
144
+ target: str
145
+ def __init__(
146
+ self, minute: int, hour: int, day: int, month: int, dayweek: int, *, signum: int = ..., target: str = "", **kwargs: Any
147
+ ) -> None: ...
148
+ def __call__(self, f: _SignalCallbackT) -> _SignalCallbackT: ...
149
+
150
+ class rbtimer:
151
+ num: int
152
+ secs: int
153
+ target: str
154
+ def __init__(self, secs: int, *, signum: int = ..., target: str = "", **kwargs: Any) -> None: ...
155
+ def __call__(self, f: _SignalCallbackT) -> _SignalCallbackT: ...
156
+
157
+ class filemon:
158
+ num: int
159
+ fsobj: str
160
+ target: str
161
+ def __init__(self, fsobj: str, *, signum: int = ..., target: str = "", **kwargs: Any) -> None: ...
162
+ def __call__(self, f: _SignalCallbackT) -> _SignalCallbackT: ...
163
+
164
+ class lock(Generic[_P, _T]):
165
+ f: Callable[_P, _T]
166
+ def __init__(self, f: Callable[_P, _T]) -> None: ...
167
+ def __call__(self, *args: _P.args, **kwargs: _P.kwargs) -> _T: ...
168
+
169
+ # FIXME: Technically this only allows positional arguments, but there is not really
170
+ # an adequate way yet to express this, once bound on ParamSpec does something
171
+ # we could probably enforce this
172
+ class thread(Generic[_P, _T]):
173
+ f: Callable[_P, _T]
174
+ def __init__(self, f: Callable[_P, _T]) -> None: ...
175
+ def __call__(self, *args: _P.args, **kwargs: _P.kwargs) -> Callable[_P, _T]: ...
176
+
177
+ class harakiri:
178
+ s: int
179
+ def __init__(self, seconds: int) -> None: ...
180
+ def __call__(self, f: Callable[_P, _T]) -> Callable[_P, _T]: ...