Skip to content
Snippets Groups Projects
Commit 5431294a authored by Simon Bjurek's avatar Simon Bjurek
Browse files

Fixes to make pipeline pass for python 3.13

parent 13720232
No related branches found
No related tags found
1 merge request!465Fixes to make pipeline pass for python 3.13
Pipeline #155758 passed
...@@ -71,6 +71,18 @@ run-test-3.12-pyside6: ...@@ -71,6 +71,18 @@ run-test-3.12-pyside6:
image: python:3.12 image: python:3.12
extends: ".run-test" extends: ".run-test"
run-test-3.13-pyqt6:
variables:
QT_API: pyqt6
image: python:3.13
extends: ".run-test"
run-test-3.13-pyside6:
variables:
QT_API: pyside6
image: python:3.13
extends: ".run-test"
run-vhdl-tests: run-vhdl-tests:
variables: variables:
QT_API: pyqt6 QT_API: pyqt6
......
...@@ -150,18 +150,28 @@ def python_to_sfg(path: str) -> Tuple[SFG, Dict[str, Tuple[int, int]]]: ...@@ -150,18 +150,28 @@ def python_to_sfg(path: str) -> Tuple[SFG, Dict[str, Tuple[int, int]]]:
path : str path : str
Path to file to read and deserialize. Path to file to read and deserialize.
""" """
local_vars = {}
with open(path) as file: with open(path) as file:
code = compile(file.read(), path, "exec") code = compile(file.read(), path, "exec")
exec(code, globals(), locals()) exec(code, globals(), local_vars)
return ( # access variables from local_vars
( sfg_object = None
locals()["prop"]["name"] if "prop" in local_vars and "name" in local_vars["prop"]:
if "prop" in locals() sfg_object = local_vars["prop"]["name"]
else [v for k, v in locals().items() if isinstance(v, SFG)][0] else:
), for v in local_vars.values():
locals()["positions"] if "positions" in locals() else {}, if isinstance(v, SFG):
) sfg_object = v
break
positions = local_vars.get("positions", {})
if sfg_object is None:
raise ValueError("No SFG object found in the provided file.")
return sfg_object, positions
def schedule_to_python(schedule: Schedule) -> str: def schedule_to_python(schedule: Schedule) -> str:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment