Skip to content

fix: include built frontend in package, fix CI lint/type and publish issues - #2

Closed
JacobCoffee wants to merge 2 commits into
mainfrom
fix/frontend-assets-and-ci-lint
Closed

JacobCoffee wants to merge 2 commits into
mainfrom
fix/frontend-assets-and-ci-lint

Conversation

@JacobCoffee

Copy link
Copy Markdown
Owner

Fixes #1

What

  • Frontend packaging (issue Frontend static files are missing from the PyPI package (0.1.1) #1): the publish workflow and make build ran uv build without ever building the Next.js frontend first, so the 0.1.1 wheel/sdist shipped with 0 static/js/css/html files. Both now build the frontend (bun install && bun run build) and copy it into src/litestar_admin/static before packaging. Verified locally: the built wheel now contains 101 static files, and installing it in a clean venv serves /admin/ and its static assets with 200 (not 404).
  • CI lint (ruff): fixed the full set of ruff failures on main (the originally reported list was just the first 10 GitHub truncates in its annotations UI; the real list was 51 errors). Fixes are all minimal/targeted: import ordering, logging usage, leftover debug print()s, small refactors to bring 3 functions under the complexity threshold, etc. Also ran ruff format on files that were failing format --check on main already.
  • CI type-check (ty): ty check had never actually run to completion in this repo's CI history because ruff check always failed first and short-circuited the job. Once ruff was fixed, ty check surfaced 65 pre-existing diagnostics. Fixed all of them: Liskov/ClassVar mismatches (Controller.tags, AbstractMiddleware.scopes, __tablename__, BaseModelView.view_type), Python 3.10 compatibility bugs (enum.StrEnum and typing.Self don't exist before 3.11, despite requires-python >= 3.10), unsound Mapper | None handling after SQLAlchemy's inspect(), and a real typing gap where several controllers treated a generic BaseAdminView as a BaseModelView (added ModelRegistry.get_model_view_by_name() to narrow it properly).
  • Publish workflow: pinned softprops/action-gh-release to v2.6.0 — the previously pinned v2.5.0 has a well-documented 'stuck in retry loop' / 'Too many retries' bug in its release-finalize step (fixed upstream in 2.5.1/2.6.0), which is exactly what failed the last 0.1.1 Publish run's "Publish Release" job.

Verification

  • ruff check . / ruff format --check . / uv run ty check src: all green.
  • uv run pytest: 812 passed (excluding the litestar-permissions optional-dep test, which needs a package not installed in this env).
  • Built the wheel locally, installed in a throwaway venv, and confirmed /admin/ and a _next/static/... asset both return 200.

- Build and copy the Next.js frontend into src/litestar_admin/static
  before packaging, both locally (Makefile build target) and in the
  Publish workflow (uv build never built the frontend, so the 0.1.1
  wheel shipped with zero static/js/css/html files).
- Fix all ruff lint failures blocking main CI: E402/TC001 import
  ordering in files.py, SIM102/SIM108 simplifications, complexity
  (PLR0912/PLR0915/C901) in files.py/in_memory.py/service.py/plugin.py
  via targeted helper extraction, logging f-string/exception usage,
  leftover debug print() calls, docs/conf.py pathlib usage, and
  assorted smaller fixes. Applied ruff format to the few files that
  were already failing format --check.
- Fix the full ty type-check backlog that had never actually run in
  CI (ruff always failed first): ClassVar vs instance-attribute
  Liskov violations on Controller.tags/AbstractMiddleware.scopes/
  __tablename__/BaseModelView.view_type, Python 3.10 StrEnum/Self
  compatibility, SQLAlchemy inspect() Optional narrowing, and a new
  ModelRegistry.get_model_view_by_name() narrowing helper so
  model-only controllers no longer treat a generic BaseAdminView as
  a BaseModelView.
- Pin softprops/action-gh-release to v2.6.0 in publish.yml, fixing
  the known v2.5.0 'Too many retries' finalize-release bug that
  failed the last release's Publish Release job.

Fixes #1
@github-actions

github-actions Bot commented Oct 11, 2026 •

Copy link
Copy Markdown
Contributor
PR Preview Action v1.6.3

🚀 View preview at
https://JacobCoffee.github.io/litestar-admin/pr-preview/pr-2/

Built to branch gh-pages at 2026-10-11 01:43 UTC.
Preview will be ready when the GitHub Pages deployment is complete.

@JacobCoffee

Copy link
Copy Markdown
Owner Author

Replaced by 3, which keeps the same packaging fix with a much smaller diff.

@JacobCoffee
JacobCoffee deleted the fix/frontend-assets-and-ci-lint branch October 11, 2026 02:21
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.

Frontend static files are missing from the PyPI package (0.1.1)

1 participant