# Dash: Plotly's framework for reactive web apps in Python (Flask + React). fsl_mrs_summarise (the FSL-MRS results browser) is built on it; FMRIB's # installer ships dash 4.4.1 as a conda dependency; not in Fedora. # # BUNDLED JAVASCRIPT: the sdist carries Dash's prebuilt front end (dash-renderer, the dcc/html/dash_table components, React 16 and 18, and # their async chunks such as MathJax and plotly.js loaders). It is not rebuilt from npm sources here; building Dash's JS from source is a large # separate effort. dash itself is MIT; the individual licences of the bundled JavaScript (each chunk has a .LICENSE.txt beside it) have NOT been # audited for this package, so the License field covers Dash's own code only. %global pypi_name dash Name: python-%{pypi_name} Version: 4.4.1 Release: 1%{?dist} Summary: Python framework for building reactive web apps (Plotly Dash) License: MIT URL: https://dash.plotly.com Source0: %{pypi_source %{pypi_name}} BuildArch: noarch BuildRequires: python3-devel %global _description %{expand: Dash is a Python framework for building analytical web applications with Flask on the back end and React on the front end, without writing JavaScript. This package contains Dash's prebuilt JavaScript front end.} %description %_description %package -n python3-%{pypi_name} Summary: %{summary} %description -n python3-%{pypi_name} %_description %prep %autosetup -n %{pypi_name}-%{version} %generate_buildrequires %pyproject_buildrequires %build %pyproject_wheel %install %pyproject_install %pyproject_save_files %{pypi_name} # The wheel also installs build tooling under generic names (/usr/bin/renderer, /usr/bin/plotly) and Jupyter notebook/lab integration (with a /usr/etc path). # fsl_mrs_summarise needs none of it, and generic command names invite file conflicts, so they are not packaged. rm -f %{buildroot}%{_bindir}/renderer %{buildroot}%{_bindir}/plotly rm -rf %{buildroot}%{_prefix}/etc/jupyter %{buildroot}%{_datadir}/jupyter %check %pyproject_check_import -e 'dash.testing*' -e 'dash.development*' -e 'dash._plotly_cli' -e 'dash.long_callback.managers*' -e 'dash.background_callback.managers*' # No browser here, so drive the app through Flask's test client: layout serialisation, the dependency graph, and a callback round trip over # Dash's real HTTP protocol (/_dash-update-component). export PYTHONPATH=%{buildroot}%{python3_sitelib} %{python3} -sP - <<'PY' import json from dash import Dash, html, dcc, Input, Output app = Dash(__name__) app.layout = html.Div([dcc.Input(id="inp", value="abc", type="text"), html.Div(id="out"), dcc.Graph(id="g", figure={"data": [{"y": [1, 2, 3]}]})]) @app.callback(Output("out", "children"), Input("inp", "value")) def shout(v): return v.upper() c = app.server.test_client() r = c.get("/_dash-layout"); assert r.status_code == 200, r.status_code lay = r.get_json(); assert lay["type"] == "Div" and len(lay["props"]["children"]) == 3, lay r = c.get("/_dash-dependencies"); assert r.status_code == 200 deps = r.get_json(); assert len(deps) == 1 and deps[0]["output"] == "out.children", deps body = {"output": "out.children", "outputs": {"id": "out", "property": "children"}, "inputs": [{"id": "inp", "property": "value", "value": "dash works"}], "changedPropIds": ["inp.value"]} r = c.post("/_dash-update-component", data=json.dumps(body), content_type="application/json") assert r.status_code == 200, (r.status_code, r.data[:200]) assert r.get_json()["response"]["out"]["children"] == "DASH WORKS", r.get_json() r = c.get("/"); assert r.status_code == 200 and b"_dash-config" in r.data and b"dash-renderer" in r.data.lower().replace(b"_", b"-"), r.status_code print("dash HTTP round-trip check passed") PY %files -n python3-%{pypi_name} -f %{pyproject_files} %license LICENSE %doc README.md %{_bindir}/dash-generate-components %{_bindir}/dash-update-components %changelog * Fri Oct 09 2026 Morgan Hough - 4.4.1-1 - Initial package: Dash 4.4.1 from the sdist (prebuilt JavaScript front end, not rebuilt from npm; its bundled licences are not audited), the version FMRIB's installer ships for fsl_mrs_summarise. Free project (MIT). %%check drives the app through Flask's test client (layout, dependency graph, a callback round trip over /_dash-update-component); no browser is available, so rendering in a browser is NOT tested, and upstream's own suite needs Chrome and is not run. Not packaged: /usr/bin/renderer and /usr/bin/plotly (generic names, build tooling) and the Jupyter notebook/lab integration files.