Skip to content

Commit 3e95eb1

Browse files
author
SentienceDEV
committed
remove .pyc
1 parent 261d87c commit 3e95eb1

File tree

1 file changed

+36
-9
lines changed

1 file changed

+36
-9
lines changed

.github/workflows/test.yml

Lines changed: 36 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -34,25 +34,49 @@ jobs:
3434
run: |
3535
pip cache purge || true
3636
pip uninstall -y sentienceapi || true
37-
# Clean any bytecode cache (cross-platform Python approach)
37+
# Aggressively clean any bytecode cache (cross-platform Python approach)
3838
python -c "import pathlib; [p.unlink() for p in pathlib.Path('.').rglob('*.pyc')]" || true
3939
python -c "import pathlib, shutil; [shutil.rmtree(p) for p in pathlib.Path('.').rglob('__pycache__') if p.is_dir()]" || true
40-
pip install --no-cache-dir -e ".[dev]"
40+
# Also clean .pyc files in sentience package specifically
41+
find sentience -type d -name __pycache__ -exec rm -rf {} + 2>/dev/null || python -c "import pathlib, shutil; [shutil.rmtree(p) for p in pathlib.Path('sentience').rglob('__pycache__') if p.is_dir()]" || true
42+
find sentience -name "*.pyc" -delete 2>/dev/null || python -c "import pathlib; [p.unlink() for p in pathlib.Path('sentience').rglob('*.pyc')]" || true
43+
# Force reinstall to ensure latest code
44+
pip install --no-cache-dir --force-reinstall -e ".[dev]"
4145
pip install pre-commit mypy types-requests
4246
4347
- name: Verify installed package
4448
shell: bash
4549
run: |
50+
echo "=== Git info ==="
51+
git log --oneline -1
52+
git branch --show-current || echo "Detached HEAD"
53+
echo ""
54+
echo "=== Source file line 345 ==="
55+
sed -n '345p' sentience/agent_runtime.py || python -c "with open('sentience/agent_runtime.py', 'r') as f: lines = f.readlines(); print(lines[344] if len(lines) > 344 else 'NOT FOUND')"
56+
echo ""
4657
echo "=== Installed sentience location ==="
4758
python -c "import sentience; print(sentience.__file__)"
59+
echo ""
4860
echo "=== Check assert_done in installed package ==="
49-
python -c "import inspect; from sentience.agent_runtime import AgentRuntime; source = inspect.getsource(AgentRuntime.assert_done); print('assert_done source:'); print(source); exit(1) if 'assertTrue' in source else print('Good: assert_ is correctly used')" || {
50-
echo "WARNING: Installed package has old code. Reinstalling..."
51-
pip uninstall -y sentienceapi || true
52-
pip install --no-cache-dir -e ".[dev]"
53-
echo "Reinstalled. Verifying again..."
54-
python -c "import inspect; from sentience.agent_runtime import AgentRuntime; source = inspect.getsource(AgentRuntime.assert_done); exit(1) if 'assertTrue' in source else print('Good: assert_ is correctly used after reinstall')"
55-
}
61+
python << 'PYEOF'
62+
import inspect
63+
from sentience.agent_runtime import AgentRuntime
64+
source = inspect.getsource(AgentRuntime.assert_done)
65+
print('assert_done method:')
66+
print(source)
67+
print('\n=== Analysis ===')
68+
if 'self.assertTrue(' in source:
69+
print('✗ ERROR: Found self.assertTrue( in installed package!')
70+
print('This means the source code on this branch still has the bug.')
71+
for i, line in enumerate(source.split('\n'), 1):
72+
if 'self.assertTrue(' in line:
73+
print(f' Line {i}: {line.strip()}')
74+
exit(1)
75+
elif 'self.assert_(' in source:
76+
print('✓ OK: assert_done uses self.assert_( correctly')
77+
else:
78+
print('? WARNING: Could not find assert_ method call')
79+
PYEOF
5680
5781
- name: Verify source code
5882
shell: bash
@@ -164,7 +188,10 @@ jobs:
164188
EOF
165189
166190
- name: Run tests
191+
shell: bash
167192
run: |
193+
# Final verification before tests - ensure we're using the right code
194+
python -c "import sentience.agent_runtime; import inspect; src = inspect.getsource(sentience.agent_runtime.AgentRuntime.assert_done); assert 'self.assert_(' in src, 'assert_done must use self.assert_(), not self.assertTrue()'; print('✓ Verified: assert_done uses self.assert_()')"
168195
pytest tests/ -v
169196
env:
170197
CI: true

0 commit comments

Comments
 (0)