dyngle 0.1.0__py3-none-any.whl → 0.1.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.
Potentially problematic release.
This version of dyngle might be problematic. Click here for more details.
dyngle/command/run_command.py
CHANGED
|
@@ -19,24 +19,33 @@ class RunCommand(DyngleCommand):
|
|
|
19
19
|
if not self.provided('flow'):
|
|
20
20
|
self.flow = self.app.ui.get_input('Enter flow name: ')
|
|
21
21
|
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
flows = self.app.config.get('dyngle-flows')
|
|
25
|
-
|
|
22
|
+
def _validate_flow_exists(self, flows):
|
|
23
|
+
"""Validate that the requested flow exists in configuration"""
|
|
26
24
|
if not flows:
|
|
27
25
|
raise RuntimeError('No flows configured')
|
|
28
26
|
|
|
29
27
|
if self.flow not in flows:
|
|
30
|
-
|
|
28
|
+
available_flows = ', '.join(flows.keys())
|
|
29
|
+
raise RuntimeError(
|
|
30
|
+
f'Flow "{self.flow}" not found. " + \
|
|
31
|
+
f"Available flows: {available_flows}')
|
|
31
32
|
|
|
32
|
-
|
|
33
|
+
def _execute_task(self, task_str):
|
|
34
|
+
"""Execute a single task and handle errors"""
|
|
35
|
+
task_parts = task_str.split()
|
|
36
|
+
result = subprocess.run(task_parts)
|
|
33
37
|
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
result = subprocess.run(task_parts)
|
|
38
|
+
if result.returncode != 0:
|
|
39
|
+
raise RuntimeError(
|
|
40
|
+
f'Task failed with code {result.returncode}: {task_str}')
|
|
38
41
|
|
|
39
|
-
|
|
40
|
-
|
|
42
|
+
@DyngleCommand.wrap
|
|
43
|
+
def execute(self):
|
|
44
|
+
flows = self.app.config.get('dyngle-flows')
|
|
45
|
+
self._validate_flow_exists(flows)
|
|
46
|
+
|
|
47
|
+
tasks = flows[self.flow]
|
|
48
|
+
for task_str in tasks:
|
|
49
|
+
self._execute_task(task_str)
|
|
41
50
|
|
|
42
51
|
return f'Flow "{self.flow}" completed successfully'
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
Metadata-Version: 2.3
|
|
2
|
+
Name: dyngle
|
|
3
|
+
Version: 0.1.2
|
|
4
|
+
Summary: Run lightweight local workflows
|
|
5
|
+
License: MIT
|
|
6
|
+
Author: Steampunk Wizard
|
|
7
|
+
Author-email: dyngle@steamwiz.io
|
|
8
|
+
Requires-Python: >=3.11,<3.12
|
|
9
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
10
|
+
Classifier: Programming Language :: Python :: 3
|
|
11
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
12
|
+
Requires-Dist: requests (>=2.32.3,<3.0.0)
|
|
13
|
+
Requires-Dist: wizlib (>=3.1.4,<4.0.0)
|
|
14
|
+
Description-Content-Type: text/markdown
|
|
15
|
+
|
|
16
|
+
# Dyngle
|
|
17
|
+
|
|
18
|
+
## Run lightweight local workflows
|
|
19
|
+
|
|
20
|
+
Dyngle is a simple workflow runner that executes sequences of commands defined in configuration files. It's like a lightweight combination of Make and a task runner, designed for automating common development and operational tasks.
|
|
21
|
+
|
|
22
|
+
## Basic usage
|
|
23
|
+
|
|
24
|
+
Create a configuration file (e.g., `config.yml`) with your workflows:
|
|
25
|
+
|
|
26
|
+
```yaml
|
|
27
|
+
dyngle:
|
|
28
|
+
flows:
|
|
29
|
+
build:
|
|
30
|
+
- python -m pip install -e .
|
|
31
|
+
- python -m pytest
|
|
32
|
+
deploy:
|
|
33
|
+
- docker build -t myapp .
|
|
34
|
+
- docker push myapp
|
|
35
|
+
clean:
|
|
36
|
+
- rm -rf __pycache__
|
|
37
|
+
- rm -rf .pytest_cache
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
Run a workflow:
|
|
41
|
+
|
|
42
|
+
```bash
|
|
43
|
+
dyngle --config config.yml run build
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
## Configuration
|
|
47
|
+
|
|
48
|
+
Dyngle reads configuration from YAML files. You can specify the config file location using:
|
|
49
|
+
|
|
50
|
+
- `--config` command line option
|
|
51
|
+
- `DYNGLE_CONFIG` environment variable
|
|
52
|
+
- `.dyngle.yml` in current directory
|
|
53
|
+
- `~/.dyngle.yml` in home directory
|
|
54
|
+
|
|
55
|
+
## Workflow structure
|
|
56
|
+
|
|
57
|
+
Each workflow (called a "flow") is defined as a list of tasks under `dyngle.flows`. Tasks are executed sequentially using Python's subprocess module for security.
|
|
58
|
+
|
|
59
|
+
Example with multiple flows:
|
|
60
|
+
|
|
61
|
+
```yaml
|
|
62
|
+
dyngle:
|
|
63
|
+
flows:
|
|
64
|
+
test:
|
|
65
|
+
- python -m unittest discover
|
|
66
|
+
- python -m coverage report
|
|
67
|
+
docs:
|
|
68
|
+
- sphinx-build docs docs/_build
|
|
69
|
+
- open docs/_build/index.html
|
|
70
|
+
setup:
|
|
71
|
+
- python -m venv venv
|
|
72
|
+
- source venv/bin/activate
|
|
73
|
+
- pip install -r requirements.txt
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
## Security
|
|
77
|
+
|
|
78
|
+
Commands are executed using Python's `subprocess.run()` with arguments split by spaces. The shell is not used, preventing shell injection attacks.
|
|
79
|
+
|
|
80
|
+
## Quick installation (MacOS)
|
|
81
|
+
|
|
82
|
+
```bash
|
|
83
|
+
brew install python@3.11
|
|
84
|
+
python3.11 -m pip install pipx
|
|
85
|
+
pipx install kwark
|
|
86
|
+
```
|
|
87
|
+
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
dyngle/__init__.py,sha256=2KD52sWHfMhk1g1wxHdnxjRtEKeYNJn7sTPkKRpSqNA,338
|
|
2
|
+
dyngle/__main__.py,sha256=mXOQ5tiUi5mEfp1NG2viz5kW2DEeWg1oCPFhfXgxJ4U,92
|
|
3
|
+
dyngle/command/__init__.py,sha256=1S86gbef8MYvG-TWD5JRIWzFg7qV5xKhp9QXx9zEx5c,94
|
|
4
|
+
dyngle/command/run_command.py,sha256=89GMbVcjqLLTRLvF9fVr5ehzC-1aoznS-mN2L5zzpBk,1574
|
|
5
|
+
dyngle-0.1.2.dist-info/METADATA,sha256=up7gMCVwJPMWk7gYRQxcf5X9fROikh9OpIgY9XepT_4,2197
|
|
6
|
+
dyngle-0.1.2.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
|
|
7
|
+
dyngle-0.1.2.dist-info/entry_points.txt,sha256=rekiGhtweiHKm9g1jdGb3FhzqDrk1kigJDeSNollZSA,48
|
|
8
|
+
dyngle-0.1.2.dist-info/RECORD,,
|
dyngle-0.1.0.dist-info/METADATA
DELETED
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
Metadata-Version: 2.3
|
|
2
|
-
Name: dyngle
|
|
3
|
-
Version: 0.1.0
|
|
4
|
-
Summary: Template
|
|
5
|
-
License: MIT
|
|
6
|
-
Author: Steampunk Wizard
|
|
7
|
-
Author-email: dyngle@steamwiz.io
|
|
8
|
-
Requires-Python: >=3.11,<3.12
|
|
9
|
-
Classifier: License :: OSI Approved :: MIT License
|
|
10
|
-
Classifier: Programming Language :: Python :: 3
|
|
11
|
-
Classifier: Programming Language :: Python :: 3.11
|
|
12
|
-
Requires-Dist: requests (>=2.32.3,<3.0.0)
|
|
13
|
-
Requires-Dist: wizlib (>=3.1.4,<4.0.0)
|
|
14
|
-
Description-Content-Type: text/markdown
|
|
15
|
-
|
|
16
|
-
# Dyngle
|
|
17
|
-
|
|
18
|
-
## Run lightweight local workflows
|
|
19
|
-
|
|
20
|
-
Agentic coding rules and guidelines in `GUIDE` - browsable at https://gitlab.com/steamwiz/workshop/agentic
|
|
21
|
-
|
|
22
|
-
WizLib framework as git submodule at `REFERENCES/gitlab.com/steamwiz/wizlib` for reference with docs at `REFERENCES/gitlab.com/steamwiz/wizlib/docs` - browsable at https://wizlib.steamwiz.io
|
|
23
|
-
|
|
24
|
-
## Development setup
|
|
25
|
-
|
|
26
|
-
Requires Python 3.11.
|
|
27
|
-
|
|
28
|
-
The `Makefile` is designed for local development environment use (not for CI/CD).
|
|
29
|
-
|
|
30
|
-
- `make init` - Create the virtual environment and install poetry
|
|
31
|
-
- `make dependencies` - Install the required packages using poetry
|
|
32
|
-
- `make` - Perform the dull style check / test / coverage cycle same as in CI/CD
|
|
33
|
-
- `make build` - Create a test build
|
|
34
|
-
|
|
35
|
-
GitLab CI/CD performs the entire build/test/release cycle using ProCICD.
|
|
36
|
-
|
|
37
|
-
## References
|
|
38
|
-
|
|
39
|
-
The `REFERENCES` directory contains git submodules for use as read-only reference material from other projects. Refer to them as appropriate.
|
|
40
|
-
|
|
41
|
-
The table below contains only _examples_ of useful reference material. View direcory listings and README files to discern which specific files to read, whether documentation or code examples.
|
|
42
|
-
|
|
43
|
-
| Topic | Reference |
|
|
44
|
-
| --- | --- |
|
|
45
|
-
| Documentation for WizLib framework | `REFERENCES/gitlab.com/steamwiz/wizlib/docs` |
|
|
46
|
-
| Important testing techniques for WizLib-based applications | `REFERENCES/gitlab.com/steamwiz/wizlib/docs/testing.md` |
|
|
47
|
-
| WizLib framework code | `REFERENCES/gitlab.com/steamwiz/wizlib/wizlib` |
|
|
48
|
-
|
|
49
|
-
Note that this application makes heavy use of WizLib and all code changes are expected to comply with, and take advantage of, the framework.
|
|
50
|
-
|
|
51
|
-
|
dyngle-0.1.0.dist-info/RECORD
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
dyngle/__init__.py,sha256=2KD52sWHfMhk1g1wxHdnxjRtEKeYNJn7sTPkKRpSqNA,338
|
|
2
|
-
dyngle/__main__.py,sha256=mXOQ5tiUi5mEfp1NG2viz5kW2DEeWg1oCPFhfXgxJ4U,92
|
|
3
|
-
dyngle/command/__init__.py,sha256=1S86gbef8MYvG-TWD5JRIWzFg7qV5xKhp9QXx9zEx5c,94
|
|
4
|
-
dyngle/command/run_command.py,sha256=Nc0whPMfVQbB2YgL6UwSpxFLA94RQGd8nZ_0TMX6ldY,1182
|
|
5
|
-
dyngle-0.1.0.dist-info/METADATA,sha256=OqSBTC-420XLqHhkFlNHZegnPybiZxtudCoC6iDOjGs,2054
|
|
6
|
-
dyngle-0.1.0.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
|
|
7
|
-
dyngle-0.1.0.dist-info/RECORD,,
|
|
File without changes
|