deltafi 2.0rc1730159244116__tar.gz → 2.0rc1731040010625__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.
Potentially problematic release.
This version of deltafi might be problematic. Click here for more details.
- {deltafi-2.0rc1730159244116 → deltafi-2.0rc1731040010625}/PKG-INFO +6 -5
- {deltafi-2.0rc1730159244116 → deltafi-2.0rc1731040010625}/deltafi/domain.py +4 -0
- {deltafi-2.0rc1730159244116 → deltafi-2.0rc1731040010625}/deltafi/plugin.py +15 -1
- {deltafi-2.0rc1730159244116 → deltafi-2.0rc1731040010625}/deltafi/result.py +16 -15
- {deltafi-2.0rc1730159244116 → deltafi-2.0rc1731040010625}/deltafi/test_kit/transform.py +4 -4
- {deltafi-2.0rc1730159244116 → deltafi-2.0rc1731040010625}/pyproject.toml +8 -7
- {deltafi-2.0rc1730159244116 → deltafi-2.0rc1731040010625}/README.md +0 -0
- {deltafi-2.0rc1730159244116 → deltafi-2.0rc1731040010625}/deltafi/__init__.py +0 -0
- {deltafi-2.0rc1730159244116 → deltafi-2.0rc1731040010625}/deltafi/action.py +0 -0
- {deltafi-2.0rc1730159244116 → deltafi-2.0rc1731040010625}/deltafi/actioneventqueue.py +0 -0
- {deltafi-2.0rc1730159244116 → deltafi-2.0rc1731040010625}/deltafi/actiontype.py +0 -0
- {deltafi-2.0rc1730159244116 → deltafi-2.0rc1731040010625}/deltafi/exception.py +0 -0
- {deltafi-2.0rc1730159244116 → deltafi-2.0rc1731040010625}/deltafi/genericmodel.py +0 -0
- {deltafi-2.0rc1730159244116 → deltafi-2.0rc1731040010625}/deltafi/input.py +0 -0
- {deltafi-2.0rc1730159244116 → deltafi-2.0rc1731040010625}/deltafi/logger.py +0 -0
- {deltafi-2.0rc1730159244116 → deltafi-2.0rc1731040010625}/deltafi/metric.py +0 -0
- {deltafi-2.0rc1730159244116 → deltafi-2.0rc1731040010625}/deltafi/storage.py +0 -0
- {deltafi-2.0rc1730159244116 → deltafi-2.0rc1731040010625}/deltafi/test_kit/__init__.py +0 -0
- {deltafi-2.0rc1730159244116 → deltafi-2.0rc1731040010625}/deltafi/test_kit/assertions.py +0 -0
- {deltafi-2.0rc1730159244116 → deltafi-2.0rc1731040010625}/deltafi/test_kit/compare_helpers.py +0 -0
- {deltafi-2.0rc1730159244116 → deltafi-2.0rc1731040010625}/deltafi/test_kit/constants.py +0 -0
- {deltafi-2.0rc1730159244116 → deltafi-2.0rc1731040010625}/deltafi/test_kit/egress.py +0 -0
- {deltafi-2.0rc1730159244116 → deltafi-2.0rc1731040010625}/deltafi/test_kit/framework.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: deltafi
|
|
3
|
-
Version: 2.
|
|
3
|
+
Version: 2.0rc1731040010625
|
|
4
4
|
Summary: SDK for DeltaFi plugins and actions
|
|
5
5
|
License: Apache License, Version 2.0
|
|
6
6
|
Keywords: deltafi
|
|
@@ -19,13 +19,14 @@ Classifier: Programming Language :: Python :: 3.11
|
|
|
19
19
|
Classifier: Programming Language :: Python :: 3.12
|
|
20
20
|
Classifier: Programming Language :: Python :: 3.13
|
|
21
21
|
Classifier: Topic :: Software Development
|
|
22
|
+
Requires-Dist: PyYAML (==6.0.2)
|
|
22
23
|
Requires-Dist: deepdiff (==6.7.1)
|
|
23
24
|
Requires-Dist: json-logging (==1.3.0)
|
|
24
|
-
Requires-Dist: minio (==7.2.
|
|
25
|
-
Requires-Dist: pydantic (==2.
|
|
26
|
-
Requires-Dist: redis (==5.0
|
|
25
|
+
Requires-Dist: minio (==7.2.10)
|
|
26
|
+
Requires-Dist: pydantic (==2.9.2)
|
|
27
|
+
Requires-Dist: redis (==5.2.0)
|
|
27
28
|
Requires-Dist: requests (==2.32.3)
|
|
28
|
-
Requires-Dist: urllib3 (==2.2.
|
|
29
|
+
Requires-Dist: urllib3 (==2.2.3)
|
|
29
30
|
Project-URL: Bug Reports, https://chat.deltafi.org/deltafi/channels/bug-reports
|
|
30
31
|
Project-URL: Documentation, https://docs.deltafi.org/#/
|
|
31
32
|
Project-URL: Source Code, https://gitlab.com/deltafi/deltafi
|
|
@@ -20,6 +20,7 @@ import copy
|
|
|
20
20
|
from datetime import datetime, timedelta, timezone
|
|
21
21
|
from logging import Logger
|
|
22
22
|
from typing import Dict, List, NamedTuple
|
|
23
|
+
from uuid import uuid4
|
|
23
24
|
|
|
24
25
|
from deltafi.storage import ContentService, Segment
|
|
25
26
|
|
|
@@ -119,6 +120,9 @@ class Context(NamedTuple):
|
|
|
119
120
|
saved_content=[],
|
|
120
121
|
logger=logger)
|
|
121
122
|
|
|
123
|
+
def child_context(self):
|
|
124
|
+
return self._replace(did=str(uuid4()))
|
|
125
|
+
|
|
122
126
|
|
|
123
127
|
class Content:
|
|
124
128
|
"""
|
|
@@ -25,6 +25,7 @@ import sys
|
|
|
25
25
|
import threading
|
|
26
26
|
import time
|
|
27
27
|
import traceback
|
|
28
|
+
import yaml
|
|
28
29
|
from datetime import datetime, timezone, timedelta
|
|
29
30
|
from importlib import metadata
|
|
30
31
|
from os.path import isdir, isfile, join
|
|
@@ -182,6 +183,18 @@ class Plugin(object):
|
|
|
182
183
|
'docsMarkdown': self._load_action_docs(action)
|
|
183
184
|
}
|
|
184
185
|
|
|
186
|
+
def _integration_tests(self):
|
|
187
|
+
tests_path = str(Path(os.path.dirname(os.path.abspath(sys.argv[0]))) / 'integration')
|
|
188
|
+
|
|
189
|
+
test_files = []
|
|
190
|
+
if isdir(tests_path):
|
|
191
|
+
test_files = [f for f in os.listdir(tests_path) if isfile(join(tests_path, f))]
|
|
192
|
+
else:
|
|
193
|
+
self.logger.warning(f"tests directory ({tests_path}) does not exist. No tests will be installed.")
|
|
194
|
+
|
|
195
|
+
tests = [json.load(open(join(tests_path, f))) for f in test_files]
|
|
196
|
+
return tests
|
|
197
|
+
|
|
185
198
|
def registration_json(self):
|
|
186
199
|
flows_path = str(Path(os.path.dirname(os.path.abspath(sys.argv[0]))) / 'flows')
|
|
187
200
|
|
|
@@ -208,7 +221,8 @@ class Plugin(object):
|
|
|
208
221
|
'dependencies': [],
|
|
209
222
|
'actions': actions,
|
|
210
223
|
'variables': variables,
|
|
211
|
-
'flowPlans': flows
|
|
224
|
+
'flowPlans': flows,
|
|
225
|
+
'integrationTests': self._integration_tests()
|
|
212
226
|
}
|
|
213
227
|
|
|
214
228
|
def _register(self):
|
|
@@ -239,6 +239,7 @@ class TransformResult(Result):
|
|
|
239
239
|
|
|
240
240
|
def json(self):
|
|
241
241
|
return {
|
|
242
|
+
'did': self.context.did,
|
|
242
243
|
'content': [content.json() for content in self.content],
|
|
243
244
|
'annotations': self.annotations,
|
|
244
245
|
'metadata': self.metadata,
|
|
@@ -249,38 +250,38 @@ class TransformResult(Result):
|
|
|
249
250
|
return [self.json()]
|
|
250
251
|
|
|
251
252
|
|
|
252
|
-
class
|
|
253
|
-
|
|
254
|
-
name: str
|
|
253
|
+
class ChildTransformResult(TransformResult):
|
|
254
|
+
delta_file_name: str
|
|
255
255
|
|
|
256
|
-
def
|
|
257
|
-
|
|
256
|
+
def __init__(self, context: Context, delta_file_name: str = None):
|
|
257
|
+
super().__init__(context.child_context())
|
|
258
|
+
self.delta_file_name = delta_file_name
|
|
258
259
|
|
|
259
260
|
def json(self):
|
|
260
|
-
j =
|
|
261
|
-
if self.
|
|
262
|
-
j['name'] = self.
|
|
261
|
+
j = super().json()
|
|
262
|
+
if self.delta_file_name is not None:
|
|
263
|
+
j['name'] = self.delta_file_name
|
|
263
264
|
return j
|
|
264
265
|
|
|
265
266
|
|
|
266
267
|
class TransformResults(Result):
|
|
267
268
|
def __init__(self, context: Context):
|
|
268
269
|
super().__init__('transform', 'TRANSFORM', context)
|
|
269
|
-
self.
|
|
270
|
+
self.child_results = []
|
|
270
271
|
|
|
271
|
-
def add_result(self, result:
|
|
272
|
-
self.
|
|
272
|
+
def add_result(self, result: ChildTransformResult):
|
|
273
|
+
self.child_results.append(result)
|
|
273
274
|
return self
|
|
274
275
|
|
|
275
276
|
def get_segment_names(self):
|
|
276
277
|
segment_names = {}
|
|
277
|
-
for
|
|
278
|
-
segment_names.update(
|
|
278
|
+
for child_result in self.child_results:
|
|
279
|
+
segment_names.update(child_result.get_segment_names())
|
|
279
280
|
return segment_names
|
|
280
281
|
|
|
281
282
|
def response(self):
|
|
282
283
|
transform_events = []
|
|
283
|
-
for
|
|
284
|
-
json_dict =
|
|
284
|
+
for child_result in self.child_results:
|
|
285
|
+
json_dict = child_result.json()
|
|
285
286
|
transform_events.append(json_dict)
|
|
286
287
|
return transform_events
|
|
@@ -74,12 +74,12 @@ class TransformActionTest(ActionTest):
|
|
|
74
74
|
self.assert_transform_results(test_case, result)
|
|
75
75
|
|
|
76
76
|
def assert_transform_results(self, test_case: TransformTestCase, result: TransformResults):
|
|
77
|
-
assert_equal_len(test_case.results, result.
|
|
78
|
-
for index,
|
|
79
|
-
self.compare_one_transform_result(test_case,
|
|
77
|
+
assert_equal_len(test_case.results, result.child_results)
|
|
78
|
+
for index, child_result in enumerate(result.child_results):
|
|
79
|
+
self.compare_one_transform_result(test_case, child_result, index)
|
|
80
80
|
expected = test_case.results[index]
|
|
81
81
|
if 'name' in expected:
|
|
82
|
-
assert_equal_with_label(expected["name"],
|
|
82
|
+
assert_equal_with_label(expected["name"], child_result.delta_file_name, f"name[{index}]")
|
|
83
83
|
|
|
84
84
|
def assert_transform_result(self, test_case: TransformTestCase, result: TransformResult):
|
|
85
85
|
# Check metrics
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[tool.poetry]
|
|
2
2
|
name = "deltafi"
|
|
3
|
-
version = "2.
|
|
3
|
+
version = "2.0rc1731040010625"
|
|
4
4
|
description = "SDK for DeltaFi plugins and actions"
|
|
5
5
|
authors = ["DeltaFi <deltafi@systolic.com>"]
|
|
6
6
|
license = "Apache License, Version 2.0"
|
|
@@ -23,19 +23,20 @@ classifiers = [
|
|
|
23
23
|
python = "^3.9"
|
|
24
24
|
deepdiff = "==6.7.1"
|
|
25
25
|
json-logging = "==1.3.0"
|
|
26
|
-
minio = "==7.2.
|
|
27
|
-
|
|
28
|
-
|
|
26
|
+
minio = "==7.2.10"
|
|
27
|
+
PyYAML = "==6.0.2"
|
|
28
|
+
pydantic = "==2.9.2"
|
|
29
|
+
redis = "==5.2.0"
|
|
29
30
|
requests = "==2.32.3"
|
|
30
|
-
urllib3 = "==2.2.
|
|
31
|
+
urllib3 = "==2.2.3"
|
|
31
32
|
|
|
32
33
|
[tool.poetry.group.test]
|
|
33
34
|
optional = true
|
|
34
35
|
|
|
35
36
|
[tool.poetry.group.test.dependencies]
|
|
36
|
-
pytest = "==8.3.
|
|
37
|
+
pytest = "==8.3.3"
|
|
37
38
|
pytest-mock = "==3.14.0"
|
|
38
|
-
mockito = "==1.5.
|
|
39
|
+
mockito = "==1.5.1"
|
|
39
40
|
|
|
40
41
|
[tool.poetry.urls]
|
|
41
42
|
'Source Code' = "https://gitlab.com/deltafi/deltafi"
|
|
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
|
{deltafi-2.0rc1730159244116 → deltafi-2.0rc1731040010625}/deltafi/test_kit/compare_helpers.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|