diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..88bf4d0 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,17 @@ +root = true + +[*] +charset = utf-8 +end_of_line = lf +insert_final_newline = true +trim_trailing_whitespace = true + +[*.{py,toml,yml,yaml}] +indent_style = space +indent_size = 4 + +[*.md] +trim_trailing_whitespace = false + +[Makefile] +indent_style = tab diff --git a/pyproject.toml b/pyproject.toml index 7a4490e..340ab6a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -5,19 +5,39 @@ build-backend = "hatchling.build" [project] name = "uf" version = "0.1.2" -description = "UI Fast" +description = "Minimal-boilerplate web UIs for Python functions" readme = "README.md" requires-python = ">=3.10" -keywords = [] -authors = [] +license = "MIT" +keywords = [ + "ui", + "forms", + "rjsf", + "json-schema", + "web-ui", + "fastapi", + "bottle", + "python-functions", +] +authors = [ + { name = "Thor Whalen" }, +] +classifiers = [ + "Development Status :: 3 - Alpha", + "Intended Audience :: Developers", + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.12", + "Topic :: Software Development :: Libraries :: Python Modules", + "Topic :: Software Development :: User Interfaces", + "Framework :: FastAPI", +] dependencies = ["qh", "ju", "i2", "dol", "meshed"] -[project.license] -text = "mit" - [project.urls] Homepage = "https://github.com/i2mint/uf" Repository = "https://github.com/i2mint/uf" +Documentation = "https://i2mint.github.io/uf/" [project.optional-dependencies] dev = ["pytest>=7.0", "pytest-cov>=4.0", "ruff>=0.1.0"] diff --git a/uf/specs.py b/uf/specs.py index 635eb4f..cc9ba97 100644 --- a/uf/specs.py +++ b/uf/specs.py @@ -93,7 +93,9 @@ def _generate_spec(self, func_name: str) -> dict: from ju.rjsf import func_to_form_spec # Generate form spec - form_spec = func_to_form_spec(func, **self._rjsf_config) + # ju nests the spec under a "rjsf" field by default; uf wants it flat + rjsf_config = {"nest_under_field": None, **self._rjsf_config} + form_spec = func_to_form_spec(func, **rjsf_config) # Apply custom UI schema factory if provided if self._ui_schema_factory: