Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pixi run docs-build missing Webdriver #7119

Open
cdeil opened this issue Aug 10, 2024 · 6 comments
Open

pixi run docs-build missing Webdriver #7119

cdeil opened this issue Aug 10, 2024 · 6 comments

Comments

@cdeil
Copy link
Contributor

cdeil commented Aug 10, 2024

I followed https://holoviz-dev.github.io/panel/developer_guide/index.html#documentation to run

panel $ pixi run docs-build 

which ran

✨ Pixi task (_docs-generate in docs): nbsite build --what=html --output=builtdocs --org holoviz --project-name panel

which gave this RuntimeError:

getting thumbnail code for /Users/cdeil/code/oss/panel/examples/reference/widgets/FileDropper.ipynb
Path exists True
Traceback (most recent call last):
  File "/var/folders/6v/0_6nt0pj07x9xjhd8qzkyy700000gn/T/tmp6jv8j0iz", line 67, in <module>
    from nbsite.gallery.thumbnailer import thumbnail;thumbnail(file_dropper, '/Users/cdeil/code/oss/panel/doc/reference/widgets/thumbnails/FileDropper')
                                                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/cdeil/code/oss/panel/.pixi/envs/docs/lib/python3.11/site-packages/nbsite/gallery/thumbnailer.py", line 133, in thumbnail
    obj.save(basename+'.png')
  File "/Users/cdeil/code/oss/panel/panel/viewable.py", line 964, in save
    return save(
           ^^^^^
  File "/Users/cdeil/code/oss/panel/panel/io/save.py", line 270, in save
    return save_png(
           ^^^^^^^^^
  File "/Users/cdeil/code/oss/panel/panel/io/save.py", line 85, in save_png
    state.webdriver = webdriver_control.create()
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/cdeil/code/oss/panel/.pixi/envs/docs/lib/python3.11/site-packages/bokeh/io/webdriver.py", line 180, in create
    driver = self._create(kind, scale_factor=scale_factor)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/cdeil/code/oss/panel/.pixi/envs/docs/lib/python3.11/site-packages/bokeh/io/webdriver.py", line 198, in _create
    raise RuntimeError("Neither firefox and geckodriver nor a variant of chromium browser and " \
RuntimeError: Neither firefox and geckodriver nor a variant of chromium browser and chromedriver are available on system PATH. You can install the former with 'conda install -c conda-forge firefox geckodriver'.
FileDropper thumbnail export failed

and same error for examples/reference/chat/ChatStep.ipynb

Is this a missing dependency in the .pixi/envs/docs spec?

@cdeil
Copy link
Contributor Author

cdeil commented Aug 10, 2024

I get many warnings and errors from the docs build, see full log

Although in the end I think it's just a handful of issues that repeat over and over.

What about this bokeh-plot directive? Why does it not exist for me?
https://gist.github.com/cdeil/9fc1a1cd292948f34fef7bfeb9c77a25#file-gistfile1-txt-L132

docstring of panel.models.icon.ButtonIcon.button_type:4: ERROR: Unknown directive type "bokeh-plot".

.. bokeh-plot::
    :source-position: none

    from bokeh.core.enums import ButtonType

What about the dot command? Is it needed? Should it be added to the .pixi/env/docs install?
https://gist.github.com/cdeil/9fc1a1cd292948f34fef7bfeb9c77a25#file-gistfile1-txt-L518

I'm happy to contribute to the docs e.g. to fix the broken links and cross-references pointed out by Sphinx. But would prefer to have a working local setup first to be able to check any edits.

@hoxbro
Copy link
Member

hoxbro commented Aug 12, 2024

To create the images, firefox and geckodriver are needed in the doc feature.

However, those packages are only needed when new notebooks are added and the images have yet to be uploaded to AWS.

@philippjfr
Copy link
Member

We should just disable the automatic screenshotting, we don't generally use it and the fact that it's failing indicates we haven't uploaded all the thumbnails.

@hoxbro
Copy link
Member

hoxbro commented Aug 12, 2024

The build will not fail, it will keep going but it shows the traceback.

@cdeil
Copy link
Contributor Author

cdeil commented Aug 23, 2024

Build currently fails for me like this on MacOS:

Extension error (nbsite.gallery.gen):
Handler <function generate_gallery_rst at 0x16a231440> for event 'builder-inited' threw an exception (exception: cannot identify image file '/Users/cdeil/code/oss/panel/doc/reference/widgets/thumbnails/FloatSlider.png')
Traceback (most recent call last):
  File "/Users/cdeil/code/oss/panel/.pixi/envs/docs/bin/nbsite", line 10, in <module>
    sys.exit(main())
             ^^^^^^
  File "/Users/cdeil/code/oss/panel/.pixi/envs/docs/lib/python3.11/site-packages/nbsite/__main__.py", line 63, in main
    return args.func(args) if hasattr(args,'func') else parser.error("must supply command to run")
           ^^^^^^^^^^^^^^^
  File "/Users/cdeil/code/oss/panel/.pixi/envs/docs/lib/python3.11/site-packages/nbsite/__main__.py", line 18, in <lambda>
    parser.set_defaults(func=lambda args: fn( **{k: getattr(args,k) for k in vars(args) if k!='func'} ))
                                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/cdeil/code/oss/panel/.pixi/envs/docs/lib/python3.11/site-packages/nbsite/cmd.py", line 92, in build
    subprocess.check_call(["sphinx-build","-b",what,paths['doc'],output], env=merged_env)
  File "/Users/cdeil/code/oss/panel/.pixi/envs/docs/lib/python3.11/subprocess.py", line 413, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['sphinx-build', '-b', 'html', '/Users/cdeil/code/oss/panel/doc', 'builtdocs']' returned non-zero exit status 2.

I see you touched that line here: holoviz-dev/nbsite#311
Maybe that would fix it?

@hoxbro
Copy link
Member

hoxbro commented Aug 24, 2024

Maybe that would fix it?

It would still fail with my change, as the command in the subprocess that is failing. My change would only make it somewhat easier to see it.

I have submitted a PR, which should fix your problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants