chore(deps): upgrade awex to 0.7.0#1228
Conversation
There was a problem hiding this comment.
Code Review
This pull request updates the awex dependency to version 0.7.0 and introduces a uv_lock.sh script for lockfile management. Feedback suggests refactoring the script to use environment variables and targeted upgrades to avoid fragile file operations and unintended dependency changes.
| TMP_DIR="$(mktemp -d)" | ||
| cleanup() { | ||
| if [[ -f "${TMP_DIR}/pyproject.toml.bak" ]]; then | ||
| cp "${TMP_DIR}/pyproject.toml.bak" "${DEFAULT_PYPROJECT}" | ||
| fi | ||
| if [[ -f "${TMP_DIR}/uv.lock.bak" ]]; then | ||
| cp "${TMP_DIR}/uv.lock.bak" "${DEFAULT_LOCK}" | ||
| fi | ||
| rm -rf "${TMP_DIR}" | ||
| } | ||
| trap cleanup EXIT | ||
|
|
||
| cd "${REPO_ROOT}" | ||
|
|
||
| echo "[AReaL] Generating default lockfile from pyproject.toml..." | ||
| uv lock | ||
|
|
||
| cp "${DEFAULT_PYPROJECT}" "${TMP_DIR}/pyproject.toml.bak" | ||
| cp "${DEFAULT_LOCK}" "${TMP_DIR}/uv.lock.bak" | ||
|
|
||
| echo "[AReaL] Generating vLLM lockfile from pyproject.vllm.toml..." | ||
| cp "${VLLM_PYPROJECT}" "${DEFAULT_PYPROJECT}" | ||
| uv lock | ||
| cp "${DEFAULT_LOCK}" "${VLLM_LOCK}" | ||
|
|
There was a problem hiding this comment.
The current approach of manually backing up and overwriting pyproject.toml is fragile and can leave the repository in an inconsistent state if the script is interrupted.
You can use the UV_PROJECT_FILE and UV_LOCKFILE environment variables to specify the manifest and lockfile paths directly. Additionally, using --upgrade-package awex ensures that only the intended dependency is updated, preventing unrelated noise (like the downgrades and unrelated upgrades seen in this PR) in the lockfiles.
| TMP_DIR="$(mktemp -d)" | |
| cleanup() { | |
| if [[ -f "${TMP_DIR}/pyproject.toml.bak" ]]; then | |
| cp "${TMP_DIR}/pyproject.toml.bak" "${DEFAULT_PYPROJECT}" | |
| fi | |
| if [[ -f "${TMP_DIR}/uv.lock.bak" ]]; then | |
| cp "${TMP_DIR}/uv.lock.bak" "${DEFAULT_LOCK}" | |
| fi | |
| rm -rf "${TMP_DIR}" | |
| } | |
| trap cleanup EXIT | |
| cd "${REPO_ROOT}" | |
| echo "[AReaL] Generating default lockfile from pyproject.toml..." | |
| uv lock | |
| cp "${DEFAULT_PYPROJECT}" "${TMP_DIR}/pyproject.toml.bak" | |
| cp "${DEFAULT_LOCK}" "${TMP_DIR}/uv.lock.bak" | |
| echo "[AReaL] Generating vLLM lockfile from pyproject.vllm.toml..." | |
| cp "${VLLM_PYPROJECT}" "${DEFAULT_PYPROJECT}" | |
| uv lock | |
| cp "${DEFAULT_LOCK}" "${VLLM_LOCK}" | |
| cd "${REPO_ROOT}" | |
| # Use environment variables to specify manifest and lockfile paths, | |
| # avoiding the need to overwrite files or use temporary backups. | |
| echo "[AReaL] Generating default lockfile..." | |
| uv lock --upgrade-package awex | |
| echo "[AReaL] Generating vLLM lockfile..." | |
| UV_PROJECT_FILE="${VLLM_PYPROJECT}" UV_LOCKFILE="${VLLM_LOCK}" uv lock --upgrade-package awex | |
No description provided.