sf-veritas 0.11.10__cp314-cp314-manylinux_2_28_x86_64.whl
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.
- sf_veritas/__init__.py +46 -0
- sf_veritas/_auto_preload.py +73 -0
- sf_veritas/_sfconfig.c +162 -0
- sf_veritas/_sfconfig.cpython-314-x86_64-linux-gnu.so +0 -0
- sf_veritas/_sfcrashhandler.c +267 -0
- sf_veritas/_sfcrashhandler.cpython-314-x86_64-linux-gnu.so +0 -0
- sf_veritas/_sffastlog.c +953 -0
- sf_veritas/_sffastlog.cpython-314-x86_64-linux-gnu.so +0 -0
- sf_veritas/_sffastnet.c +994 -0
- sf_veritas/_sffastnet.cpython-314-x86_64-linux-gnu.so +0 -0
- sf_veritas/_sffastnetworkrequest.c +727 -0
- sf_veritas/_sffastnetworkrequest.cpython-314-x86_64-linux-gnu.so +0 -0
- sf_veritas/_sffuncspan.c +2791 -0
- sf_veritas/_sffuncspan.cpython-314-x86_64-linux-gnu.so +0 -0
- sf_veritas/_sffuncspan_config.c +730 -0
- sf_veritas/_sffuncspan_config.cpython-314-x86_64-linux-gnu.so +0 -0
- sf_veritas/_sfheadercheck.c +341 -0
- sf_veritas/_sfheadercheck.cpython-314-x86_64-linux-gnu.so +0 -0
- sf_veritas/_sfnetworkhop.c +1454 -0
- sf_veritas/_sfnetworkhop.cpython-314-x86_64-linux-gnu.so +0 -0
- sf_veritas/_sfservice.c +1223 -0
- sf_veritas/_sfservice.cpython-314-x86_64-linux-gnu.so +0 -0
- sf_veritas/_sfteepreload.c +6227 -0
- sf_veritas/app_config.py +57 -0
- sf_veritas/cli.py +336 -0
- sf_veritas/constants.py +10 -0
- sf_veritas/custom_excepthook.py +304 -0
- sf_veritas/custom_log_handler.py +146 -0
- sf_veritas/custom_output_wrapper.py +153 -0
- sf_veritas/custom_print.py +153 -0
- sf_veritas/django_app.py +5 -0
- sf_veritas/env_vars.py +186 -0
- sf_veritas/exception_handling_middleware.py +18 -0
- sf_veritas/exception_metaclass.py +69 -0
- sf_veritas/fast_frame_info.py +116 -0
- sf_veritas/fast_network_hop.py +293 -0
- sf_veritas/frame_tools.py +112 -0
- sf_veritas/funcspan_config_loader.py +693 -0
- sf_veritas/function_span_profiler.py +1313 -0
- sf_veritas/get_preload_path.py +34 -0
- sf_veritas/import_hook.py +62 -0
- sf_veritas/infra_details/__init__.py +3 -0
- sf_veritas/infra_details/get_infra_details.py +24 -0
- sf_veritas/infra_details/kubernetes/__init__.py +3 -0
- sf_veritas/infra_details/kubernetes/get_cluster_name.py +147 -0
- sf_veritas/infra_details/kubernetes/get_details.py +7 -0
- sf_veritas/infra_details/running_on/__init__.py +17 -0
- sf_veritas/infra_details/running_on/kubernetes.py +11 -0
- sf_veritas/interceptors.py +543 -0
- sf_veritas/libsfnettee.so +0 -0
- sf_veritas/local_env_detect.py +118 -0
- sf_veritas/package_metadata.py +6 -0
- sf_veritas/patches/__init__.py +0 -0
- sf_veritas/patches/_patch_tracker.py +74 -0
- sf_veritas/patches/concurrent_futures.py +19 -0
- sf_veritas/patches/constants.py +1 -0
- sf_veritas/patches/exceptions.py +82 -0
- sf_veritas/patches/multiprocessing.py +32 -0
- sf_veritas/patches/network_libraries/__init__.py +99 -0
- sf_veritas/patches/network_libraries/aiohttp.py +294 -0
- sf_veritas/patches/network_libraries/curl_cffi.py +363 -0
- sf_veritas/patches/network_libraries/http_client.py +670 -0
- sf_veritas/patches/network_libraries/httpcore.py +580 -0
- sf_veritas/patches/network_libraries/httplib2.py +315 -0
- sf_veritas/patches/network_libraries/httpx.py +557 -0
- sf_veritas/patches/network_libraries/niquests.py +218 -0
- sf_veritas/patches/network_libraries/pycurl.py +399 -0
- sf_veritas/patches/network_libraries/requests.py +595 -0
- sf_veritas/patches/network_libraries/ssl_socket.py +822 -0
- sf_veritas/patches/network_libraries/tornado.py +360 -0
- sf_veritas/patches/network_libraries/treq.py +270 -0
- sf_veritas/patches/network_libraries/urllib_request.py +483 -0
- sf_veritas/patches/network_libraries/utils.py +598 -0
- sf_veritas/patches/os.py +17 -0
- sf_veritas/patches/threading.py +231 -0
- sf_veritas/patches/web_frameworks/__init__.py +54 -0
- sf_veritas/patches/web_frameworks/aiohttp.py +798 -0
- sf_veritas/patches/web_frameworks/async_websocket_consumer.py +337 -0
- sf_veritas/patches/web_frameworks/blacksheep.py +532 -0
- sf_veritas/patches/web_frameworks/bottle.py +513 -0
- sf_veritas/patches/web_frameworks/cherrypy.py +683 -0
- sf_veritas/patches/web_frameworks/cors_utils.py +122 -0
- sf_veritas/patches/web_frameworks/django.py +963 -0
- sf_veritas/patches/web_frameworks/eve.py +401 -0
- sf_veritas/patches/web_frameworks/falcon.py +931 -0
- sf_veritas/patches/web_frameworks/fastapi.py +738 -0
- sf_veritas/patches/web_frameworks/flask.py +526 -0
- sf_veritas/patches/web_frameworks/klein.py +501 -0
- sf_veritas/patches/web_frameworks/litestar.py +616 -0
- sf_veritas/patches/web_frameworks/pyramid.py +440 -0
- sf_veritas/patches/web_frameworks/quart.py +841 -0
- sf_veritas/patches/web_frameworks/robyn.py +708 -0
- sf_veritas/patches/web_frameworks/sanic.py +874 -0
- sf_veritas/patches/web_frameworks/starlette.py +742 -0
- sf_veritas/patches/web_frameworks/strawberry.py +1446 -0
- sf_veritas/patches/web_frameworks/tornado.py +485 -0
- sf_veritas/patches/web_frameworks/utils.py +170 -0
- sf_veritas/print_override.py +13 -0
- sf_veritas/regular_data_transmitter.py +444 -0
- sf_veritas/request_interceptor.py +401 -0
- sf_veritas/request_utils.py +550 -0
- sf_veritas/segfault_handler.py +116 -0
- sf_veritas/server_status.py +1 -0
- sf_veritas/shutdown_flag.py +11 -0
- sf_veritas/subprocess_startup.py +3 -0
- sf_veritas/test_cli.py +145 -0
- sf_veritas/thread_local.py +1319 -0
- sf_veritas/timeutil.py +114 -0
- sf_veritas/transmit_exception_to_sailfish.py +28 -0
- sf_veritas/transmitter.py +132 -0
- sf_veritas/types.py +47 -0
- sf_veritas/unified_interceptor.py +1678 -0
- sf_veritas/utils.py +39 -0
- sf_veritas-0.11.10.dist-info/METADATA +97 -0
- sf_veritas-0.11.10.dist-info/RECORD +141 -0
- sf_veritas-0.11.10.dist-info/WHEEL +5 -0
- sf_veritas-0.11.10.dist-info/entry_points.txt +2 -0
- sf_veritas-0.11.10.dist-info/top_level.txt +1 -0
- sf_veritas.libs/libbrotlicommon-6ce2a53c.so.1.0.6 +0 -0
- sf_veritas.libs/libbrotlidec-811d1be3.so.1.0.6 +0 -0
- sf_veritas.libs/libcom_err-730ca923.so.2.1 +0 -0
- sf_veritas.libs/libcrypt-52aca757.so.1.1.0 +0 -0
- sf_veritas.libs/libcrypto-bdaed0ea.so.1.1.1k +0 -0
- sf_veritas.libs/libcurl-eaa3cf66.so.4.5.0 +0 -0
- sf_veritas.libs/libgssapi_krb5-323bbd21.so.2.2 +0 -0
- sf_veritas.libs/libidn2-2f4a5893.so.0.3.6 +0 -0
- sf_veritas.libs/libk5crypto-9a74ff38.so.3.1 +0 -0
- sf_veritas.libs/libkeyutils-2777d33d.so.1.6 +0 -0
- sf_veritas.libs/libkrb5-a55300e8.so.3.3 +0 -0
- sf_veritas.libs/libkrb5support-e6594cfc.so.0.1 +0 -0
- sf_veritas.libs/liblber-2-d20824ef.4.so.2.10.9 +0 -0
- sf_veritas.libs/libldap-2-cea2a960.4.so.2.10.9 +0 -0
- sf_veritas.libs/libnghttp2-39367a22.so.14.17.0 +0 -0
- sf_veritas.libs/libpcre2-8-516f4c9d.so.0.7.1 +0 -0
- sf_veritas.libs/libpsl-99becdd3.so.5.3.1 +0 -0
- sf_veritas.libs/libsasl2-7de4d792.so.3.0.0 +0 -0
- sf_veritas.libs/libselinux-d0805dcb.so.1 +0 -0
- sf_veritas.libs/libssh-c11d285b.so.4.8.7 +0 -0
- sf_veritas.libs/libssl-60250281.so.1.1.1k +0 -0
- sf_veritas.libs/libunistring-05abdd40.so.2.1.0 +0 -0
- sf_veritas.libs/libuuid-95b83d40.so.1.3.0 +0 -0
|
@@ -0,0 +1,231 @@
|
|
|
1
|
+
# import contextvars
|
|
2
|
+
# import multiprocessing
|
|
3
|
+
# import os
|
|
4
|
+
# import threading
|
|
5
|
+
# from concurrent.futures import ThreadPoolExecutor, ProcessPoolExecutor
|
|
6
|
+
|
|
7
|
+
# from .. import app_config
|
|
8
|
+
# from ..thread_local import (
|
|
9
|
+
# get_context,
|
|
10
|
+
# set_context,
|
|
11
|
+
# is_ld_preload_active,
|
|
12
|
+
# outbound_header_base_ctx,
|
|
13
|
+
# _get_shared_outbound_header_base,
|
|
14
|
+
# )
|
|
15
|
+
# from ..env_vars import SF_DEBUG
|
|
16
|
+
|
|
17
|
+
# _original_thread_init = threading.Thread.__init__
|
|
18
|
+
# _original_process_init = multiprocessing.Process.__init__
|
|
19
|
+
# _original_executor_submit = ThreadPoolExecutor.submit
|
|
20
|
+
# _original_process_submit = ProcessPoolExecutor.submit
|
|
21
|
+
|
|
22
|
+
# # Cache LD_PRELOAD status at module level (checked once, not per-thread)
|
|
23
|
+
# _LD_PRELOAD_MODE = is_ld_preload_active()
|
|
24
|
+
|
|
25
|
+
# # Cache SF_DEBUG flag at module load to avoid repeated checks (set during initialization)
|
|
26
|
+
# _SF_DEBUG_ENABLED = False
|
|
27
|
+
|
|
28
|
+
# # PERFORMANCE: Allow disabling thread patching entirely for benchmarks
|
|
29
|
+
# # Set SF_DISABLE_THREAD_PATCHING=1 to skip all thread wrapping overhead
|
|
30
|
+
# _THREAD_PATCHING_DISABLED = os.getenv("SF_DISABLE_THREAD_PATCHING") == "1"
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
# def patched_thread_init(self, *args, **kwargs):
|
|
34
|
+
# # PERFORMANCE: Skip context propagation when LD_PRELOAD is active
|
|
35
|
+
# # LD_PRELOAD mode only needs outbound headers (handled by ContextVar in ThreadPoolExecutor.submit)
|
|
36
|
+
# # Background library threads (urllib3, httpcore, etc.) don't need full context
|
|
37
|
+
|
|
38
|
+
# # ULTRA-FAST PATH: Check all bypass conditions in one compound expression
|
|
39
|
+
# # Eliminates wrapper overhead for:
|
|
40
|
+
# # 1. SF_DISABLE_THREAD_PATCHING=1 (benchmark mode)
|
|
41
|
+
# # 2. LD_PRELOAD mode (context handled by ContextVar)
|
|
42
|
+
# # 3. Daemon threads (connection pools, background workers)
|
|
43
|
+
# if _THREAD_PATCHING_DISABLED or _LD_PRELOAD_MODE or kwargs.get("daemon", False):
|
|
44
|
+
# # Direct call without any wrapper overhead
|
|
45
|
+
# return _original_thread_init(self, *args, **kwargs)
|
|
46
|
+
|
|
47
|
+
# # OPTIMIZATION: Use lightweight context for library threads (50x faster)
|
|
48
|
+
# # Detect if this is a library background thread (connection pool, worker thread)
|
|
49
|
+
# # by checking if target/args contain common library patterns
|
|
50
|
+
# is_library_thread = False
|
|
51
|
+
# target = kwargs.get("target") or (args[0] if args and callable(args[0]) else None)
|
|
52
|
+
# if target:
|
|
53
|
+
# # Check if target is from an HTTP library (httplib2, urllib3, httpcore, etc.)
|
|
54
|
+
# target_module = getattr(target, "__module__", "") or ""
|
|
55
|
+
# is_library_thread = any(
|
|
56
|
+
# lib in target_module
|
|
57
|
+
# for lib in ("httplib2", "urllib3", "httpcore", "requests", "aiohttp", "httpx")
|
|
58
|
+
# )
|
|
59
|
+
|
|
60
|
+
# # Get context: lightweight for library threads, full for user threads
|
|
61
|
+
# current_context = get_context(lightweight=is_library_thread)
|
|
62
|
+
|
|
63
|
+
# original_target = kwargs.get("target")
|
|
64
|
+
# if original_target:
|
|
65
|
+
|
|
66
|
+
# def wrapped_target(*targs, **tkwargs):
|
|
67
|
+
# set_context(current_context)
|
|
68
|
+
# original_target(*targs, **tkwargs)
|
|
69
|
+
|
|
70
|
+
# kwargs["target"] = wrapped_target
|
|
71
|
+
# elif args and callable(args[0]):
|
|
72
|
+
# original_target = args[0]
|
|
73
|
+
|
|
74
|
+
# def wrapped_target(*targs, **tkwargs):
|
|
75
|
+
# set_context(current_context)
|
|
76
|
+
# original_target(*targs, **tkwargs)
|
|
77
|
+
|
|
78
|
+
# args = (wrapped_target,) + args[1:]
|
|
79
|
+
|
|
80
|
+
# _original_thread_init(self, *args, **kwargs)
|
|
81
|
+
|
|
82
|
+
|
|
83
|
+
# def patched_process_init(self, *args, **kwargs):
|
|
84
|
+
# """
|
|
85
|
+
# Patch multiprocessing.Process.__init__() to serialize and pass context data to child processes.
|
|
86
|
+
|
|
87
|
+
# Similar to Thread patching, but we serialize the outbound header base dict
|
|
88
|
+
# since ContextVars cannot cross process boundaries (separate memory space).
|
|
89
|
+
|
|
90
|
+
# Performance:
|
|
91
|
+
# - Serialize overhead: ~100-500ns per process creation
|
|
92
|
+
# - IPC overhead: ~10-100μs (inter-process communication)
|
|
93
|
+
# - ContextVar reads in child: ~10-20ns each (NO LOCK)
|
|
94
|
+
# """
|
|
95
|
+
# # Get current outbound header base (try ContextVar first, then shared registry)
|
|
96
|
+
# base_dict = outbound_header_base_ctx.get()
|
|
97
|
+
# if not base_dict:
|
|
98
|
+
# base_dict = _get_shared_outbound_header_base()
|
|
99
|
+
|
|
100
|
+
# if _SF_DEBUG_ENABLED:
|
|
101
|
+
# print(f"[Process.__init__] 📦 Serializing context for child process: {base_dict}", log=False)
|
|
102
|
+
|
|
103
|
+
# original_target = kwargs.get("target")
|
|
104
|
+
# if original_target:
|
|
105
|
+
# def wrapped_target(*targs, **tkwargs):
|
|
106
|
+
# # Restore outbound header base in child process's ContextVar
|
|
107
|
+
# if base_dict:
|
|
108
|
+
# try:
|
|
109
|
+
# from sf_veritas.thread_local import outbound_header_base_ctx as child_ctx
|
|
110
|
+
# child_ctx.set(base_dict)
|
|
111
|
+
# if SF_DEBUG:
|
|
112
|
+
# print(f"[Process child] ✅ Restored context in child process: {base_dict}", log=False)
|
|
113
|
+
# except Exception as e:
|
|
114
|
+
# if SF_DEBUG:
|
|
115
|
+
# print(f"[Process child] ⚠️ Failed to restore context: {e}", log=False)
|
|
116
|
+
|
|
117
|
+
# # Run original target
|
|
118
|
+
# original_target(*targs, **tkwargs)
|
|
119
|
+
|
|
120
|
+
# kwargs["target"] = wrapped_target
|
|
121
|
+
# elif args and callable(args[0]):
|
|
122
|
+
# original_target = args[0]
|
|
123
|
+
|
|
124
|
+
# def wrapped_target(*targs, **tkwargs):
|
|
125
|
+
# # Restore outbound header base in child process's ContextVar
|
|
126
|
+
# if base_dict:
|
|
127
|
+
# try:
|
|
128
|
+
# from sf_veritas.thread_local import outbound_header_base_ctx as child_ctx
|
|
129
|
+
# child_ctx.set(base_dict)
|
|
130
|
+
# if SF_DEBUG:
|
|
131
|
+
# print(f"[Process child] ✅ Restored context in child process: {base_dict}", log=False)
|
|
132
|
+
# except Exception as e:
|
|
133
|
+
# if SF_DEBUG:
|
|
134
|
+
# print(f"[Process child] ⚠️ Failed to restore context: {e}", log=False)
|
|
135
|
+
|
|
136
|
+
# # Run original target
|
|
137
|
+
# original_target(*targs, **tkwargs)
|
|
138
|
+
|
|
139
|
+
# args = (wrapped_target,) + args[1:]
|
|
140
|
+
|
|
141
|
+
# _original_process_init(self, *args, **kwargs)
|
|
142
|
+
|
|
143
|
+
|
|
144
|
+
# def patched_executor_submit(self, fn, /, *args, **kwargs):
|
|
145
|
+
# """
|
|
146
|
+
# Patch ThreadPoolExecutor.submit() to copy ContextVars to worker threads.
|
|
147
|
+
|
|
148
|
+
# This ensures outbound_header_base_ctx propagates to worker threads,
|
|
149
|
+
# eliminating lock contention on shared registry (~10ns vs 1-6ms!).
|
|
150
|
+
|
|
151
|
+
# Performance:
|
|
152
|
+
# - Before: ContextVar is None on worker thread → falls back to shared registry (LOCK) → 1-6ms
|
|
153
|
+
# - After: ContextVar copied to worker thread → instant access (~10ns) → NO LOCK
|
|
154
|
+
# """
|
|
155
|
+
# # PERFORMANCE: In LD_PRELOAD mode, we still need ContextVar propagation
|
|
156
|
+
# # but it's ultra-fast (~500ns) compared to get_context() (~264μs)
|
|
157
|
+
|
|
158
|
+
# # Copy current context (includes all ContextVars)
|
|
159
|
+
# ctx = contextvars.copy_context()
|
|
160
|
+
|
|
161
|
+
# # DEBUG: Uncomment for troubleshooting (adds ~1-100μs per submit!)
|
|
162
|
+
# # if SF_DEBUG:
|
|
163
|
+
# # from .. import app_config
|
|
164
|
+
# # from ..thread_local import outbound_header_base_ctx
|
|
165
|
+
# # if app_config._interceptors_initialized:
|
|
166
|
+
# # base_in_ctx = outbound_header_base_ctx.get(None)
|
|
167
|
+
# # print(f"[ThreadPoolExecutor.submit] 📋 Copying context to worker thread (ctx has {len(ctx)} vars, outbound_header_base={base_in_ctx})", log=False)
|
|
168
|
+
|
|
169
|
+
# # Wrap function to run in copied context (minimal overhead ~500ns)
|
|
170
|
+
# def wrapped_fn():
|
|
171
|
+
# return ctx.run(fn, *args, **kwargs)
|
|
172
|
+
|
|
173
|
+
# # Submit wrapped function to executor
|
|
174
|
+
# return _original_executor_submit(self, wrapped_fn)
|
|
175
|
+
|
|
176
|
+
|
|
177
|
+
# def patched_process_submit(self, fn, /, *args, **kwargs):
|
|
178
|
+
# """
|
|
179
|
+
# Patch ProcessPoolExecutor.submit() to serialize and pass context data to child processes.
|
|
180
|
+
|
|
181
|
+
# NOTE: ContextVars cannot be copied directly to processes (separate memory space).
|
|
182
|
+
# Instead, we serialize the outbound header base dict and restore it in the child.
|
|
183
|
+
|
|
184
|
+
# Performance:
|
|
185
|
+
# - Serialize + IPC overhead: ~10-100μs per submit (one-time cost)
|
|
186
|
+
# - ContextVar reads in child: ~10-20ns each (NO LOCK)
|
|
187
|
+
# - Still better than lock contention on every outbound call!
|
|
188
|
+
|
|
189
|
+
# Limitations:
|
|
190
|
+
# - Only works if child process has sf_veritas imported and initialized
|
|
191
|
+
# - Adds ~10-100μs overhead per submit (vs ~500ns for threads)
|
|
192
|
+
# """
|
|
193
|
+
# # Get current outbound header base (try ContextVar first, then shared registry)
|
|
194
|
+
# base_dict = outbound_header_base_ctx.get()
|
|
195
|
+
# if not base_dict:
|
|
196
|
+
# base_dict = _get_shared_outbound_header_base()
|
|
197
|
+
|
|
198
|
+
# if _SF_DEBUG_ENABLED:
|
|
199
|
+
# print(f"[ProcessPoolExecutor.submit] 📦 Serializing context for child process: {base_dict}", log=False)
|
|
200
|
+
|
|
201
|
+
# # Wrap function to restore context in child process
|
|
202
|
+
# def wrapped_fn():
|
|
203
|
+
# # Restore outbound header base in child process's ContextVar
|
|
204
|
+
# if base_dict:
|
|
205
|
+
# try:
|
|
206
|
+
# from sf_veritas.thread_local import outbound_header_base_ctx as child_ctx
|
|
207
|
+
# child_ctx.set(base_dict)
|
|
208
|
+
# if SF_DEBUG:
|
|
209
|
+
# print(f"[ProcessPoolExecutor child] ✅ Restored context in child process: {base_dict}", log=False)
|
|
210
|
+
# except Exception as e:
|
|
211
|
+
# if SF_DEBUG:
|
|
212
|
+
# print(f"[ProcessPoolExecutor child] ⚠️ Failed to restore context: {e}", log=False)
|
|
213
|
+
|
|
214
|
+
# # Run original function
|
|
215
|
+
# return fn(*args, **kwargs)
|
|
216
|
+
|
|
217
|
+
# # Submit wrapped function to executor
|
|
218
|
+
# return _original_process_submit(self, wrapped_fn)
|
|
219
|
+
|
|
220
|
+
|
|
221
|
+
# def patch_threading():
|
|
222
|
+
# global _SF_DEBUG_ENABLED
|
|
223
|
+
# _SF_DEBUG_ENABLED = SF_DEBUG and app_config._interceptors_initialized
|
|
224
|
+
|
|
225
|
+
# threading.Thread.__init__ = patched_thread_init
|
|
226
|
+
# multiprocessing.Process.__init__ = patched_process_init
|
|
227
|
+
# ThreadPoolExecutor.submit = patched_executor_submit
|
|
228
|
+
# ProcessPoolExecutor.submit = patched_process_submit
|
|
229
|
+
|
|
230
|
+
# if _SF_DEBUG_ENABLED:
|
|
231
|
+
# print("[patch_threading] ✅ Patched Thread.__init__, Process.__init__, ThreadPoolExecutor.submit, and ProcessPoolExecutor.submit for ContextVar propagation", log=False)
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
from typing import List, Optional
|
|
2
|
+
|
|
3
|
+
from .aiohttp import patch_aiohttp
|
|
4
|
+
from .async_websocket_consumer import patch_async_consumer_call
|
|
5
|
+
from .blacksheep import patch_blacksheep
|
|
6
|
+
from .bottle import patch_bottle
|
|
7
|
+
from .cherrypy import patch_cherrypy
|
|
8
|
+
from .django import find_and_modify_output_wrapper, patch_django_middleware
|
|
9
|
+
from .eve import patch_eve
|
|
10
|
+
from .falcon import patch_falcon
|
|
11
|
+
from .fastapi import patch_fastapi
|
|
12
|
+
from .flask import patch_flask
|
|
13
|
+
from .klein import patch_klein
|
|
14
|
+
from .litestar import patch_litestar
|
|
15
|
+
from .pyramid import patch_pyramid
|
|
16
|
+
from .quart import patch_quart
|
|
17
|
+
|
|
18
|
+
# Robyn is NOT SUPPORTED - see ROBYN_LIMITATION.md
|
|
19
|
+
# from .robyn import patch_robyn
|
|
20
|
+
# Sanic is NOT SUPPORTED - see SANIC_LIMITATION.md
|
|
21
|
+
# from .sanic import patch_sanic
|
|
22
|
+
from .starlette import patch_starlette
|
|
23
|
+
from .strawberry import patch_strawberry
|
|
24
|
+
from .tornado import patch_tornado
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
def patch_web_frameworks(routes_to_skip: Optional[List[str]] = None):
|
|
28
|
+
routes_to_skip = routes_to_skip or []
|
|
29
|
+
|
|
30
|
+
patch_strawberry()
|
|
31
|
+
patch_async_consumer_call()
|
|
32
|
+
find_and_modify_output_wrapper()
|
|
33
|
+
patch_django_middleware(routes_to_skip)
|
|
34
|
+
patch_fastapi(routes_to_skip)
|
|
35
|
+
patch_flask(routes_to_skip)
|
|
36
|
+
patch_falcon(routes_to_skip)
|
|
37
|
+
patch_bottle(routes_to_skip)
|
|
38
|
+
patch_quart(routes_to_skip)
|
|
39
|
+
patch_tornado(routes_to_skip)
|
|
40
|
+
patch_aiohttp(routes_to_skip)
|
|
41
|
+
patch_blacksheep(routes_to_skip)
|
|
42
|
+
patch_cherrypy(routes_to_skip)
|
|
43
|
+
patch_pyramid(routes_to_skip)
|
|
44
|
+
patch_litestar(routes_to_skip)
|
|
45
|
+
patch_klein(routes_to_skip)
|
|
46
|
+
patch_eve(routes_to_skip)
|
|
47
|
+
# Sanic is NOT SUPPORTED - see SANIC_LIMITATION.md
|
|
48
|
+
# patch_sanic(routes_to_skip)
|
|
49
|
+
patch_starlette(routes_to_skip)
|
|
50
|
+
# Robyn is NOT SUPPORTED - see ROBYN_LIMITATION.md
|
|
51
|
+
# patch_robyn(routes_to_skip)
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
__all__ = ["patch_web_frameworks"]
|