voila-dashboards / voila

Voilà turns Jupyter notebooks into standalone web applications
https://voila.readthedocs.io
Other
5.31k stars 497 forks source link

Incorrect font used with ipywidgets8 and voila 0.4 #1460

Open iisakkirotko opened 2 months ago

iisakkirotko commented 2 months ago

Description

The font family that is loaded with ipywidgets 8 together with voila 0.4 seems to be incorrect, see the below screenshots, the first from jupyter notebook, and the second one from Voila

image

image

Reproduce

Install ipywidgets 8 and Voila 0.4, and run

import ipywidgets as widgets

slider = widgets.FloatSlider(value=7.5, min=5.0, max=10.0, step=0.1, description="FloatSlider")
slider

We found this bug while working on CI for Solara, see widgetti/solara#590

Expected behavior

We expect the same font to be used in notebook and Voila

Context

Troubleshoot Output

```
$PATH:
        /Users/x/micromamba/envs/voila-bug/bin
        /Users/x/micromamba/condabin
        /opt/homebrew/bin
        /opt/homebrew/sbin
        /usr/local/bin
        /System/Cryptexes/App/usr/bin
        /usr/bin
        /bin
        /usr/sbin
        /sbin
        /var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin
        /var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin
        /var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin

sys.path:
        /Users/x/micromamba/envs/voila-bug/bin
        /Users/x/micromamba/envs/voila-bug/lib/python310.zip
        /Users/x/micromamba/envs/voila-bug/lib/python3.10
        /Users/x/micromamba/envs/voila-bug/lib/python3.10/lib-dynload
        /Users/x/.local/lib/python3.10/site-packages
        /Users/x/micromamba/envs/voila-bug/lib/python3.10/site-packages

sys.executable:
        /Users/x/micromamba/envs/voila-bug/bin/python

sys.version:
        3.10.14 | packaged by conda-forge | (main, Mar 20 2024, 12:51:49) [Clang 16.0.6 ]

platform.platform():
        macOS-14.2.1-arm64-arm-64bit

which -a jupyter:
        /Users/x/micromamba/envs/voila-bug/bin/jupyter

pip list:
        Package                   Version
        ------------------------- --------------
        aiofiles                  22.1.0
        aiosqlite                 0.19.0
        anyio                     4.3.0
        appnope                   0.1.4
        argon2-cffi               23.1.0
        argon2-cffi-bindings      21.2.0
        arrow                     1.3.0
        asttokens                 2.4.1
        attrs                     23.2.0
        Babel                     2.14.0
        beautifulsoup4            4.12.3
        bleach                    6.1.0
        Brotli                    1.1.0
        cached-property           1.5.2
        certifi                   2024.2.2
        cffi                      1.16.0
        charset-normalizer        3.3.2
        comm                      0.2.2
        debugpy                   1.8.1
        decorator                 5.1.1
        defusedxml                0.7.1
        entrypoints               0.4
        exceptiongroup            1.2.0
        executing                 2.0.1
        fastjsonschema            2.19.1
        fqdn                      1.5.1
        idna                      3.6
        importlib_metadata        7.1.0
        importlib_resources       6.4.0
        ipykernel                 6.29.3
        ipython                   8.21.0
        ipython-genutils          0.2.0
        ipywidgets                8.1.2
        isoduration               20.11.0
        jedi                      0.19.1
        Jinja2                    3.1.3
        json5                     0.9.24
        jsonpointer               2.4
        jsonschema                4.21.1
        jsonschema-specifications 2023.12.1
        jupyter_client            8.6.1
        jupyter_core              5.7.2
        jupyter-events            0.10.0
        jupyter_server            2.13.0
        jupyter_server_fileid     0.9.1
        jupyter_server_terminals  0.5.3
        jupyter_server_ydoc       0.8.0
        jupyter-ydoc              0.2.4
        jupyterlab                3.6.7
        jupyterlab_pygments       0.3.0
        jupyterlab_server         2.26.0
        jupyterlab_widgets        3.0.10
        MarkupSafe                2.1.5
        matplotlib-inline         0.1.6
        mistune                   3.0.2
        nbclassic                 1.0.0
        nbclient                  0.7.4
        nbconvert                 7.16.3
        nbformat                  5.10.4
        nest_asyncio              1.6.0
        notebook                  6.5.4
        notebook_shim             0.2.4
        overrides                 7.7.0
        packaging                 24.0
        pandocfilters             1.5.0
        parso                     0.8.4
        pexpect                   4.9.0
        pickleshare               0.7.5
        pip                       24.0
        pkgutil_resolve_name      1.3.10
        platformdirs              4.2.0
        prometheus_client         0.20.0
        prompt-toolkit            3.0.42
        psutil                    5.9.8
        ptyprocess                0.7.0
        pure-eval                 0.2.2
        pycparser                 2.22
        Pygments                  2.17.2
        pyobjc-core               10.2
        pyobjc-framework-Cocoa    10.2
        PySocks                   1.7.1
        python-dateutil           2.9.0
        python-json-logger        2.0.7
        pytz                      2024.1
        PyYAML                    6.0.1
        pyzmq                     25.1.2
        referencing               0.34.0
        requests                  2.31.0
        rfc3339-validator         0.1.4
        rfc3986-validator         0.1.1
        rpds-py                   0.18.0
        Send2Trash                1.8.3
        setuptools                69.2.0
        six                       1.16.0
        sniffio                   1.3.1
        soupsieve                 2.5
        stack-data                0.6.2
        terminado                 0.18.1
        tinycss2                  1.2.1
        tomli                     2.0.1
        tornado                   6.4
        traitlets                 5.9.0
        types-python-dateutil     2.9.0.20240316
        typing_extensions         4.11.0
        typing-utils              0.1.0
        uri-template              1.3.0
        urllib3                   2.2.1
        voila                     0.4.4
        wcwidth                   0.2.13
        webcolors                 1.13
        webencodings              0.5.1
        websocket-client          1.7.0
        websockets                12.0
        wheel                     0.43.0
        widgetsnbextension        4.0.10
        y-py                      0.5.9
        ypy-websocket             0.8.2
        zipp                      3.17.0
```

Command Line Output

```
[Voila] Using /var/folders/y8/j3_6h7d54nbd3td2dnxnt0x80000gn/T to store connection files
[Voila] Storing connection files in /var/folders/y8/j3_6h7d54nbd3td2dnxnt0x80000gn/T/voila_f0wj6hhi.
[Voila] Serving static files from /Users/x/micromamba/envs/voila-bug/lib/python3.10/site-packages/voila/static.
[Voila] Voilà is running at:
http://localhost:8866/
[Voila] Kernel started: e9f07e0b-afc6-4279-9ce0-f59c38c05205
403 GET /voila/files/favicon.ico (::1): File not whitelisted
403 GET /voila/files/favicon.ico (::1) 0.36ms
[Voila] Connecting to kernel e9f07e0b-afc6-4279-9ce0-f59c38c05205.
```

Browser Output

```
Starting WebSocket: ws://localhost:8866/api/kernels/d0cd9a46-e2a8-4349-b387-415779acb84f
```