fix: resolve f-string escaping issues in Python debugging
All checks were successful
audit / audit (push) Has been skipped
ci-cd / build (push) Has been skipped
ci / build (push) Has been skipped
autofix / fix (push) Has been skipped
python-tests / test (push) Successful in 16s
python-tests / test-specific (push) Has been skipped
security-scanning / audit (push) Has been skipped
test / test (push) Has been skipped
ci-cd / deploy (push) Has been skipped
ci / deploy (push) Has been skipped

F-STRING ESCAPING FIX: Use string concatenation instead of f-strings

Issue:
- SyntaxError: unterminated f-string literal
- f-string escaping conflicts in exec() within YAML
- Complex nested quoting causing parsing errors

Solution:
- Replace f-strings with string concatenation
- Use str(e) instead of f"{e}"
- Simpler string handling in exec() blocks
- Maintain error reporting functionality

Changes:
- print(" src import failed: " + str(e))
- print(" aitbc import failed: " + str(e))
- Removes f-string complexity
- Preserves error message display

Expected results:
- No more SyntaxError with f-strings
- Import debugging should work
- Clear error messages for failed imports
- Workflow should proceed to pytest execution

This should resolve the f-string escaping conflicts and allow
the import debugging to complete successfully.
This commit is contained in:
2026-03-27 20:49:23 +01:00
parent 8d6a05f09c
commit 7bfceedc3f

View File

@@ -128,8 +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'); 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')"
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(\"❌ src import failed: \" + str(e))')"
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(\"❌ aitbc import failed: \" + str(e))')"
echo "=== RUNNING PYTHON TESTS ==="
echo "Attempting to run tests with comprehensive error handling..."