py2dag 0.1.7__tar.gz → 0.1.9__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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: py2dag
3
- Version: 0.1.7
3
+ Version: 0.1.9
4
4
  Summary: Convert Python function plans to DAG (JSON, pseudo, optional SVG).
5
5
  License: MIT
6
6
  Author: rvergis
@@ -117,7 +117,7 @@ This repo includes a GitHub Actions workflow that publishes to PyPI when you pus
117
117
 
118
118
  ```
119
119
  make patch # bumps version, commits, and tags vX.Y.Z
120
- make release # pushes tags to GitHub (triggers publish)
120
+ make release # pushes commits and tags to GitHub (triggers publish)
121
121
  ```
122
122
 
123
123
  Or push tags manually:
@@ -98,7 +98,7 @@ This repo includes a GitHub Actions workflow that publishes to PyPI when you pus
98
98
 
99
99
  ```
100
100
  make patch # bumps version, commits, and tags vX.Y.Z
101
- make release # pushes tags to GitHub (triggers publish)
101
+ make release # pushes commits and tags to GitHub (triggers publish)
102
102
  ```
103
103
 
104
104
  Or push tags manually:
@@ -101,6 +101,15 @@ def parse(source: str, function_name: Optional[str] = None) -> Dict[str, Any]:
101
101
  "deps": deps,
102
102
  "args": {"template": template},
103
103
  })
104
+ elif isinstance(value, (ast.Constant, ast.List, ast.Tuple, ast.Dict)):
105
+ # Allow assigning JSON-serialisable literals directly
106
+ lit = _literal(value)
107
+ ops.append({
108
+ "id": var_name,
109
+ "op": "CONST.value",
110
+ "deps": [],
111
+ "args": {"value": lit},
112
+ })
104
113
  else:
105
114
  raise DSLParseError("Right hand side must be a call or f-string")
106
115
  defined.add(var_name)
@@ -144,9 +153,9 @@ def parse(source: str, function_name: Optional[str] = None) -> Dict[str, Any]:
144
153
  if var not in defined:
145
154
  raise DSLParseError(f"Undefined return variable: {var}")
146
155
  returned_var = var
147
- elif isinstance(stmt.value, ast.Constant):
148
- # Support returning a literal (e.g., "DONE"): synthesize a const op
149
- lit = stmt.value.value
156
+ elif isinstance(stmt.value, (ast.Constant, ast.List, ast.Tuple, ast.Dict)):
157
+ # Support returning a JSON-serialisable literal (str/num/bool/None, list/tuple, dict)
158
+ lit = _literal(stmt.value)
150
159
  const_id_base = "return_value"
151
160
  const_id = const_id_base
152
161
  n = 1
@@ -4,7 +4,7 @@ build-backend = "poetry.core.masonry.api"
4
4
 
5
5
  [tool.poetry]
6
6
  name = "py2dag"
7
- version = "0.1.7"
7
+ version = "0.1.9"
8
8
  description = "Convert Python function plans to DAG (JSON, pseudo, optional SVG)."
9
9
  authors = ["rvergis"]
10
10
  license = "MIT"
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes