py2dag 0.1.14__tar.gz → 0.1.15__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.14
3
+ Version: 0.1.15
4
4
  Summary: Convert Python function plans to DAG (JSON, pseudo, optional SVG).
5
5
  License: MIT
6
6
  Author: rvergis
@@ -47,11 +47,16 @@ def parse(source: str, function_name: Optional[str] = None) -> Dict[str, Any]:
47
47
  settings: Dict[str, Any] = {}
48
48
 
49
49
  returned_var: Optional[str] = None
50
- # Treat function parameters as pre-defined names
50
+ # Enforce no-args top-level function signature
51
51
  try:
52
- for arg in getattr(fn, "args").args: # type: ignore[attr-defined]
53
- defined.add(arg.arg)
54
- except Exception:
52
+ fargs = getattr(fn, "args") # type: ignore[attr-defined]
53
+ has_params = bool(
54
+ getattr(fargs, "posonlyargs", []) or fargs.args or fargs.vararg or fargs.kwonlyargs or fargs.kwarg
55
+ )
56
+ if has_params:
57
+ raise DSLParseError("Top-level function must not accept parameters")
58
+ except AttributeError:
59
+ # If args not present, ignore
55
60
  pass
56
61
 
57
62
  def _collect_name_deps(node: ast.AST) -> List[str]:
@@ -4,7 +4,7 @@ build-backend = "poetry.core.masonry.api"
4
4
 
5
5
  [tool.poetry]
6
6
  name = "py2dag"
7
- version = "0.1.14"
7
+ version = "0.1.15"
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
File without changes