mirror of
https://github.com/meta-llama/llama-stack.git
synced 2025-12-03 18:00:36 +00:00
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:
parent
6dc2d92232
commit
0754d59999
1 changed files with 7 additions and 2 deletions
9
.github/actions/setup-runner/action.yml
vendored
9
.github/actions/setup-runner/action.yml
vendored
|
|
@ -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
|
||||
|
|
@ -43,11 +44,11 @@ runs:
|
|||
echo "Removing cached .venv directory"
|
||||
rm -rf .venv
|
||||
fi
|
||||
|
||||
|
||||
# Clear Python bytecode cache
|
||||
find . -type d -name "__pycache__" -exec rm -rf {} + 2>/dev/null || true
|
||||
find . -name "*.pyc" -delete 2>/dev/null || true
|
||||
|
||||
|
||||
# Clear uv's cache directory to force rebuilding wheels from source
|
||||
if [ -n "$UV_CACHE_DIR" ] && [ -d "$UV_CACHE_DIR" ]; then
|
||||
echo "Clearing UV cache at $UV_CACHE_DIR"
|
||||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue