fix(specs): unwrap ju rjsf form spec + modernize packaging metadata - #3
Merged
Conversation
`ju.rjsf.func_to_form_spec` defaults to `nest_under_field="rjsf"`, so it
returns `{"rjsf": {"schema": ..., "uiSchema": ...}}`. `_generate_spec` then
read `form_spec.get("schema", {})`, which always yielded `{}` — meaning every
generated RJSF form was empty whenever `ju` imported successfully. The empty
schema is served straight to the browser by `uf/routes.py` (`spec["schema"]`),
so this was user-facing, not just a test artifact.
Pass `nest_under_field=None` (via a dict merge, so caller overrides in
`_rjsf_config` still win) to get the flat shape `uf` expects — the same shape
the `_generate_basic_spec` fallback already emits.
Tests: 2 failed / 27 passed -> 29 passed.
Claude-Session: https://claude.ai/code/session_01VipiLaG4xy7WctqY9w2475
- license: replace the deprecated `[project.license] text = "mit"` table with the PEP 639 SPDX string `license = "MIT"` (canonical case). No `License :: OSI Approved ::` trove classifier is added — PyPI rejects that combination alongside an SPDX expression. - keywords: fill in the empty placeholder. - authors: fill in the empty placeholder. - classifiers: add (were absent entirely, so the PyPI page had no trove metadata). - description: "UI Fast" -> the README tagline, which actually says what the package does. The GitHub repo description is set to the same string so the two do not drift. - urls: add `Documentation = "https://i2mint.github.io/uf/"` (already live on the gh-pages branch). - .editorconfig: new, copied verbatim from the fleet reference. Verified with `uv build`: METADATA emits `License-Expression: MIT` and the eight classifiers, with no conflicting license classifier. Claude-Session: https://claude.ai/code/session_01VipiLaG4xy7WctqY9w2475
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.
The bug
uf/specs.pycalledfunc_to_form_spec(func, **self._rjsf_config). Butju.rjsf.func_to_form_specdefaults tonest_under_field="rjsf", so it returns:{"rjsf": {"schema": {...}, "uiSchema": {...}}}_generate_specthen readform_spec.get("schema", {})— which always yielded{}. Every generated RJSF form was empty wheneverjuimportedsuccessfully. This is user-facing, not a test artifact:
uf/routes.pyservesspec["schema"]straight to the browser in two places.This was masked in CI because the broad
except ImportError:around thejucall block silently falls back to
_generate_basic_spec, which happens to emitthe flat shape — so CI was green while the
juintegration (the package's wholepoint) was never actually exercised.
The fix
Pass
nest_under_field=None, via a dict merge so caller overrides in_rjsf_configstill win:Safe in both environments: it makes the
jupath emit exactly the same flatshape the
ImportErrorfallback already emits. Theexcept ImportError:clauseis deliberately left untouched in this PR (see Deliberately out of scope).
Test counts
python -m pytest -qtest-dependents uf)Previously failing:
tests/test_specs.py::test_function_spec_schema_basic(
KeyError: 'type') andtests/test_specs.py::test_function_spec_required_params(
assert 'name' in []).Packaging metadata
[project.license] text = "mit"table -> PEP 639 SPDXstring
license = "MIT"(canonical case). NoLicense :: OSI Approved ::trove classifier added — PyPI rejects that combination alongside an SPDX
expression.
[]), now filled in.metadata. Eight added.
"UI Fast"-> the README tagline"Minimal-boilerplate web UIs for Python functions". The GitHub repodescription is set to the same string so the two do not drift.
Documentation = "https://i2mint.github.io/uf/"(already liveon the
gh-pagesbranch)..editorconfig: new, copied verbatim from the fleet reference.Verified with
uv build: the wheelMETADATAemitsLicense-Expression: MITplus the eight classifiers, with no conflicting license classifier.
ruff checkand
ruff format --checkboth clean.Repo settings were also updated out-of-band (not branch-scoped): homepage set to
the docs URL, and topics added.
Deliberately out of scope
Left for later specialist passes, each a known finding:
except ImportError:inuf/specs.py— currently load-bearingfor CI green. Something in the
juimport chain raisesImportErrorin theGitHub runner environment (not yet identified;
ipywidgets, lazygraphviz,and every
ju/__init__name were ruled out against the published wheel).Narrowing it now would surface that hidden
ImportErroras a CI failure. Itdeserves its own investigation.
Example:blocks written indoctest syntax that were never runnable.
testpaths = ["tests"]is the onlything keeping them out of collection, so
testpathsis intentionallyunchanged here; widening it before those are fixed would turn CI red.
uf/py.typed, noCHANGELOG, CI is still uv-inline rather than thereusable-workflow stub.
Upstream note (informational, not
uf's job):func_to_form_specnesting itsresult under
"rjsf"by default is an easy trap for every consumer ofju.https://claude.ai/code/session_01VipiLaG4xy7WctqY9w2475