xstack 2.0.2__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.
- xstack/__init__.py +167 -0
- xstack/address.py +137 -0
- xstack/app/__init__.py +36 -0
- xstack/app/__main__.py +5 -0
- xstack/app/application.py +692 -0
- xstack/app/config.py +139 -0
- xstack/app/delegate.py +292 -0
- xstack/app/demo.py +42 -0
- xstack/app/dialogs.py +492 -0
- xstack/app/log_view.py +632 -0
- xstack/app/menu.py +362 -0
- xstack/app/options.py +664 -0
- xstack/app/resources.py +20 -0
- xstack/app/runner.py +35 -0
- xstack/app/settings.py +89 -0
- xstack/app/tree.py +582 -0
- xstack/attributes.py +212 -0
- xstack/compat.py +96 -0
- xstack/component.py +1175 -0
- xstack/constants.py +16 -0
- xstack/stack.py +1078 -0
- xstack/test/__init__.py +0 -0
- xstack/test/components.py +360 -0
- xstack/test/test_stack.py +1314 -0
- xstack-2.0.2.dist-info/METADATA +162 -0
- xstack-2.0.2.dist-info/RECORD +29 -0
- xstack-2.0.2.dist-info/WHEEL +5 -0
- xstack-2.0.2.dist-info/licenses/LICENSE +21 -0
- xstack-2.0.2.dist-info/top_level.txt +1 -0
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: xstack
|
|
3
|
+
Version: 2.0.2
|
|
4
|
+
Summary: xstack is an execution framework
|
|
5
|
+
Home-page: https://github.com/mikemalinowski/xstack
|
|
6
|
+
Author: Mike Malinowski
|
|
7
|
+
Author-email: mike.external@outlook.com
|
|
8
|
+
Keywords: xstack
|
|
9
|
+
Classifier: Programming Language :: Python
|
|
10
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
11
|
+
Classifier: Operating System :: OS Independent
|
|
12
|
+
Description-Content-Type: text/markdown
|
|
13
|
+
License-File: LICENSE
|
|
14
|
+
Requires-Dist: factories
|
|
15
|
+
Requires-Dist: signalling
|
|
16
|
+
Dynamic: author
|
|
17
|
+
Dynamic: author-email
|
|
18
|
+
Dynamic: classifier
|
|
19
|
+
Dynamic: description
|
|
20
|
+
Dynamic: description-content-type
|
|
21
|
+
Dynamic: home-page
|
|
22
|
+
Dynamic: keywords
|
|
23
|
+
Dynamic: license-file
|
|
24
|
+
Dynamic: requires-dist
|
|
25
|
+
Dynamic: summary
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
# xstack
|
|
29
|
+
|
|
30
|
+
xstack is an execution framework which allows a developer to define components which
|
|
31
|
+
can then be added to the stack - declaring options, requirements and outputs.
|
|
32
|
+
|
|
33
|
+

|
|
34
|
+
|
|
35
|
+
## Installing
|
|
36
|
+
|
|
37
|
+
You can install xstack using `pip install xstack`
|
|
38
|
+
|
|
39
|
+
## Getting Started
|
|
40
|
+
|
|
41
|
+
The stack can be executed to run sequentially from top to bottom, from a specific
|
|
42
|
+
point, to a specific point or individiaully.
|
|
43
|
+
|
|
44
|
+
Below is an example of what it looks like to add components to the stack, manipulate
|
|
45
|
+
the build order and execute a stack
|
|
46
|
+
|
|
47
|
+
```python
|
|
48
|
+
import xstack
|
|
49
|
+
|
|
50
|
+
COMPONENT_PATH = "location/to/where/you/store/your/components"
|
|
51
|
+
|
|
52
|
+
# -- Create a new stack. When we create a stack we need to tell it where
|
|
53
|
+
# -- to look for components
|
|
54
|
+
stack = xstack.Stack(
|
|
55
|
+
component_paths=[COMPONENT_PATH],
|
|
56
|
+
)
|
|
57
|
+
|
|
58
|
+
# -- Add a component of type "RunTestComponent" into the stack. Note that you
|
|
59
|
+
# -- can see this component within the /test directory of xstack
|
|
60
|
+
component_a = stack.add_component(
|
|
61
|
+
label="test a",
|
|
62
|
+
component_type="RunTestComponent",
|
|
63
|
+
)
|
|
64
|
+
|
|
65
|
+
# -- Add the same component type again.
|
|
66
|
+
component_b = stack.add_component(
|
|
67
|
+
label="test b",
|
|
68
|
+
component_type="RunTestComponent",
|
|
69
|
+
)
|
|
70
|
+
|
|
71
|
+
# -- Our stack now has two components in it, by default these will be in
|
|
72
|
+
# -- a flat list and ordered based on the order they were added. Here we will
|
|
73
|
+
# -- make component_a a child of component_b - meaning that component_a will
|
|
74
|
+
# -- always execute after component_b
|
|
75
|
+
stack.set_build_position(
|
|
76
|
+
component_a,
|
|
77
|
+
parent=component_b,
|
|
78
|
+
)
|
|
79
|
+
|
|
80
|
+
# -- Execute the whole stack
|
|
81
|
+
stack.build()
|
|
82
|
+
|
|
83
|
+
# -- Execute just a single component
|
|
84
|
+
stack.build(build_only=component_a)
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
Defining a component is relatively simple...
|
|
88
|
+
|
|
89
|
+
```python
|
|
90
|
+
import xstack
|
|
91
|
+
|
|
92
|
+
class MyXStackComponent(xstack.Component):
|
|
93
|
+
|
|
94
|
+
# -- Every component needs an identifier which can be used to differentiate
|
|
95
|
+
# -- it from other components
|
|
96
|
+
identifier = "MyExample"
|
|
97
|
+
|
|
98
|
+
def __init__(self, *args, **kwargs):
|
|
99
|
+
super(MyXStackComponent, self).__init__(*args, **kwargs)
|
|
100
|
+
|
|
101
|
+
# -- Declare a requirement. A Requirement is an attribute of a component
|
|
102
|
+
# -- that typically expects to be filled before execution. By default
|
|
103
|
+
# -- all requirements will be validated for a value before executing.
|
|
104
|
+
self.declare_requirement(
|
|
105
|
+
name="example_requirement",
|
|
106
|
+
value="",
|
|
107
|
+
group="Some Requirements",
|
|
108
|
+
)
|
|
109
|
+
|
|
110
|
+
# -- Options are considered to be attributes which are not essential to
|
|
111
|
+
# -- be set but might tailor or alter what the result is
|
|
112
|
+
self.declare_option(
|
|
113
|
+
name="test_option",
|
|
114
|
+
value="foo",
|
|
115
|
+
pre_expose=True,
|
|
116
|
+
)
|
|
117
|
+
|
|
118
|
+
# -- An output is an attribute which this component promises to fullful
|
|
119
|
+
# -- during the execution. This is useful because instead of specifying a
|
|
120
|
+
# -- value to a requirement, you can infact specify an output attribute
|
|
121
|
+
# -- address, and the value will be resolved at execution time.
|
|
122
|
+
self.declare_output(
|
|
123
|
+
name="result"
|
|
124
|
+
)
|
|
125
|
+
|
|
126
|
+
# -- This function is where we write any code that should be run during the
|
|
127
|
+
# -- stack execution
|
|
128
|
+
def run(self):
|
|
129
|
+
return self.option("test_option").get() == "bar"
|
|
130
|
+
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
# App
|
|
134
|
+
|
|
135
|
+
This is a Qt based application/widget which is designed to visualise an xstack stack.
|
|
136
|
+
|
|
137
|
+
The app is not a requirement for using xstack, but can be used as a front end to build
|
|
138
|
+
and execute stacks.
|
|
139
|
+
|
|
140
|
+

|
|
141
|
+
|
|
142
|
+
## Installing
|
|
143
|
+
|
|
144
|
+
You can install the xstack_app using `pip install xstack_app`
|
|
145
|
+
|
|
146
|
+
Note: This requires either PySide2 or PySide6 to also be available.
|
|
147
|
+
|
|
148
|
+
## Running
|
|
149
|
+
|
|
150
|
+
```python
|
|
151
|
+
import xstack
|
|
152
|
+
|
|
153
|
+
xstack.launch(blocking=True)
|
|
154
|
+
```
|
|
155
|
+
|
|
156
|
+
If you want to run it with some example components, you can run:
|
|
157
|
+
|
|
158
|
+
```python
|
|
159
|
+
import xstack
|
|
160
|
+
|
|
161
|
+
xstack.launch_demo(blocking=True)
|
|
162
|
+
```
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
xstack/__init__.py,sha256=NgtRNvaJTPvFkuj3tRR7I0hFJdr9PxamZZSOjS9TC0Y,5524
|
|
2
|
+
xstack/address.py,sha256=1cZiDi3z3oKL1vqw-u0LohHfnpLnivpmSfFsMS8DVuY,3736
|
|
3
|
+
xstack/attributes.py,sha256=NyvODwiZUy5mvvEaqqnrSA-8DD5V7USdJTcXQ5nX0JI,7347
|
|
4
|
+
xstack/compat.py,sha256=N6xqmqMpDeDcget0M2M4hmQSCnbunRal3PSTE9RGWA4,2930
|
|
5
|
+
xstack/component.py,sha256=Qq0P2Or86cVvfQ4lmDCpO-3selXJ3TgZaL5cFJPQb5c,43179
|
|
6
|
+
xstack/constants.py,sha256=Z6WhSqHYdQYF82TQPMwmZf4V-n5OB48RFwPfyM-5Yss,511
|
|
7
|
+
xstack/stack.py,sha256=uA-U61YGyuw7WBSKfAG3LAkGYCBjH0JBql16UAEN9pc,40769
|
|
8
|
+
xstack/app/__init__.py,sha256=y2mz-cx_NTzjlwfFkpYxjJSs03i_4ZMzH23nJllRo-Y,1109
|
|
9
|
+
xstack/app/__main__.py,sha256=GAnSwV8LBfj1lZeUtIrmrJKDLa8577SKDPkVKTHWjLk,68
|
|
10
|
+
xstack/app/application.py,sha256=Hlb4Bh2VhdDQVtXmo0Hzctm-IO6M0oVEta0Lljhi4cE,23921
|
|
11
|
+
xstack/app/config.py,sha256=SBpeb6nxEh6r3IJKVUkfiIe-QxzzNyrvmu43LAimbOM,5185
|
|
12
|
+
xstack/app/delegate.py,sha256=B1toDxg3ybL5mZd7w97AxNZAsO9aW8gmO6TeqeJRuDU,9838
|
|
13
|
+
xstack/app/demo.py,sha256=VgZYbLqgSsGeTd253eBVntlluzAThDZzIU6o8ZQSb_U,1088
|
|
14
|
+
xstack/app/dialogs.py,sha256=7UMgn79dxcg--2GqvNW6a1J2d1PQ1ALmedb8OKwNDnU,17995
|
|
15
|
+
xstack/app/log_view.py,sha256=fREXYAzs68FDVZAFyBY_4oGrBiZxAWhojou1asOl4fU,24299
|
|
16
|
+
xstack/app/menu.py,sha256=atsC_zordowZTbUMs0DWHv9GRQhLGkAJ-Y0ipg1_58U,12637
|
|
17
|
+
xstack/app/options.py,sha256=ed9nW0qvzkCCcBs9gwuSuJelt3PZJcyz4wCVmK7iJQA,22645
|
|
18
|
+
xstack/app/resources.py,sha256=egA_gTZ9O16YHBokvb47_0f_TILkJFtcgXEEjY3hNPo,390
|
|
19
|
+
xstack/app/runner.py,sha256=D43RKy_-F9uh04xLooEw-RJHK_aGL-J7fQ9a3DirOzA,1141
|
|
20
|
+
xstack/app/settings.py,sha256=I7wniWhBaLnJdcw_D9GY0QhmwsGm1qXuNYvvn7nVigE,2703
|
|
21
|
+
xstack/app/tree.py,sha256=QJEtf85xS5lmMW0FFGxkah6EWTyoT4WKR0vFG4O29ZE,19453
|
|
22
|
+
xstack/test/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
23
|
+
xstack/test/components.py,sha256=19CkFOCFG-cdd4uCzIgsfSuGmaEqQY73jIfLNQqXW0w,9042
|
|
24
|
+
xstack/test/test_stack.py,sha256=nX2C5rHFovfUdJSxqIRQvEJNCEXT9rbwodtICsaMO14,46606
|
|
25
|
+
xstack-2.0.2.dist-info/licenses/LICENSE,sha256=BwpYj4Z6i7HuZ-xANN6iSj9WLeh9OSir2QH-XcoBYbE,1095
|
|
26
|
+
xstack-2.0.2.dist-info/METADATA,sha256=aS5hGHCeZfJow4zKvwU-0xSV2H4UHZYQ10Xi3k9p-fU,4725
|
|
27
|
+
xstack-2.0.2.dist-info/WHEEL,sha256=mOdXR9C3wMVov7cSY8PY-XCzo3SmmWCHvGQr5csJoao,91
|
|
28
|
+
xstack-2.0.2.dist-info/top_level.txt,sha256=7Gyb_5gqWscRIGTNIJIRTFZzHynfD6zWKNvj1rj6xO4,7
|
|
29
|
+
xstack-2.0.2.dist-info/RECORD,,
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2024 Michael Malinowski
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
xstack
|