Repository navigation
fix: include built frontend in package, fix CI lint/type and publish issues - #2
Closed
JacobCoffee wants to merge 2 commits into
Closed
JacobCoffee wants to merge 2 commits into
JacobCoffee wants to merge 2 commits into
Conversation
- 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
Contributor
|
…ignores to ty ignores
Owner
Author
|
Replaced by 3, which keeps the same packaging fix with a much smaller diff. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #1
What
make buildranuv buildwithout 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 intosrc/litestar_admin/staticbefore 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).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 debugprint()s, small refactors to bring 3 functions under the complexity threshold, etc. Also ranruff formaton files that were failingformat --checkon main already.ty checkhad never actually run to completion in this repo's CI history becauseruff checkalways failed first and short-circuited the job. Once ruff was fixed,ty checksurfaced 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.StrEnumandtyping.Selfdon't exist before 3.11, despiterequires-python >= 3.10), unsoundMapper | Nonehandling after SQLAlchemy'sinspect(), and a real typing gap where several controllers treated a genericBaseAdminViewas aBaseModelView(addedModelRegistry.get_model_view_by_name()to narrow it properly).softprops/action-gh-releaseto 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 thelitestar-permissionsoptional-dep test, which needs a package not installed in this env)./admin/and a_next/static/...asset both return 200.