Force reinstall internal runtime deps#96
Conversation
Co-Authored-By: Codex <noreply@openai.com>
|
Bugbot is not enabled for your account, so this pull request was not reviewed. Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 0d81970d7f
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| install_with_retry "Force reinstall internal dependency ${requirement%% @ *}" \ | ||
| "$VENV_PATH/bin/pip" install --force-reinstall --no-deps "$requirement" | ||
| fi | ||
| done < <(grep -E '^(quant-platform-kit|crypto-strategies) @ git\\+' "$REQ_FILE" || true) |
There was a problem hiding this comment.
Match git+ direct references when forcing reinstall
Under grep -E (extended regex; checked grep --help), this single-quoted git\\+ pattern looks for a backslash before the +, so it returns no rows for the current requirements-lock.txt entries like quant-platform-kit @ git+https://.... When only an internal git SHA changes, force_reinstall_internal_git_deps therefore skips both packages and the cached runtime venv can still keep the stale installed code that this change is meant to refresh.
Useful? React with 👍 / 👎.
| echo "$REQ_FILE changed or cache is cold; updating dependency venv." | ||
| install_with_retry "Upgrade pip" "$VENV_PATH/bin/pip" install -U pip | ||
| install_with_retry "Install runtime dependencies" "$VENV_PATH/bin/pip" install -r "$REQ_FILE" | ||
| force_reinstall_internal_git_deps |
There was a problem hiding this comment.
Reinstall internal deps when reusing the hot cache
Because this call is only reached in the cache-miss branch, a self-hosted runner whose requirements.sha256 already matches the current lock file skips the new repair path. That is the exact state left after an earlier run recorded the new requirements hash while pip kept an older same-version direct-url install, and this workflow-only commit does not change requirements-lock.txt, so the stale internal package can continue to run until the lock file changes again or the venv is deleted.
Useful? React with 👍 / 👎.
| while IFS= read -r requirement; do | ||
| if [ -n "$requirement" ]; then | ||
| install_with_retry "Force reinstall internal dependency ${requirement%% @ *}" \ | ||
| "$VENV_PATH/bin/pip" install --force-reinstall --no-deps "$requirement" |
There was a problem hiding this comment.
Resolve dependencies for refreshed git packages
When an internal git pin adds or changes an install dependency while keeping the same package version, the preceding pip install -r can skip the already-installed package and never see the new metadata; this repair install then passes --no-deps, which python3 -m pip install --help defines as “Don't install package dependencies.” The workflow can therefore run refreshed internal code without its newly required dependency in the runtime venv.
Useful? React with 👍 / 👎.
Summary\n- force reinstall internal git direct dependencies during runtime deploy updates\n- cover the runtime workflow guard in tests\n\n## Why\nThe runtime venv can otherwise keep an installed package with the same package version even when the git pin changed, leaving stale code in place.\n\n## Validation\n- PYTHONPATH=/Users/lisiyi/Projects/QuantPlatformKit/src:/Users/lisiyi/Projects/CryptoStrategies/src:. python3 -m pytest -q tests/test_watchdog_workflow.py\n- python3 -m ruff check .\n- PYTHONPATH=/Users/lisiyi/Projects/QuantPlatformKit/src:/Users/lisiyi/Projects/CryptoStrategies/src:. python3 -m unittest discover -s tests -v