flytekitplugins-sleep 1.16.27__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.
- flytekitplugins/sleep/__init__.py +11 -0
- flytekitplugins/sleep/task.py +46 -0
- flytekitplugins_sleep-1.16.27-py3.12-nspkg.pth +1 -0
- flytekitplugins_sleep-1.16.27.dist-info/METADATA +27 -0
- flytekitplugins_sleep-1.16.27.dist-info/RECORD +9 -0
- flytekitplugins_sleep-1.16.27.dist-info/WHEEL +5 -0
- flytekitplugins_sleep-1.16.27.dist-info/entry_points.txt +2 -0
- flytekitplugins_sleep-1.16.27.dist-info/namespace_packages.txt +1 -0
- flytekitplugins_sleep-1.16.27.dist-info/top_level.txt +1 -0
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
from dataclasses import dataclass
|
|
4
|
+
from typing import Any, Callable, Dict, Optional
|
|
5
|
+
|
|
6
|
+
from flytekit.configuration import SerializationSettings
|
|
7
|
+
from flytekit.core.python_function_task import PythonFunctionTask
|
|
8
|
+
from flytekit.core.task import TaskPlugins
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
@dataclass
|
|
12
|
+
class Sleep:
|
|
13
|
+
"""
|
|
14
|
+
Route a task to the backend ``core-sleep`` plugin.
|
|
15
|
+
|
|
16
|
+
The sleep duration is provided as a normal task input, not plugin config.
|
|
17
|
+
No container is launched; the backend handles the sleep directly.
|
|
18
|
+
|
|
19
|
+
Usage::
|
|
20
|
+
|
|
21
|
+
from flytekitplugins.sleep import Sleep
|
|
22
|
+
from flytekit import task
|
|
23
|
+
from datetime import timedelta
|
|
24
|
+
|
|
25
|
+
@task(task_config=Sleep())
|
|
26
|
+
def sleep_for(duration: timedelta) -> None:
|
|
27
|
+
pass # only runs locally; backend executes the sleep
|
|
28
|
+
"""
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
class SleepFunctionTask(PythonFunctionTask[Sleep]):
|
|
32
|
+
_TASK_TYPE = "core-sleep"
|
|
33
|
+
|
|
34
|
+
def __init__(self, task_config: Optional[Sleep], task_function: Callable, **kwargs):
|
|
35
|
+
super().__init__(
|
|
36
|
+
task_config=task_config or Sleep(),
|
|
37
|
+
task_function=task_function,
|
|
38
|
+
task_type=self._TASK_TYPE,
|
|
39
|
+
**kwargs,
|
|
40
|
+
)
|
|
41
|
+
|
|
42
|
+
def get_custom(self, settings: SerializationSettings) -> Dict[str, Any]:
|
|
43
|
+
return {}
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
TaskPlugins.register_pythontask_plugin(Sleep, SleepFunctionTask)
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import sys, types, os;p = os.path.join(sys._getframe(1).f_locals['sitedir'], *('flytekitplugins',));importlib = __import__('importlib.util');__import__('importlib.machinery');m = sys.modules.setdefault('flytekitplugins', importlib.util.module_from_spec(importlib.machinery.PathFinder.find_spec('flytekitplugins', [os.path.dirname(p)])));m = m or sys.modules.setdefault('flytekitplugins', types.ModuleType('flytekitplugins'));mp = (m or []) and m.__dict__.setdefault('__path__',[]);(p not in mp) and mp.append(p)
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: flytekitplugins-sleep
|
|
3
|
+
Version: 1.16.27
|
|
4
|
+
Summary: This package holds the core-sleep plugin for flytekit
|
|
5
|
+
Author: flyteorg
|
|
6
|
+
Author-email: admin@flyte.org
|
|
7
|
+
License: apache2
|
|
8
|
+
Classifier: Intended Audience :: Science/Research
|
|
9
|
+
Classifier: Intended Audience :: Developers
|
|
10
|
+
Classifier: License :: OSI Approved :: Apache Software License
|
|
11
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
12
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
13
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
14
|
+
Classifier: Topic :: Scientific/Engineering
|
|
15
|
+
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
|
|
16
|
+
Classifier: Topic :: Software Development
|
|
17
|
+
Classifier: Topic :: Software Development :: Libraries
|
|
18
|
+
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
19
|
+
Requires-Python: >=3.9
|
|
20
|
+
Requires-Dist: flytekit>=1.15.1
|
|
21
|
+
Dynamic: author
|
|
22
|
+
Dynamic: author-email
|
|
23
|
+
Dynamic: classifier
|
|
24
|
+
Dynamic: license
|
|
25
|
+
Dynamic: requires-dist
|
|
26
|
+
Dynamic: requires-python
|
|
27
|
+
Dynamic: summary
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
flytekitplugins_sleep-1.16.27-py3.12-nspkg.pth,sha256=ya_zoT0ZM023a2lpUsRaqXsgDEknLucLLOWbbtFBPw4,512
|
|
2
|
+
flytekitplugins/sleep/__init__.py,sha256=mYsNxBEy1WThxSazvT78p4F7MvxO7f6NCRNybZLSU2k,151
|
|
3
|
+
flytekitplugins/sleep/task.py,sha256=t9L02QTwHsDOw5E7FmyNiAoj0fTQwKwCa6wgiVucROg,1344
|
|
4
|
+
flytekitplugins_sleep-1.16.27.dist-info/METADATA,sha256=OavRAp53sd6kwWAGTZ-JnlpeBgHgRaOUyKDL-kAzyjM,983
|
|
5
|
+
flytekitplugins_sleep-1.16.27.dist-info/WHEEL,sha256=YVMoNqKzERt-wjUZwJ33xBGAwnFl-4cqbYkTtWa4itE,91
|
|
6
|
+
flytekitplugins_sleep-1.16.27.dist-info/entry_points.txt,sha256=1NISdvMPSqCWg2sRaUBcgLqMtoKWT8NktSf8hLt025c,49
|
|
7
|
+
flytekitplugins_sleep-1.16.27.dist-info/namespace_packages.txt,sha256=b2gTzXFHuV5afchaJ28HueRhYzj-8x5Ytr8n2twnAik,16
|
|
8
|
+
flytekitplugins_sleep-1.16.27.dist-info/top_level.txt,sha256=b2gTzXFHuV5afchaJ28HueRhYzj-8x5Ytr8n2twnAik,16
|
|
9
|
+
flytekitplugins_sleep-1.16.27.dist-info/RECORD,,
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
flytekitplugins
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
flytekitplugins
|