Skip to content

Fixed issue with the book editor where a runtime error occured when s… - #437

Merged
noahpro99 merged 2 commits into
codekids-vt:mainfrom
kanyemckinney:bookeditor
Sep 24, 2026
Merged

noahpro99 merged 2 commits into
codekids-vt:mainfrom
kanyemckinney:bookeditor

Conversation

@kanyemckinney

Copy link
Copy Markdown
Contributor

…witching between pages

noahpro99 added a commit to kanyemckinney/codekids that referenced this pull request Sep 24, 2026
CI installed ruff unpinned, so the 0.16.x release -- which ships a much
wider default rule set -- started failing check-all on unchanged backend
code (117 errors, e.g. on PR codekids-vt#437, which only touches the frontend).

Rather than pin ruff back, adopt the new defaults:

- CI installs backend tooling with uv (uv sync --locked + uv run) instead
  of pip, so CI uses exactly the versions in uv.lock. This also drops the
  build/lib/ copy pip left behind, which was being linted twice.
- Bump ruff 0.14.3 -> 0.16.8, black 25.9.0 -> 26.5.1, pyright 1.1.407 ->
  1.1.414 in the lockfile.
- Fix the 60 findings: import sorting (I001), Optional[X]/List[X] ->
  X | None / list[X] (UP045/UP006/UP035), set comprehension (C401),
  bool(user) (SIM103), merged nested if (SIM102), f-string conversion
  flag (RUF010), Annotated[UploadFile, File()] instead of a call in a
  default arg (B008), timezone-aware datetime.now(timezone.utc) (DTZ005),
  and data_migrate.py reads books.json outside the async path (ASYNC230)
  with next(..., None) lookup (RUF015).
- Ignore BLE001 under src/routers/, where handlers intentionally catch
  Exception to return an HTTP error instead of an unhandled 500.
- README: document the checks as uv run.
noahpro99 added a commit to kanyemckinney/codekids that referenced this pull request Sep 24, 2026
The Dockerfile ran 'pip install .' with only pyproject.toml copied, so
every image build resolved the newest versions matching the constraints.
CI now installs from uv.lock, so prod and CI had no mechanism to stay on
the same versions -- the same drift that broke check-all on PR codekids-vt#437.

Install with 'uv sync --locked --no-dev --no-install-project' instead.
--no-install-project matches the previous behaviour: only dependencies
were installed at that layer, and the app runs from the source copied
afterwards.

Verified by building the image and running it against postgres:16:
prisma generate succeeds, uvicorn starts, GET /openapi.json returns 200,
and fastapi resolves to 0.141.1 -- the same version 'pip install .'
produced today and the one pinned in uv.lock.
@noahpro99
noahpro99 merged commit 7b74ffe into codekids-vt:main Sep 24, 2026
1 check passed
@kanyemckinney
kanyemckinney deleted the bookeditor branch September 24, 2026 20:54
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.

2 participants