encore-dev 2.0.0b11__tar.gz → 2.0.0b14__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.
- {encore_dev-2.0.0b11 → encore_dev-2.0.0b14}/PKG-INFO +1 -1
- {encore_dev-2.0.0b11 → encore_dev-2.0.0b14}/encore/_run.py +8 -2
- {encore_dev-2.0.0b11 → encore_dev-2.0.0b14}/encore/internal/_native.pyi +8 -0
- {encore_dev-2.0.0b11 → encore_dev-2.0.0b14}/encore/internal/runtime.py +36 -0
- {encore_dev-2.0.0b11 → encore_dev-2.0.0b14}/pyproject.toml +2 -1
- {encore_dev-2.0.0b11 → encore_dev-2.0.0b14}/pyproject.toml.orig +5 -1
- {encore_dev-2.0.0b11 → encore_dev-2.0.0b14}/README.md +0 -0
- {encore_dev-2.0.0b11 → encore_dev-2.0.0b14}/encore/__init__.py +0 -0
- {encore_dev-2.0.0b11 → encore_dev-2.0.0b14}/encore/_schema.py +0 -0
- {encore_dev-2.0.0b11 → encore_dev-2.0.0b14}/encore/config/__init__.py +0 -0
- {encore_dev-2.0.0b11 → encore_dev-2.0.0b14}/encore/config/_build.py +0 -0
- {encore_dev-2.0.0b11 → encore_dev-2.0.0b14}/encore/config/_markers.py +0 -0
- {encore_dev-2.0.0b11 → encore_dev-2.0.0b14}/encore/cron/__init__.py +0 -0
- {encore_dev-2.0.0b11 → encore_dev-2.0.0b14}/encore/django/__init__.py +0 -0
- {encore_dev-2.0.0b11 → encore_dev-2.0.0b14}/encore/django/base.py +0 -0
- {encore_dev-2.0.0b11 → encore_dev-2.0.0b14}/encore/env/__init__.py +0 -0
- {encore_dev-2.0.0b11 → encore_dev-2.0.0b14}/encore/errs/__init__.py +0 -0
- {encore_dev-2.0.0b11 → encore_dev-2.0.0b14}/encore/frontends/__init__.py +0 -0
- {encore_dev-2.0.0b11 → encore_dev-2.0.0b14}/encore/gateway/__init__.py +0 -0
- {encore_dev-2.0.0b11 → encore_dev-2.0.0b14}/encore/gateway/_serve.py +0 -0
- {encore_dev-2.0.0b11 → encore_dev-2.0.0b14}/encore/gateway/match.py +0 -0
- {encore_dev-2.0.0b11 → encore_dev-2.0.0b14}/encore/gateways/__init__.py +0 -0
- {encore_dev-2.0.0b11 → encore_dev-2.0.0b14}/encore/internal/__init__.py +0 -0
- {encore_dev-2.0.0b11 → encore_dev-2.0.0b14}/encore/internal/_loader.py +0 -0
- {encore_dev-2.0.0b11 → encore_dev-2.0.0b14}/encore/internal/clients.py +0 -0
- {encore_dev-2.0.0b11 → encore_dev-2.0.0b14}/encore/internal/grpc.py +0 -0
- {encore_dev-2.0.0b11 → encore_dev-2.0.0b14}/encore/internal/lazy.py +0 -0
- {encore_dev-2.0.0b11 → encore_dev-2.0.0b14}/encore/internal/reqfields.py +0 -0
- {encore_dev-2.0.0b11 → encore_dev-2.0.0b14}/encore/internal/startup.py +0 -0
- {encore_dev-2.0.0b11 → encore_dev-2.0.0b14}/encore/internal/testscope.py +0 -0
- {encore_dev-2.0.0b11 → encore_dev-2.0.0b14}/encore/logs/__init__.py +0 -0
- {encore_dev-2.0.0b11 → encore_dev-2.0.0b14}/encore/logs/_api.py +0 -0
- {encore_dev-2.0.0b11 → encore_dev-2.0.0b14}/encore/logs/_console.py +0 -0
- {encore_dev-2.0.0b11 → encore_dev-2.0.0b14}/encore/logs/_runtime.py +0 -0
- {encore_dev-2.0.0b11 → encore_dev-2.0.0b14}/encore/metrics/__init__.py +0 -0
- {encore_dev-2.0.0b11 → encore_dev-2.0.0b14}/encore/metrics/_instrument.py +0 -0
- {encore_dev-2.0.0b11 → encore_dev-2.0.0b14}/encore/metrics/_metrics.py +0 -0
- {encore_dev-2.0.0b11 → encore_dev-2.0.0b14}/encore/metrics/_provider.py +0 -0
- {encore_dev-2.0.0b11 → encore_dev-2.0.0b14}/encore/pubsub/__init__.py +0 -0
- {encore_dev-2.0.0b11 → encore_dev-2.0.0b14}/encore/py.typed +0 -0
- {encore_dev-2.0.0b11 → encore_dev-2.0.0b14}/encore/reqctx/__init__.py +0 -0
- {encore_dev-2.0.0b11 → encore_dev-2.0.0b14}/encore/reqctx/_json.py +0 -0
- {encore_dev-2.0.0b11 → encore_dev-2.0.0b14}/encore/secrets/__init__.py +0 -0
- {encore_dev-2.0.0b11 → encore_dev-2.0.0b14}/encore/server/__init__.py +0 -0
- {encore_dev-2.0.0b11 → encore_dev-2.0.0b14}/encore/server/_serve.py +0 -0
- {encore_dev-2.0.0b11 → encore_dev-2.0.0b14}/encore/server/_span.py +0 -0
- {encore_dev-2.0.0b11 → encore_dev-2.0.0b14}/encore/server/_tracing.py +0 -0
- {encore_dev-2.0.0b11 → encore_dev-2.0.0b14}/encore/server/asgi.py +0 -0
- {encore_dev-2.0.0b11 → encore_dev-2.0.0b14}/encore/server/wsgi.py +0 -0
- {encore_dev-2.0.0b11 → encore_dev-2.0.0b14}/encore/services/__init__.py +0 -0
- {encore_dev-2.0.0b11 → encore_dev-2.0.0b14}/encore/services/_propagate.py +0 -0
- {encore_dev-2.0.0b11 → encore_dev-2.0.0b14}/encore/services/aiohttp.py +0 -0
- {encore_dev-2.0.0b11 → encore_dev-2.0.0b14}/encore/services/httpx.py +0 -0
- {encore_dev-2.0.0b11 → encore_dev-2.0.0b14}/encore/services/niquests.py +0 -0
- {encore_dev-2.0.0b11 → encore_dev-2.0.0b14}/encore/services/requests.py +0 -0
- {encore_dev-2.0.0b11 → encore_dev-2.0.0b14}/encore/shutdown/__init__.py +0 -0
- {encore_dev-2.0.0b11 → encore_dev-2.0.0b14}/encore/storage/__init__.py +0 -0
- {encore_dev-2.0.0b11 → encore_dev-2.0.0b14}/encore/storage/clickhouse/__init__.py +0 -0
- {encore_dev-2.0.0b11 → encore_dev-2.0.0b14}/encore/storage/objects/__init__.py +0 -0
- {encore_dev-2.0.0b11 → encore_dev-2.0.0b14}/encore/storage/postgres/__init__.py +0 -0
- {encore_dev-2.0.0b11 → encore_dev-2.0.0b14}/encore/storage/redis/__init__.py +0 -0
- {encore_dev-2.0.0b11 → encore_dev-2.0.0b14}/encore/storage/redis/_base.py +0 -0
- {encore_dev-2.0.0b11 → encore_dev-2.0.0b14}/encore/storage/redis/_batch.py +0 -0
- {encore_dev-2.0.0b11 → encore_dev-2.0.0b14}/encore/storage/redis/_errors.py +0 -0
- {encore_dev-2.0.0b11 → encore_dev-2.0.0b14}/encore/storage/redis/_responses.py +0 -0
- {encore_dev-2.0.0b11 → encore_dev-2.0.0b14}/encore/storage/redis/_scan.py +0 -0
- {encore_dev-2.0.0b11 → encore_dev-2.0.0b14}/encore/storage/redis/_values.py +0 -0
- {encore_dev-2.0.0b11 → encore_dev-2.0.0b14}/encore/storage/redis/bitmap.py +0 -0
- {encore_dev-2.0.0b11 → encore_dev-2.0.0b14}/encore/storage/redis/command.py +0 -0
- {encore_dev-2.0.0b11 → encore_dev-2.0.0b14}/encore/storage/redis/generic.py +0 -0
- {encore_dev-2.0.0b11 → encore_dev-2.0.0b14}/encore/storage/redis/geo.py +0 -0
- {encore_dev-2.0.0b11 → encore_dev-2.0.0b14}/encore/storage/redis/hash.py +0 -0
- {encore_dev-2.0.0b11 → encore_dev-2.0.0b14}/encore/storage/redis/hyperloglog.py +0 -0
- {encore_dev-2.0.0b11 → encore_dev-2.0.0b14}/encore/storage/redis/json.py +0 -0
- {encore_dev-2.0.0b11 → encore_dev-2.0.0b14}/encore/storage/redis/list.py +0 -0
- {encore_dev-2.0.0b11 → encore_dev-2.0.0b14}/encore/storage/redis/pubsub.py +0 -0
- {encore_dev-2.0.0b11 → encore_dev-2.0.0b14}/encore/storage/redis/script.py +0 -0
- {encore_dev-2.0.0b11 → encore_dev-2.0.0b14}/encore/storage/redis/set.py +0 -0
- {encore_dev-2.0.0b11 → encore_dev-2.0.0b14}/encore/storage/redis/sorted_set.py +0 -0
- {encore_dev-2.0.0b11 → encore_dev-2.0.0b14}/encore/storage/redis/stream.py +0 -0
- {encore_dev-2.0.0b11 → encore_dev-2.0.0b14}/encore/storage/redis/string.py +0 -0
- {encore_dev-2.0.0b11 → encore_dev-2.0.0b14}/encore/testing/__init__.py +0 -0
- {encore_dev-2.0.0b11 → encore_dev-2.0.0b14}/encore/testing/_playwright_fixtures.py +0 -0
- {encore_dev-2.0.0b11 → encore_dev-2.0.0b14}/encore/testing/_steps.py +0 -0
- {encore_dev-2.0.0b11 → encore_dev-2.0.0b14}/encore/testing/playwright.py +0 -0
- {encore_dev-2.0.0b11 → encore_dev-2.0.0b14}/encore/testing/pytest_plugin.py +0 -0
- {encore_dev-2.0.0b11 → encore_dev-2.0.0b14}/encore/testing/system.py +0 -0
- {encore_dev-2.0.0b11 → encore_dev-2.0.0b14}/encore/tracing/__init__.py +0 -0
- {encore_dev-2.0.0b11 → encore_dev-2.0.0b14}/encore/tracing/_context.py +0 -0
- {encore_dev-2.0.0b11 → encore_dev-2.0.0b14}/encore/tracing/_encode.py +0 -0
- {encore_dev-2.0.0b11 → encore_dev-2.0.0b14}/encore/tracing/_provider.py +0 -0
- {encore_dev-2.0.0b11 → encore_dev-2.0.0b14}/encore/tracing/_span.py +0 -0
- {encore_dev-2.0.0b11 → encore_dev-2.0.0b14}/encore/tracing/_tracer.py +0 -0
|
@@ -230,7 +230,8 @@ def _on_signals(
|
|
|
230
230
|
On Windows, where no process can send another SIGTERM, Ctrl-Break
|
|
231
231
|
(SIGBREAK) is an interrupt as Ctrl-C is: it is the one console event
|
|
232
232
|
that can be sent to a process group of its own, and the one Encore sends
|
|
233
|
-
to interrupt a process.
|
|
233
|
+
to interrupt a process. Encore's stop request, which it asks of a
|
|
234
|
+
process waiting for it in place of Ctrl-Break, arrives as SIGBREAK too.
|
|
234
235
|
"""
|
|
235
236
|
first: List[float] = []
|
|
236
237
|
interrupts = _interrupts()
|
|
@@ -249,7 +250,12 @@ def _on_signals(
|
|
|
249
250
|
if threading.current_thread() is not threading.main_thread():
|
|
250
251
|
return lambda: None
|
|
251
252
|
if sys.platform == "win32":
|
|
252
|
-
|
|
253
|
+
from .internal.runtime import listen_stop_request
|
|
254
|
+
|
|
255
|
+
restore = _on_signals_windows(loop, signals, previous, handle)
|
|
256
|
+
# Now that SIGBREAK stops the service.
|
|
257
|
+
listen_stop_request()
|
|
258
|
+
return restore
|
|
253
259
|
for s in signals:
|
|
254
260
|
loop.add_signal_handler(s, handle, s)
|
|
255
261
|
|
|
@@ -1398,6 +1398,14 @@ class Runtime:
|
|
|
1398
1398
|
rather than awaiting: for the exit, which runs no event loop and
|
|
1399
1399
|
leaves the runtime nothing to complete. Call begin_shutdown first.
|
|
1400
1400
|
"""
|
|
1401
|
+
def wait_stop_request(self, /) -> "bool":
|
|
1402
|
+
"""
|
|
1403
|
+
Block this thread until Encore asks the process to stop through the
|
|
1404
|
+
event it gave it on Windows: True then, and False at once when there
|
|
1405
|
+
is none to wait for, as on Unix. Waiting tells Encore to ask through
|
|
1406
|
+
the event rather than with Ctrl-Break: wait only where the request
|
|
1407
|
+
starts the shutdown. Raises OSError if the event can't be waited on.
|
|
1408
|
+
"""
|
|
1401
1409
|
|
|
1402
1410
|
@final
|
|
1403
1411
|
class Secret:
|
|
@@ -118,6 +118,36 @@ def _testing() -> bool:
|
|
|
118
118
|
return (meta.get("environment") or {}).get("type") == "test"
|
|
119
119
|
|
|
120
120
|
|
|
121
|
+
#: Whether a thread waits for Encore's stop request.
|
|
122
|
+
_listening = False
|
|
123
|
+
|
|
124
|
+
|
|
125
|
+
def listen_stop_request() -> None:
|
|
126
|
+
"""On Windows, take Encore's stop request as Ctrl-Break from now on.
|
|
127
|
+
|
|
128
|
+
Once a process waits for the request, Encore asks it to stop that way
|
|
129
|
+
alone, and sends it no Ctrl-Break: call this only once SIGBREAK's handler
|
|
130
|
+
shuts the process down. On the request, a thread raises SIGBREAK, which
|
|
131
|
+
reaches the handler and the signal wakeup fd as Ctrl-Break does. Only the
|
|
132
|
+
first call waits.
|
|
133
|
+
"""
|
|
134
|
+
global _listening
|
|
135
|
+
if sys.platform != "win32" or _listening:
|
|
136
|
+
return
|
|
137
|
+
_listening = True
|
|
138
|
+
threading.Thread(target=_wait_stop_request, daemon=True).start()
|
|
139
|
+
|
|
140
|
+
|
|
141
|
+
def _wait_stop_request() -> None:
|
|
142
|
+
try:
|
|
143
|
+
requested = _runtime.wait_stop_request()
|
|
144
|
+
except OSError as exc:
|
|
145
|
+
print(f"encore: cannot wait for Encore's stop request: {exc}", file=sys.stderr)
|
|
146
|
+
return
|
|
147
|
+
if requested and sys.platform == "win32":
|
|
148
|
+
signal.raise_signal(signal.SIGBREAK)
|
|
149
|
+
|
|
150
|
+
|
|
121
151
|
atexit.register(_shutdown_at_exit)
|
|
122
152
|
# SIGTERM's default action skips atexit, as Ctrl-Break's does. Servers that
|
|
123
153
|
# handle them themselves replace this handler, and re-raise the signal after
|
|
@@ -126,6 +156,12 @@ if threading.current_thread() is threading.main_thread() and not _testing():
|
|
|
126
156
|
for _stop in _STOP_SIGNALS:
|
|
127
157
|
if signal.getsignal(_stop) is signal.SIG_DFL:
|
|
128
158
|
signal.signal(_stop, _exit_on_sigterm)
|
|
159
|
+
# And Encore's stop request, if Ctrl-Break now shuts the process down.
|
|
160
|
+
if (
|
|
161
|
+
sys.platform == "win32"
|
|
162
|
+
and signal.getsignal(signal.SIGBREAK) is _exit_on_sigterm
|
|
163
|
+
):
|
|
164
|
+
listen_stop_request()
|
|
129
165
|
|
|
130
166
|
|
|
131
167
|
def runtime() -> _native.Runtime:
|
|
@@ -4,7 +4,7 @@ build-backend = "uv_build"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "encore-dev"
|
|
7
|
-
version = "2.0.
|
|
7
|
+
version = "2.0.0b14"
|
|
8
8
|
description = "Encore SDK for Python — infrastructure resources"
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
requires-python = ">=3.9"
|
|
@@ -40,6 +40,7 @@ dev = [
|
|
|
40
40
|
"connectrpc>=0.13.0,<0.14; python_version >= '3.11'",
|
|
41
41
|
"django>=5,<6; python_version >= '3.10'",
|
|
42
42
|
"fastapi>=0.156; python_version >= '3.10'",
|
|
43
|
+
"h2>=4.4.1; python_version >= '3.10'",
|
|
43
44
|
"httpx>=0.27",
|
|
44
45
|
"hypercorn>=0.17; python_version >= '3.11'",
|
|
45
46
|
"hypothesis>=6",
|
|
@@ -4,7 +4,7 @@ build-backend = "uv_build"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "encore-dev"
|
|
7
|
-
version = "2.0.
|
|
7
|
+
version = "2.0.0b14"
|
|
8
8
|
description = "Encore SDK for Python — infrastructure resources"
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
requires-python = ">=3.9"
|
|
@@ -61,6 +61,10 @@ dev = [
|
|
|
61
61
|
# encore.run turns FastAPI's own spans off for its requests: the tests
|
|
62
62
|
# hold FastAPI to how it does.
|
|
63
63
|
"fastapi>=0.156; python_version >= '3.10'",
|
|
64
|
+
# The h2c tests speak HTTP/2 through httpx, which needs h2 for it, and
|
|
65
|
+
# frame by frame through h2. Its last release for 3.9 has known
|
|
66
|
+
# vulnerabilities.
|
|
67
|
+
"h2>=4.4.1; python_version >= '3.10'",
|
|
64
68
|
"httpx>=0.27",
|
|
65
69
|
"hypercorn>=0.17; python_version >= '3.11'",
|
|
66
70
|
"hypothesis>=6",
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|