Quansight-Labs/jupyterlab-accessible-themes

Missing schema when changing theme

trallard opened this issue · 1 comments

This has been a persistent issue when installing the themes in development mode and through pip in a clean conda environment.

As soon as the user changes the theme to Pitaya Smoothie, the terminal throws the following missing schema error.

[W 2023-06-27 12:59:02.352 ServerApp] 404 GET /lab/api/settings/jupyterlab-accessible-themes:pitayasmoothie?1687867142302 (::1): Schema not found: /Users/tania/mambaforge/envs/jat-pip-installed/share/jupyter/lab/schemas/jupyterlab-accessible-themes/pitayasmoothie.json
[W 2023-06-27 12:59:02.352 LabApp] wrote error: 'Schema not found: /Users/tania/mambaforge/envs/jat-pip-installed/share/jupyter/lab/schemas/jupyterlab-accessible-themes/pitayasmoothie.json'
    Traceback (most recent call last):
      File "/Users/tania/mambaforge/envs/jat-pip-installed/lib/python3.11/site-packages/tornado/web.py", line 1784, in _execute
        result = method(*self.path_args, **self.path_kwargs)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/Users/tania/mambaforge/envs/jat-pip-installed/lib/python3.11/site-packages/tornado/web.py", line 3290, in wrapper
        return method(self, *args, **kwargs)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/Users/tania/mambaforge/envs/jat-pip-installed/lib/python3.11/site-packages/jupyterlab_server/settings_handler.py", line 48, in get
        result, warnings = get_settings(
                           ^^^^^^^^^^^^^
      File "/Users/tania/mambaforge/envs/jat-pip-installed/lib/python3.11/site-packages/jupyterlab_server/settings_utils.py", line 370, in get_settings
        schema, version = _get_schema(schemas_dir, schema_name, overrides, labextensions_path)
                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/Users/tania/mambaforge/envs/jat-pip-installed/lib/python3.11/site-packages/jupyterlab_server/settings_utils.py", line 47, in _get_schema
        raise web.HTTPError(404, notfound_error % path)

This indicates something wrong when registering the themes and generating the corresponding metadata.

Steps to reproduce

  1. Create a brand new conda environment
conda create -n jat-pip-installed -c conda-forge jupyterlab=3
conda activate jat-pip-installed
pip install jupyterlab-accessible-themes
jupyter lab
  1. Head to JupyterLab > Settings > Pitaya Smoothie

Now that the GH dark theme has been added, the same schema error pops up

[W 2023-06-29 13:09:22.973 ServerApp] 404 GET /lab/api/settings/jupyterlab-accessible-themes:githubdark?1688040562926 (::1): Schema not found: /Users/tania/mambaforge/envs/jupyterlab-accessible-themes/share/jupyter/lab/schemas/jupyterlab-accessible-themes/githubdark.json
[W 2023-06-29 13:09:22.973 LabApp] wrote error: 'Schema not found: /Users/tania/mambaforge/envs/jupyterlab-accessible-themes/share/jupyter/lab/schemas/jupyterlab-accessible-themes/githubdark.json'
    Traceback (most recent call last):
      File "/Users/tania/mambaforge/envs/jupyterlab-accessible-themes/lib/python3.11/site-packages/tornado/web.py", line 1784, in _execute
        result = method(*self.path_args, **self.path_kwargs)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/Users/tania/mambaforge/envs/jupyterlab-accessible-themes/lib/python3.11/site-packages/tornado/web.py", line 3290, in wrapper
        return method(self, *args, **kwargs)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/Users/tania/mambaforge/envs/jupyterlab-accessible-themes/lib/python3.11/site-packages/jupyterlab_server/settings_handler.py", line 48, in get
        result, warnings = get_settings(
                           ^^^^^^^^^^^^^
      File "/Users/tania/mambaforge/envs/jupyterlab-accessible-themes/lib/python3.11/site-packages/jupyterlab_server/settings_utils.py", line 370, in get_settings
        schema, version = _get_schema(schemas_dir, schema_name, overrides, labextensions_path)
                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/Users/tania/mambaforge/envs/jupyterlab-accessible-themes/lib/python3.11/site-packages/jupyterlab_server/settings_utils.py", line 47, in _get_schema
        raise web.HTTPError(404, notfound_error % path)
    tornado.web.HTTPError: HTTP 404: Not Found (Schema not found: /Users/tania/mambaforge/envs/jupyterlab-accessible-themes/share/jupyter/lab/schemas/jupyterlab-accessible-themes/githubdark.json)