mrmd-python 0.3.3__tar.gz → 0.3.4__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.
- {mrmd_python-0.3.3 → mrmd_python-0.3.4}/PKG-INFO +1 -1
- {mrmd_python-0.3.3 → mrmd_python-0.3.4}/pyproject.toml +1 -1
- {mrmd_python-0.3.3 → mrmd_python-0.3.4}/src/mrmd_python/worker.py +18 -16
- {mrmd_python-0.3.3 → mrmd_python-0.3.4}/.gitignore +0 -0
- {mrmd_python-0.3.3 → mrmd_python-0.3.4}/README.md +0 -0
- {mrmd_python-0.3.3 → mrmd_python-0.3.4}/src/mrmd_python/__init__.py +0 -0
- {mrmd_python-0.3.3 → mrmd_python-0.3.4}/src/mrmd_python/cli.py +0 -0
- {mrmd_python-0.3.3 → mrmd_python-0.3.4}/src/mrmd_python/runtime_client.py +0 -0
- {mrmd_python-0.3.3 → mrmd_python-0.3.4}/src/mrmd_python/runtime_daemon.py +0 -0
- {mrmd_python-0.3.3 → mrmd_python-0.3.4}/src/mrmd_python/server.py +0 -0
- {mrmd_python-0.3.3 → mrmd_python-0.3.4}/src/mrmd_python/subprocess_manager.py +0 -0
- {mrmd_python-0.3.3 → mrmd_python-0.3.4}/src/mrmd_python/subprocess_worker.py +0 -0
- {mrmd_python-0.3.3 → mrmd_python-0.3.4}/src/mrmd_python/types.py +0 -0
- {mrmd_python-0.3.3 → mrmd_python-0.3.4}/uv.lock +0 -0
|
@@ -647,8 +647,8 @@ class IPythonWorker:
|
|
|
647
647
|
return ExecuteResult(
|
|
648
648
|
success=False,
|
|
649
649
|
error=ExecuteError(
|
|
650
|
-
|
|
651
|
-
|
|
650
|
+
type="VenvError",
|
|
651
|
+
message="Could not find Python executable in venv",
|
|
652
652
|
traceback=[]
|
|
653
653
|
)
|
|
654
654
|
)
|
|
@@ -658,11 +658,12 @@ class IPythonWorker:
|
|
|
658
658
|
|
|
659
659
|
# Create a wrapper script that executes the code and captures output
|
|
660
660
|
# Uses AST to detect trailing expressions and print their results like IPython
|
|
661
|
+
# Use .strip() to remove any leading/trailing whitespace from the embedded code
|
|
661
662
|
wrapper_code = '''
|
|
662
663
|
import sys as _sys
|
|
663
664
|
import ast as _ast
|
|
664
665
|
|
|
665
|
-
_code = """
|
|
666
|
+
_code = """''' + code.replace('\\', '\\\\').replace('"""', '\\"\\"\\"') + '''""".strip()
|
|
666
667
|
|
|
667
668
|
try:
|
|
668
669
|
_tree = _ast.parse(_code)
|
|
@@ -716,8 +717,8 @@ except Exception as _e:
|
|
|
716
717
|
stdout=result.stdout,
|
|
717
718
|
stderr=result.stderr,
|
|
718
719
|
error=ExecuteError(
|
|
719
|
-
|
|
720
|
-
|
|
720
|
+
type="ExecutionError",
|
|
721
|
+
message=error_lines[-1] if error_lines else "Unknown error",
|
|
721
722
|
traceback=error_lines
|
|
722
723
|
),
|
|
723
724
|
executionCount=self._execution_count,
|
|
@@ -728,8 +729,8 @@ except Exception as _e:
|
|
|
728
729
|
return ExecuteResult(
|
|
729
730
|
success=False,
|
|
730
731
|
error=ExecuteError(
|
|
731
|
-
|
|
732
|
-
|
|
732
|
+
type="TimeoutError",
|
|
733
|
+
message="Execution timed out after 5 minutes",
|
|
733
734
|
traceback=[]
|
|
734
735
|
),
|
|
735
736
|
executionCount=self._execution_count,
|
|
@@ -738,8 +739,8 @@ except Exception as _e:
|
|
|
738
739
|
return ExecuteResult(
|
|
739
740
|
success=False,
|
|
740
741
|
error=ExecuteError(
|
|
741
|
-
|
|
742
|
-
|
|
742
|
+
type=type(e).__name__,
|
|
743
|
+
message=str(e),
|
|
743
744
|
traceback=[]
|
|
744
745
|
),
|
|
745
746
|
executionCount=self._execution_count,
|
|
@@ -763,8 +764,8 @@ except Exception as _e:
|
|
|
763
764
|
return ExecuteResult(
|
|
764
765
|
success=False,
|
|
765
766
|
error=ExecuteError(
|
|
766
|
-
|
|
767
|
-
|
|
767
|
+
type="VenvError",
|
|
768
|
+
message="Could not find Python executable in venv",
|
|
768
769
|
traceback=[]
|
|
769
770
|
)
|
|
770
771
|
)
|
|
@@ -776,11 +777,12 @@ except Exception as _e:
|
|
|
776
777
|
|
|
777
778
|
# Wrap code to capture expression results like IPython does
|
|
778
779
|
# This handles cases like "import sys; sys.executable" which need to print
|
|
780
|
+
# Use .strip() to remove any leading/trailing whitespace from the embedded code
|
|
779
781
|
wrapper_code = '''
|
|
780
782
|
import sys as _sys
|
|
781
783
|
import ast as _ast
|
|
782
784
|
|
|
783
|
-
_code = """
|
|
785
|
+
_code = """''' + code.replace('\\', '\\\\').replace('"""', '\\"\\"\\"') + '''""".strip()
|
|
784
786
|
|
|
785
787
|
# Parse to check if last statement is an expression
|
|
786
788
|
try:
|
|
@@ -855,8 +857,8 @@ except SyntaxError as _e:
|
|
|
855
857
|
stdout=accumulated_stdout,
|
|
856
858
|
stderr=accumulated_stderr,
|
|
857
859
|
error=ExecuteError(
|
|
858
|
-
|
|
859
|
-
|
|
860
|
+
type="ExecutionError",
|
|
861
|
+
message=error_lines[-1] if error_lines else "Unknown error",
|
|
860
862
|
traceback=error_lines
|
|
861
863
|
),
|
|
862
864
|
executionCount=self._execution_count,
|
|
@@ -875,8 +877,8 @@ except SyntaxError as _e:
|
|
|
875
877
|
return ExecuteResult(
|
|
876
878
|
success=False,
|
|
877
879
|
error=ExecuteError(
|
|
878
|
-
|
|
879
|
-
|
|
880
|
+
type=type(e).__name__,
|
|
881
|
+
message=str(e),
|
|
880
882
|
traceback=[]
|
|
881
883
|
),
|
|
882
884
|
executionCount=self._execution_count,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|