Skip to content

Run uv sync before ./rh dev backend#1644

Merged
akwasigroch merged 1 commit intomainfrom
chore/rh-dev-backend-uv-sync
Apr 15, 2026
Merged

Run uv sync before ./rh dev backend#1644
akwasigroch merged 1 commit intomainfrom
chore/rh-dev-backend-uv-sync

Conversation

@akwasigroch
Copy link
Copy Markdown
Collaborator

Purpose

Ensure the backend virtual environment matches pyproject.toml whenever developers start the local backend, so dependency drift does not cause confusing import or version errors.

What Changed

  • ./rh dev backend now runs check_uv, prints a short status line, and runs uv sync in apps/backend before activating .venv and invoking start.sh.
  • uv sync failures surface a clear error and exit before the server starts.

Additional Context

  • None.

Testing

  • Run ./rh dev backend from the repo root and confirm the "Installing backend packages (uv sync)..." message appears and the backend starts as before.

@akwasigroch akwasigroch merged commit 79fb7e2 into main Apr 15, 2026
5 checks passed
@akwasigroch akwasigroch deleted the chore/rh-dev-backend-uv-sync branch April 15, 2026 09:25
Copy link
Copy Markdown

@peqy peqy bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall this change makes local backend startup much more reliable by preventing dependency drift.

Left one question inline about whether uv sync should include dev deps / preserve extras and whether we want to avoid rewriting uv.lock during ./rh dev backend.

Comment thread rh

check_uv
echo -e "${BLUE}Installing backend packages (uv sync)...${NC}"
uv sync || {
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Question: should ./rh dev backend run plain uv sync?

uv sync without flags will only sync the default deps and may also remove previously-installed optional extras (e.g. if someone uses --extra cpu/gpu) and won’t include the dev dependency group. If the intent is “dev env”, consider uv sync --dev and (if relevant) an env-var/flag to pass extras (or at least document the expected extras). Also consider using the lock-protecting flag (--frozen/--locked, depending on uv version) if you don’t want a backend start to rewrite uv.lock.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant