dyngle 0.1.3__tar.gz → 0.2.0__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 dyngle might be problematic. Click here for more details.
- {dyngle-0.1.3 → dyngle-0.2.0}/PACKAGE.md +9 -9
- {dyngle-0.1.3 → dyngle-0.2.0}/PKG-INFO +10 -10
- {dyngle-0.1.3 → dyngle-0.2.0}/dyngle/command/run_command.py +12 -12
- {dyngle-0.1.3 → dyngle-0.2.0}/pyproject.toml +1 -1
- {dyngle-0.1.3 → dyngle-0.2.0}/dyngle/__init__.py +0 -0
- {dyngle-0.1.3 → dyngle-0.2.0}/dyngle/__main__.py +0 -0
- {dyngle-0.1.3 → dyngle-0.2.0}/dyngle/command/__init__.py +0 -0
|
@@ -6,11 +6,11 @@ Dyngle is a simple workflow runner that executes sequences of commands defined i
|
|
|
6
6
|
|
|
7
7
|
## Basic usage
|
|
8
8
|
|
|
9
|
-
Create a configuration file (e.g.,
|
|
9
|
+
Create a configuration file (e.g., `.dyngle.yml`) with your workflows:
|
|
10
10
|
|
|
11
11
|
```yaml
|
|
12
12
|
dyngle:
|
|
13
|
-
|
|
13
|
+
operations:
|
|
14
14
|
build:
|
|
15
15
|
- python -m pip install -e .
|
|
16
16
|
- python -m pytest
|
|
@@ -22,10 +22,10 @@ dyngle:
|
|
|
22
22
|
- rm -rf .pytest_cache
|
|
23
23
|
```
|
|
24
24
|
|
|
25
|
-
Run
|
|
25
|
+
Run an operation:
|
|
26
26
|
|
|
27
27
|
```bash
|
|
28
|
-
dyngle
|
|
28
|
+
dyngle run build
|
|
29
29
|
```
|
|
30
30
|
|
|
31
31
|
## Configuration
|
|
@@ -39,13 +39,13 @@ Dyngle reads configuration from YAML files. You can specify the config file loca
|
|
|
39
39
|
|
|
40
40
|
## Workflow structure
|
|
41
41
|
|
|
42
|
-
Each
|
|
42
|
+
Each operation is defined as a list of tasks under `dyngle.operations`. Tasks are executed sequentially using Python's subprocess module for security.
|
|
43
43
|
|
|
44
|
-
Example with multiple
|
|
44
|
+
Example with multiple operations:
|
|
45
45
|
|
|
46
46
|
```yaml
|
|
47
47
|
dyngle:
|
|
48
|
-
|
|
48
|
+
operations:
|
|
49
49
|
test:
|
|
50
50
|
- python -m unittest discover
|
|
51
51
|
- python -m coverage report
|
|
@@ -60,12 +60,12 @@ dyngle:
|
|
|
60
60
|
|
|
61
61
|
## Security
|
|
62
62
|
|
|
63
|
-
Commands are executed using Python's `subprocess.run()` with arguments split
|
|
63
|
+
Commands are executed using Python's `subprocess.run()` with arguments split in a shell-like fashion. The shell is not used, which reduces the likelihood of shell injection attacks. However, note that Dyngle is not robust to malicious configuration.
|
|
64
64
|
|
|
65
65
|
## Quick installation (MacOS)
|
|
66
66
|
|
|
67
67
|
```bash
|
|
68
68
|
brew install python@3.11
|
|
69
69
|
python3.11 -m pip install pipx
|
|
70
|
-
pipx install
|
|
70
|
+
pipx install dyngle
|
|
71
71
|
```
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.3
|
|
2
2
|
Name: dyngle
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.2.0
|
|
4
4
|
Summary: Run lightweight local workflows
|
|
5
5
|
License: MIT
|
|
6
6
|
Author: Steampunk Wizard
|
|
@@ -21,11 +21,11 @@ Dyngle is a simple workflow runner that executes sequences of commands defined i
|
|
|
21
21
|
|
|
22
22
|
## Basic usage
|
|
23
23
|
|
|
24
|
-
Create a configuration file (e.g.,
|
|
24
|
+
Create a configuration file (e.g., `.dyngle.yml`) with your workflows:
|
|
25
25
|
|
|
26
26
|
```yaml
|
|
27
27
|
dyngle:
|
|
28
|
-
|
|
28
|
+
operations:
|
|
29
29
|
build:
|
|
30
30
|
- python -m pip install -e .
|
|
31
31
|
- python -m pytest
|
|
@@ -37,10 +37,10 @@ dyngle:
|
|
|
37
37
|
- rm -rf .pytest_cache
|
|
38
38
|
```
|
|
39
39
|
|
|
40
|
-
Run
|
|
40
|
+
Run an operation:
|
|
41
41
|
|
|
42
42
|
```bash
|
|
43
|
-
dyngle
|
|
43
|
+
dyngle run build
|
|
44
44
|
```
|
|
45
45
|
|
|
46
46
|
## Configuration
|
|
@@ -54,13 +54,13 @@ Dyngle reads configuration from YAML files. You can specify the config file loca
|
|
|
54
54
|
|
|
55
55
|
## Workflow structure
|
|
56
56
|
|
|
57
|
-
Each
|
|
57
|
+
Each operation is defined as a list of tasks under `dyngle.operations`. Tasks are executed sequentially using Python's subprocess module for security.
|
|
58
58
|
|
|
59
|
-
Example with multiple
|
|
59
|
+
Example with multiple operations:
|
|
60
60
|
|
|
61
61
|
```yaml
|
|
62
62
|
dyngle:
|
|
63
|
-
|
|
63
|
+
operations:
|
|
64
64
|
test:
|
|
65
65
|
- python -m unittest discover
|
|
66
66
|
- python -m coverage report
|
|
@@ -75,13 +75,13 @@ dyngle:
|
|
|
75
75
|
|
|
76
76
|
## Security
|
|
77
77
|
|
|
78
|
-
Commands are executed using Python's `subprocess.run()` with arguments split
|
|
78
|
+
Commands are executed using Python's `subprocess.run()` with arguments split in a shell-like fashion. The shell is not used, which reduces the likelihood of shell injection attacks. However, note that Dyngle is not robust to malicious configuration.
|
|
79
79
|
|
|
80
80
|
## Quick installation (MacOS)
|
|
81
81
|
|
|
82
82
|
```bash
|
|
83
83
|
brew install python@3.11
|
|
84
84
|
python3.11 -m pip install pipx
|
|
85
|
-
pipx install
|
|
85
|
+
pipx install dyngle
|
|
86
86
|
```
|
|
87
87
|
|
|
@@ -13,23 +13,23 @@ class RunCommand(DyngleCommand):
|
|
|
13
13
|
@classmethod
|
|
14
14
|
def add_args(cls, parser: WizParser):
|
|
15
15
|
super().add_args(parser)
|
|
16
|
-
parser.add_argument('flow', help='
|
|
16
|
+
parser.add_argument('flow', help='Operation name to run')
|
|
17
17
|
|
|
18
18
|
def handle_vals(self):
|
|
19
19
|
super().handle_vals()
|
|
20
20
|
if not self.provided('flow'):
|
|
21
21
|
self.flow = self.app.ui.get_input('Enter flow name: ')
|
|
22
22
|
|
|
23
|
-
def _validate_flow_exists(self,
|
|
23
|
+
def _validate_flow_exists(self, operations):
|
|
24
24
|
"""Validate that the requested flow exists in configuration"""
|
|
25
|
-
if not
|
|
26
|
-
raise RuntimeError('No
|
|
25
|
+
if not operations:
|
|
26
|
+
raise RuntimeError('No operations configured')
|
|
27
27
|
|
|
28
|
-
if self.flow not in
|
|
29
|
-
|
|
28
|
+
if self.flow not in operations:
|
|
29
|
+
available_operations = ', '.join(operations.keys())
|
|
30
30
|
raise RuntimeError(
|
|
31
|
-
f'
|
|
32
|
-
f"Available
|
|
31
|
+
f'Operation "{self.flow}" not found. " + \
|
|
32
|
+
f"Available operations: {available_operations}')
|
|
33
33
|
|
|
34
34
|
def _execute_task(self, task_str):
|
|
35
35
|
"""Execute a single task and handle errors"""
|
|
@@ -42,11 +42,11 @@ class RunCommand(DyngleCommand):
|
|
|
42
42
|
|
|
43
43
|
@DyngleCommand.wrap
|
|
44
44
|
def execute(self):
|
|
45
|
-
|
|
46
|
-
self._validate_flow_exists(
|
|
45
|
+
operations = self.app.config.get('dyngle-operations')
|
|
46
|
+
self._validate_flow_exists(operations)
|
|
47
47
|
|
|
48
|
-
tasks =
|
|
48
|
+
tasks = operations[self.flow]
|
|
49
49
|
for task_str in tasks:
|
|
50
50
|
self._execute_task(task_str)
|
|
51
51
|
|
|
52
|
-
return f'
|
|
52
|
+
return f'Operation "{self.flow}" completed successfully'
|
|
File without changes
|
|
File without changes
|
|
File without changes
|