fix(ci): Add final bytecode cache clear after installations

The issue was timing - we were clearing cache before installations,
but uv sync/pip install were creating new .pyc files. This commit:

1. Adds PYTHONDONTWRITEBYTECODE=1 to prevent .pyc generation
2. Clears bytecode cache AFTER all installations complete
3. Ensures no stale .pyc files exist before tests run

For editable installs (-e .), Python loads from source directory,
so clearing cache after installation ensures the resolver sees the
latest method signatures with the authorization parameter.
This commit is contained in:
Omar Abdelwahab 2025-11-12 15:28:49 -08:00
parent 6dc2d92232
commit 0754d59999

View file

@ -28,6 +28,7 @@ runs:
shell: bash
env:
UV_EXTRA_INDEX_URL: ${{ steps.client-config.outputs.uv-extra-index-url }}
PYTHONDONTWRITEBYTECODE: 1
run: |
# Export UV env vars for current step and persist to GITHUB_ENV for subsequent steps
if [ -n "$UV_EXTRA_INDEX_URL" ]; then
@ -69,5 +70,9 @@ runs:
uv pip install ${{ steps.client-config.outputs.install-source }}
fi
echo "Final cleanup: removing all bytecode cache after installations"
find . -name "*.pyc" -type f -delete 2>/dev/null || true
find . -type d -name "__pycache__" -exec rm -rf {} + 2>/dev/null || true
echo "Installed llama packages"
uv pip list | grep llama