prefect-client 3.2.16.dev1__py3-none-any.whl → 3.3.0__py3-none-any.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.
- prefect/_build_info.py +3 -3
- prefect/events/utilities.py +40 -30
- prefect/server/api/server.py +2 -2
- {prefect_client-3.2.16.dev1.dist-info → prefect_client-3.3.0.dist-info}/METADATA +2 -2
- {prefect_client-3.2.16.dev1.dist-info → prefect_client-3.3.0.dist-info}/RECORD +7 -7
- {prefect_client-3.2.16.dev1.dist-info → prefect_client-3.3.0.dist-info}/WHEEL +0 -0
- {prefect_client-3.2.16.dev1.dist-info → prefect_client-3.3.0.dist-info}/licenses/LICENSE +0 -0
prefect/_build_info.py
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
# Generated by versioningit
|
2
|
-
__version__ = "3.
|
3
|
-
__build_date__ = "2025-03-
|
4
|
-
__git_commit__ = "
|
2
|
+
__version__ = "3.3.0"
|
3
|
+
__build_date__ = "2025-03-31 15:28:57.721236+00:00"
|
4
|
+
__git_commit__ = "ef73b2c49e26b05c55b52022048da00f0845dcf1"
|
5
5
|
__dirty__ = False
|
prefect/events/utilities.py
CHANGED
@@ -2,10 +2,11 @@ from __future__ import annotations
|
|
2
2
|
|
3
3
|
import datetime
|
4
4
|
from datetime import timedelta
|
5
|
-
from typing import Any
|
5
|
+
from typing import TYPE_CHECKING, Any
|
6
6
|
from uuid import UUID
|
7
7
|
|
8
8
|
import prefect.types._datetime
|
9
|
+
from prefect.logging.loggers import get_logger
|
9
10
|
|
10
11
|
from .clients import (
|
11
12
|
AssertingEventsClient,
|
@@ -16,8 +17,13 @@ from .clients import (
|
|
16
17
|
from .schemas.events import Event, RelatedResource
|
17
18
|
from .worker import EventsWorker, should_emit_events
|
18
19
|
|
20
|
+
if TYPE_CHECKING:
|
21
|
+
import logging
|
22
|
+
|
19
23
|
TIGHT_TIMING = timedelta(minutes=5)
|
20
24
|
|
25
|
+
logger: "logging.Logger" = get_logger(__name__)
|
26
|
+
|
21
27
|
|
22
28
|
def emit_event(
|
23
29
|
event: str,
|
@@ -52,41 +58,45 @@ def emit_event(
|
|
52
58
|
if not should_emit_events():
|
53
59
|
return None
|
54
60
|
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
61
|
+
try:
|
62
|
+
operational_clients = [
|
63
|
+
AssertingPassthroughEventsClient,
|
64
|
+
AssertingEventsClient,
|
65
|
+
PrefectCloudEventsClient,
|
66
|
+
PrefectEventsClient,
|
67
|
+
]
|
68
|
+
worker_instance = EventsWorker.instance()
|
62
69
|
|
63
|
-
|
64
|
-
|
70
|
+
if worker_instance.client_type not in operational_clients:
|
71
|
+
return None
|
65
72
|
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
73
|
+
event_kwargs: dict[str, Any] = {
|
74
|
+
"event": event,
|
75
|
+
"resource": resource,
|
76
|
+
**kwargs,
|
77
|
+
}
|
71
78
|
|
72
|
-
|
73
|
-
|
74
|
-
|
79
|
+
if occurred is None:
|
80
|
+
occurred = prefect.types._datetime.now("UTC")
|
81
|
+
event_kwargs["occurred"] = occurred
|
75
82
|
|
76
|
-
|
77
|
-
|
83
|
+
if related is not None:
|
84
|
+
event_kwargs["related"] = related
|
78
85
|
|
79
|
-
|
80
|
-
|
86
|
+
if payload is not None:
|
87
|
+
event_kwargs["payload"] = payload
|
81
88
|
|
82
|
-
|
83
|
-
|
89
|
+
if id is not None:
|
90
|
+
event_kwargs["id"] = id
|
84
91
|
|
85
|
-
|
86
|
-
|
87
|
-
|
92
|
+
if follows is not None:
|
93
|
+
if -TIGHT_TIMING < (occurred - follows.occurred) < TIGHT_TIMING:
|
94
|
+
event_kwargs["follows"] = follows.id
|
88
95
|
|
89
|
-
|
90
|
-
|
96
|
+
event_obj = Event(**event_kwargs)
|
97
|
+
worker_instance.send(event_obj)
|
91
98
|
|
92
|
-
|
99
|
+
return event_obj
|
100
|
+
except Exception:
|
101
|
+
logger.exception(f"Error emitting event: {event}")
|
102
|
+
return None
|
prefect/server/api/server.py
CHANGED
@@ -253,11 +253,11 @@ def copy_directory(directory: str, path: str) -> None:
|
|
253
253
|
# ensure copied files are writeable
|
254
254
|
for root, dirs, files in os.walk(destination):
|
255
255
|
for f in files:
|
256
|
-
os.chmod(os.path.join(root, f),
|
256
|
+
os.chmod(os.path.join(root, f), 0o700)
|
257
257
|
else:
|
258
258
|
shutil.copy2(source, destination)
|
259
259
|
# Ensure copied file is writeable
|
260
|
-
os.chmod(destination,
|
260
|
+
os.chmod(destination, 0o700)
|
261
261
|
|
262
262
|
|
263
263
|
async def custom_internal_exception_handler(
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: prefect-client
|
3
|
-
Version: 3.
|
3
|
+
Version: 3.3.0
|
4
4
|
Summary: Workflow orchestration and management.
|
5
5
|
Project-URL: Changelog, https://github.com/PrefectHQ/prefect/releases
|
6
6
|
Project-URL: Documentation, https://docs.prefect.io
|
@@ -53,7 +53,7 @@ Requires-Dist: python-socks[asyncio]<3.0,>=2.5.3
|
|
53
53
|
Requires-Dist: pytz<2026,>=2021.1
|
54
54
|
Requires-Dist: pyyaml<7.0.0,>=5.4.1
|
55
55
|
Requires-Dist: rfc3339-validator<0.2.0,>=0.1.4
|
56
|
-
Requires-Dist: rich<
|
56
|
+
Requires-Dist: rich<15.0,>=11.0
|
57
57
|
Requires-Dist: ruamel-yaml>=0.17.0
|
58
58
|
Requires-Dist: sniffio<2.0.0,>=1.3.0
|
59
59
|
Requires-Dist: toml>=0.10.0
|
@@ -1,7 +1,7 @@
|
|
1
1
|
prefect/.prefectignore,sha256=awSprvKT0vI8a64mEOLrMxhxqcO-b0ERQeYpA2rNKVQ,390
|
2
2
|
prefect/__init__.py,sha256=iCdcC5ZmeewikCdnPEP6YBAjPNV5dvfxpYCTpw30Hkw,3685
|
3
3
|
prefect/__main__.py,sha256=WFjw3kaYJY6pOTA7WDOgqjsz8zUEUZHCcj3P5wyVa-g,66
|
4
|
-
prefect/_build_info.py,sha256=
|
4
|
+
prefect/_build_info.py,sha256=YvpGLTpFxGQ_grDGKBX2Gt1wo6CZtiqYmzZ5LKEPXlY,180
|
5
5
|
prefect/_result_records.py,sha256=S6QmsODkehGVSzbMm6ig022PYbI6gNKz671p_8kBYx4,7789
|
6
6
|
prefect/_waiters.py,sha256=Ia2ITaXdHzevtyWIgJoOg95lrEXQqNEOquHvw3T33UQ,9026
|
7
7
|
prefect/agent.py,sha256=dPvG1jDGD5HSH7aM2utwtk6RaJ9qg13XjkA0lAIgQmY,287
|
@@ -149,7 +149,7 @@ prefect/events/actions.py,sha256=A7jS8bo4zWGnrt3QfSoQs0uYC1xfKXio3IfU0XtTb5s,912
|
|
149
149
|
prefect/events/clients.py,sha256=XA33NpeRdgVglt7J47uFdpASa1bCvcKWyxsxQt3vEPQ,27290
|
150
150
|
prefect/events/filters.py,sha256=cZ9KnQyWpIHshpAJ95nF5JosCag48enI5cBfKd2JNXA,8227
|
151
151
|
prefect/events/related.py,sha256=nthW3toCPacIL1xkWeV_BG30X6hF4vF2rJHAgqtDXXU,6580
|
152
|
-
prefect/events/utilities.py,sha256=
|
152
|
+
prefect/events/utilities.py,sha256=ww34bTMENCNwcp6RhhgzG0KgXOvKGe0MKmBdSJ8NpZY,3043
|
153
153
|
prefect/events/worker.py,sha256=HjbibR0_J1W1nnNMZDFTXAbB0cl_cFGaFI87DvNGcnI,4557
|
154
154
|
prefect/events/cli/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
155
155
|
prefect/events/cli/automations.py,sha256=uCX3NnypoI25TmyAoyL6qYhanWjZbJ2watwv1nfQMxs,11513
|
@@ -216,7 +216,7 @@ prefect/server/api/middleware.py,sha256=WkyuyeJIfo9Q0GAIVU5gO6yIGNVwoHwuBah5AB5o
|
|
216
216
|
prefect/server/api/root.py,sha256=CeumFYIM_BDvPicJH9ry5PO_02PZTLeMqbLMGGTh90o,942
|
217
217
|
prefect/server/api/run_history.py,sha256=FHepAgo1AYFeuh7rrAVzo_o3hu8Uc8-4DeH5aD5VGgw,5995
|
218
218
|
prefect/server/api/saved_searches.py,sha256=UjoqLLe245QVIs6q5Vk4vdODCOoYzciEEjhi7B8sYCE,3233
|
219
|
-
prefect/server/api/server.py,sha256=
|
219
|
+
prefect/server/api/server.py,sha256=CIpLoiRUCuW345trzwr_Z8v53Kw_2RBqe3ppGvkjSx0,32940
|
220
220
|
prefect/server/api/task_run_states.py,sha256=e63OPpxPudv_CIB5oKr8Z8rfQ-Osjm9Zq0iHe8obnMo,1647
|
221
221
|
prefect/server/api/task_runs.py,sha256=86lXKGUJJSElhkVcxX-kbjctrNe98nUe3U0McDCfTMw,13904
|
222
222
|
prefect/server/api/task_workers.py,sha256=cFP9M8tsApDL_JpySn-x6fOYy9RnOeOgKiqOl_UVVQM,1042
|
@@ -316,7 +316,7 @@ prefect/workers/cloud.py,sha256=dPvG1jDGD5HSH7aM2utwtk6RaJ9qg13XjkA0lAIgQmY,287
|
|
316
316
|
prefect/workers/process.py,sha256=uxOwcqA2Ps-V-W6WeSdKCQMINrCxBEVx1K1Un8pb7vs,8973
|
317
317
|
prefect/workers/server.py,sha256=2pmVeJZiVbEK02SO6BEZaBIvHMsn6G8LzjW8BXyiTtk,1952
|
318
318
|
prefect/workers/utilities.py,sha256=VfPfAlGtTuDj0-Kb8WlMgAuOfgXCdrGAnKMapPSBrwc,2483
|
319
|
-
prefect_client-3.
|
320
|
-
prefect_client-3.
|
321
|
-
prefect_client-3.
|
322
|
-
prefect_client-3.
|
319
|
+
prefect_client-3.3.0.dist-info/METADATA,sha256=1u64NIfd917nrg-CjmHQTxkh-8BuaPDFBgby2yKCREg,7411
|
320
|
+
prefect_client-3.3.0.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
321
|
+
prefect_client-3.3.0.dist-info/licenses/LICENSE,sha256=MCxsn8osAkzfxKC4CC_dLcUkU8DZLkyihZ8mGs3Ah3Q,11357
|
322
|
+
prefect_client-3.3.0.dist-info/RECORD,,
|
File without changes
|
File without changes
|