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 CHANGED
@@ -1,5 +1,5 @@
1
1
  # Generated by versioningit
2
- __version__ = "3.2.16.dev1"
3
- __build_date__ = "2025-03-29 08:07:01.586568+00:00"
4
- __git_commit__ = "5ab6871feb6050dc7a712fd182d287b300e25dae"
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
@@ -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
- operational_clients = [
56
- AssertingPassthroughEventsClient,
57
- AssertingEventsClient,
58
- PrefectCloudEventsClient,
59
- PrefectEventsClient,
60
- ]
61
- worker_instance = EventsWorker.instance()
61
+ try:
62
+ operational_clients = [
63
+ AssertingPassthroughEventsClient,
64
+ AssertingEventsClient,
65
+ PrefectCloudEventsClient,
66
+ PrefectEventsClient,
67
+ ]
68
+ worker_instance = EventsWorker.instance()
62
69
 
63
- if worker_instance.client_type not in operational_clients:
64
- return None
70
+ if worker_instance.client_type not in operational_clients:
71
+ return None
65
72
 
66
- event_kwargs: dict[str, Any] = {
67
- "event": event,
68
- "resource": resource,
69
- **kwargs,
70
- }
73
+ event_kwargs: dict[str, Any] = {
74
+ "event": event,
75
+ "resource": resource,
76
+ **kwargs,
77
+ }
71
78
 
72
- if occurred is None:
73
- occurred = prefect.types._datetime.now("UTC")
74
- event_kwargs["occurred"] = occurred
79
+ if occurred is None:
80
+ occurred = prefect.types._datetime.now("UTC")
81
+ event_kwargs["occurred"] = occurred
75
82
 
76
- if related is not None:
77
- event_kwargs["related"] = related
83
+ if related is not None:
84
+ event_kwargs["related"] = related
78
85
 
79
- if payload is not None:
80
- event_kwargs["payload"] = payload
86
+ if payload is not None:
87
+ event_kwargs["payload"] = payload
81
88
 
82
- if id is not None:
83
- event_kwargs["id"] = id
89
+ if id is not None:
90
+ event_kwargs["id"] = id
84
91
 
85
- if follows is not None:
86
- if -TIGHT_TIMING < (occurred - follows.occurred) < TIGHT_TIMING:
87
- event_kwargs["follows"] = follows.id
92
+ if follows is not None:
93
+ if -TIGHT_TIMING < (occurred - follows.occurred) < TIGHT_TIMING:
94
+ event_kwargs["follows"] = follows.id
88
95
 
89
- event_obj = Event(**event_kwargs)
90
- worker_instance.send(event_obj)
96
+ event_obj = Event(**event_kwargs)
97
+ worker_instance.send(event_obj)
91
98
 
92
- return event_obj
99
+ return event_obj
100
+ except Exception:
101
+ logger.exception(f"Error emitting event: {event}")
102
+ return None
@@ -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), 0o600)
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, 0o600)
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.2.16.dev1
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<14.0,>=11.0
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=6M3vznPP_P4-kcCLNH2KzjT7FhuC5xchFLdyken24f0,186
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=A1k8Lq5ZZ0y7U_VpVLw-BJUTOga-Ugei8oNu8i20YGY,2668
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=GHbHTm8qd6i0mbqhnplFNHStUXwYnOuOFc4F9OAYk1c,32940
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.2.16.dev1.dist-info/METADATA,sha256=3qakykQi49WKIUa_eqf3b6A4lIgpiZMc09jOg5lNEfc,7417
320
- prefect_client-3.2.16.dev1.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
321
- prefect_client-3.2.16.dev1.dist-info/licenses/LICENSE,sha256=MCxsn8osAkzfxKC4CC_dLcUkU8DZLkyihZ8mGs3Ah3Q,11357
322
- prefect_client-3.2.16.dev1.dist-info/RECORD,,
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,,