buildzr 0.0.3__py3-none-any.whl → 0.0.4__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.
- buildzr/__about__.py +1 -1
- buildzr/dsl/interfaces/interfaces.py +8 -3
- buildzr/dsl/relations.py +49 -10
- {buildzr-0.0.3.dist-info → buildzr-0.0.4.dist-info}/METADATA +1 -1
- {buildzr-0.0.3.dist-info → buildzr-0.0.4.dist-info}/RECORD +7 -7
- {buildzr-0.0.3.dist-info → buildzr-0.0.4.dist-info}/WHEEL +0 -0
- {buildzr-0.0.3.dist-info → buildzr-0.0.4.dist-info}/licenses/LICENSE.md +0 -0
buildzr/__about__.py
CHANGED
@@ -1 +1 @@
|
|
1
|
-
VERSION = "0.0.
|
1
|
+
VERSION = "0.0.4"
|
@@ -52,6 +52,11 @@ class BindLeft(ABC, Generic[TSrc, TDst]):
|
|
52
52
|
|
53
53
|
class BindRight(ABC, Generic[TSrc, TDst]):
|
54
54
|
|
55
|
+
@overload
|
56
|
+
@abstractmethod
|
57
|
+
def __rshift__(self, other: TDst) -> 'DslRelationship[TSrc, TDst]':
|
58
|
+
...
|
59
|
+
|
55
60
|
@overload
|
56
61
|
@abstractmethod
|
57
62
|
def __rshift__(self, description_and_technology: Tuple[str, str]) -> BindLeft[TSrc, TDst]:
|
@@ -64,11 +69,11 @@ class BindRight(ABC, Generic[TSrc, TDst]):
|
|
64
69
|
|
65
70
|
@overload
|
66
71
|
@abstractmethod
|
67
|
-
def __rshift__(self, multiple_destinations: List[BindLeftLate[TDst]]) -> 'List[DslRelationship[TSrc, TDst]]':
|
72
|
+
def __rshift__(self, multiple_destinations: List[Union[TDst, BindLeftLate[TDst]]]) -> 'List[DslRelationship[TSrc, TDst]]':
|
68
73
|
...
|
69
74
|
|
70
75
|
@abstractmethod
|
71
|
-
def __rshift__(self, other: Union[str, Tuple[str, str], List[BindLeftLate[TDst]]]) -> Union[BindLeft[TSrc, TDst], 'List[DslRelationship[TSrc, TDst]]']:
|
76
|
+
def __rshift__(self, other: Union[TDst, str, Tuple[str, str], List[Union[TDst, BindLeftLate[TDst]]]]) -> Union[BindLeft[TSrc, TDst], 'DslRelationship[TSrc, TDst]', 'List[DslRelationship[TSrc, TDst]]']:
|
72
77
|
...
|
73
78
|
|
74
79
|
class DslWorkspaceElement(ABC):
|
@@ -204,4 +209,4 @@ class DslViewsElement(ABC):
|
|
204
209
|
@property
|
205
210
|
@abstractmethod
|
206
211
|
def parent(self) -> DslWorkspaceElement:
|
207
|
-
pass
|
212
|
+
pass
|
buildzr/dsl/relations.py
CHANGED
@@ -37,6 +37,14 @@ def _is_container_fluent_relationship(
|
|
37
37
|
) -> TypeIs['_FluentRelationship[buildzr.dsl.Container]']:
|
38
38
|
return isinstance(obj._parent, buildzr.dsl.Container)
|
39
39
|
|
40
|
+
def _is_list_of_dslelements_or_usesfromlates(
|
41
|
+
obj: list
|
42
|
+
) -> TypeIs[List[Union[DslElement, '_UsesFromLate[DslElement]']]]:
|
43
|
+
return all(
|
44
|
+
isinstance(item, DslElement) or isinstance(item, _UsesFromLate)
|
45
|
+
for item in obj
|
46
|
+
)
|
47
|
+
|
40
48
|
@dataclass
|
41
49
|
class With:
|
42
50
|
tags: Optional[Set[str]] = None
|
@@ -306,7 +314,18 @@ class DslElementRelationOverrides(DslElement):
|
|
306
314
|
elements.
|
307
315
|
"""
|
308
316
|
|
309
|
-
|
317
|
+
# TODO: Check why need to ignore the override error here.
|
318
|
+
@overload # type: ignore[override]
|
319
|
+
def __rshift__(self, other: DslElement) -> _Relationship[Self, DslElement]:
|
320
|
+
"""
|
321
|
+
Create a relationship between the source element and the destination
|
322
|
+
without specifying description or technology.
|
323
|
+
|
324
|
+
Example: `source >> destination`.
|
325
|
+
"""
|
326
|
+
...
|
327
|
+
|
328
|
+
@overload
|
310
329
|
def __rshift__(self, description_and_technology: Tuple[str, str]) -> _UsesFrom[Self, DslElement]:
|
311
330
|
...
|
312
331
|
|
@@ -319,29 +338,49 @@ class DslElementRelationOverrides(DslElement):
|
|
319
338
|
...
|
320
339
|
|
321
340
|
@overload
|
322
|
-
def __rshift__(self, multiple_destinations: List[_UsesFromLate[DslElement]]) -> List[_Relationship[Self, DslElement]]:
|
341
|
+
def __rshift__(self, multiple_destinations: List[Union[DslElement, _UsesFromLate[DslElement]]]) -> List[_Relationship[Self, DslElement]]:
|
323
342
|
...
|
324
343
|
|
325
344
|
def __rshift__(
|
326
345
|
self,
|
327
346
|
other: Union[
|
347
|
+
DslElement,
|
328
348
|
str,
|
329
349
|
Tuple[str, str],
|
330
350
|
_RelationshipDescription[DslElement],
|
331
|
-
List[_UsesFromLate[DslElement]]
|
332
|
-
]) -> Union[_UsesFrom[Self, DslElement], List[_Relationship[Self, DslElement]]]:
|
333
|
-
if isinstance(other,
|
351
|
+
List[Union[DslElement, _UsesFromLate[DslElement]]]
|
352
|
+
]) -> Union[_UsesFrom[Self, DslElement], _Relationship[Self, DslElement], List[_Relationship[Self, DslElement]]]:
|
353
|
+
if isinstance(other, DslElement):
|
354
|
+
return cast(
|
355
|
+
_Relationship[Self, DslElement],
|
356
|
+
cast(
|
357
|
+
_UsesFrom[Self, DslElement],
|
358
|
+
_UsesFrom(self)
|
359
|
+
) >> other
|
360
|
+
)
|
361
|
+
elif isinstance(other, str):
|
334
362
|
return _UsesFrom(self, other)
|
335
363
|
elif isinstance(other, tuple):
|
336
364
|
return _UsesFrom(self, description=other[0], technology=other[1])
|
337
365
|
elif isinstance(other, _RelationshipDescription):
|
338
366
|
return _UsesFrom(self, description=other._description, technology=other._technology)
|
339
|
-
elif
|
340
|
-
relationships = []
|
367
|
+
elif _is_list_of_dslelements_or_usesfromlates(other):
|
368
|
+
relationships: List[_Relationship[Self, DslElement]] = []
|
341
369
|
for dest in other:
|
342
|
-
dest
|
343
|
-
|
344
|
-
|
370
|
+
if isinstance(dest, _UsesFromLate):
|
371
|
+
dest.set_source(self)
|
372
|
+
relationships.append(dest.get_relationship())
|
373
|
+
elif isinstance(dest, DslElement):
|
374
|
+
relationships.append(
|
375
|
+
cast(
|
376
|
+
_Relationship[Self, DslElement],
|
377
|
+
cast(
|
378
|
+
_UsesFrom[Self, DslElement],
|
379
|
+
_UsesFrom(self)
|
380
|
+
) >> dest
|
381
|
+
)
|
382
|
+
)
|
383
|
+
return relationships
|
345
384
|
else:
|
346
385
|
raise TypeError(f"Unsupported operand type for >>: '{type(self).__name__}' and {type(other).__name__}")
|
347
386
|
|
@@ -1,20 +1,20 @@
|
|
1
|
-
buildzr/__about__.py,sha256=
|
1
|
+
buildzr/__about__.py,sha256=I8MhjlcOy2J8UobS5EDhsxMNKaZY5HwrasTSNMRQlvI,17
|
2
2
|
buildzr/__init__.py,sha256=hY-cOdjBQcz0v2m8cBF1oEJFIbcR3sWI-xww--0RKSo,99
|
3
3
|
buildzr/dsl/__init__.py,sha256=paxuMCCDuOs1eSvBPyuW5pv5j1UZD6TxRZcCzC2iKss,307
|
4
4
|
buildzr/dsl/dsl.py,sha256=X5lJJhD9dQ7YlRAECdXJb9qJKWfrfi-1H5rESYOnGhI,34584
|
5
5
|
buildzr/dsl/explorer.py,sha256=numMPqD3RYJ1oeMgX5wYnT6aHRHmBN2EsFZFYRuFffA,2523
|
6
6
|
buildzr/dsl/expression.py,sha256=UinOUL3nJytZR8ylnVtVkJ0YoWoWspU9DQeDpg0nIEQ,6927
|
7
|
-
buildzr/dsl/relations.py,sha256=
|
7
|
+
buildzr/dsl/relations.py,sha256=nfj0EZIo0RpQxe7Ng-40WHBOVom_aE20-45GzWMEvII,13723
|
8
8
|
buildzr/dsl/factory/__init__.py,sha256=niaYqvNPUWJejoPyRyABUtzVsoxaV8eSjzS9dta4bMI,30
|
9
9
|
buildzr/dsl/factory/gen_id.py,sha256=LnaeOCMngSvYkcGnuARjQYoUVWdcOoNHO2EHe6PMGco,538
|
10
10
|
buildzr/dsl/interfaces/__init__.py,sha256=T0Az1IDLsTUYHoaGBStbS5V-acaJAlFUpDo-6Q0MrOY,229
|
11
|
-
buildzr/dsl/interfaces/interfaces.py,sha256=
|
11
|
+
buildzr/dsl/interfaces/interfaces.py,sha256=aQQEttOF4cYCBR9axLIFu8PD4NqWB-Izdchpf8X4AkQ,5138
|
12
12
|
buildzr/encoders/__init__.py,sha256=suID63Ay-023T0uKD25EAoGYmAMTa9AKxIjioccpiPM,32
|
13
13
|
buildzr/encoders/encoder.py,sha256=9_FlQ3aYvz0EcN_G9A3bPdqxCTkLhc2OrYXSYti95f8,2237
|
14
14
|
buildzr/models/__init__.py,sha256=SRfF7oDVlOOAi6nGKiJIUK6B_arqYLO9iSMp-2IZZps,21
|
15
15
|
buildzr/models/generate.sh,sha256=924UoEXr5WBZ926TZfRgEQGHwBqtLGU5k0G2UfExLEg,1061
|
16
16
|
buildzr/models/models.py,sha256=0LhLG1wmbt4dvROV5MEBZLLoxPbMpkUsOqNz525cynE,42489
|
17
|
-
buildzr-0.0.
|
18
|
-
buildzr-0.0.
|
19
|
-
buildzr-0.0.
|
20
|
-
buildzr-0.0.
|
17
|
+
buildzr-0.0.4.dist-info/METADATA,sha256=X37enZV5_JEQM7OjayekT5mmW7peWHuZrn5jEy2Mzxw,6255
|
18
|
+
buildzr-0.0.4.dist-info/WHEEL,sha256=1yFddiXMmvYK7QYTqtRNtX66WJ0Mz8PYEiEUoOUUxRY,87
|
19
|
+
buildzr-0.0.4.dist-info/licenses/LICENSE.md,sha256=e8e6W6tL4MbBY-c-gXMgDbaMf_BnaQDQv4Yoy42b-CI,1070
|
20
|
+
buildzr-0.0.4.dist-info/RECORD,,
|
File without changes
|
File without changes
|