From 8d6a05f09c3726ee70b4eb9dc7f58c2929fd314c Mon Sep 17 00:00:00 2001 From: aitbc1 Date: Fri, 27 Mar 2026 20:48:18 +0100 Subject: [PATCH] fix: resolve YAML indentation issues in Python debugging script YAML INDENTATION FIX: Use single-line Python commands to avoid indentation Issue: - IndentationError persists due to YAML multi-line string handling - Multi-line Python strings in YAML cause indentation conflicts - Workflow still failing with syntax errors Solution: - Use single-line Python commands with exec() - Escape newlines with \n in exec() strings - Separate commands for each import test - Avoid YAML multi-line string indentation issues Changes: - Single-line venv/bin/python -c commands - exec() with escaped newlines for try/except blocks - Separate commands for src and aitbc imports - Maintains debugging functionality without YAML conflicts Expected results: - No more IndentationError - Import debugging should work - Workflow should continue to pytest execution - Clear feedback on import success/failure This should finally resolve the YAML/Python indentation conflict and allow the workflow to proceed to actual test execution. --- .gitea/workflows/python-tests.yml | 20 ++------------------ 1 file changed, 2 insertions(+), 18 deletions(-) diff --git a/.gitea/workflows/python-tests.yml b/.gitea/workflows/python-tests.yml index 32ae3dc8..263a9a92 100644 --- a/.gitea/workflows/python-tests.yml +++ b/.gitea/workflows/python-tests.yml @@ -128,24 +128,8 @@ jobs: # Test specific imports that are failing echo "Testing problematic imports..." - venv/bin/python -c " -import sys -print('Testing src import...') -sys.path.insert(0, '/opt/gitea-runner/workspace/repo/apps/agent-protocols/src') -try: - import message_protocol - print('✅ src.message_protocol import successful') -except Exception as e: - print(f'❌ src import failed: {e}') - -print('Testing aitbc import...') -sys.path.insert(0, '/opt/gitea-runner/workspace/repo/apps/blockchain-node/src') -try: - import aitbc_chain - print('✅ aitbc_chain import successful') -except Exception as e: - print(f'❌ aitbc import failed: {e}') -" + venv/bin/python -c "import sys; print('Testing src import...'); sys.path.insert(0, '/opt/gitea-runner/workspace/repo/apps/agent-protocols/src'); exec('try:\n import message_protocol\n print(\"✅ src.message_protocol import successful\")\nexcept Exception as e:\n print(f\"❌ src import failed: {e}\n')" + venv/bin/python -c "import sys; print('Testing aitbc import...'); sys.path.insert(0, '/opt/gitea-runner/workspace/repo/apps/blockchain-node/src'); exec('try:\n import aitbc_chain\n print(\"✅ aitbc_chain import successful\")\nexcept Exception as e:\n print(f\"❌ aitbc import failed: {e}\n')" echo "=== RUNNING PYTHON TESTS ===" echo "Attempting to run tests with comprehensive error handling..."