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

papyri render fails with empty template #326

Closed
melissawm opened this issue Nov 12, 2023 · 1 comment · Fixed by #327
Closed

papyri render fails with empty template #326

melissawm opened this issue Nov 12, 2023 · 1 comment · Fixed by #327
Labels
bug Something isn't working

Comments

@melissawm
Copy link
Collaborator

Currently, running papyri render results in the following:

$ papyri render

  ___                    _
 | _ \__ _ _ __ _  _ _ _(_)
 |  _/ _` | '_ \ || | '_| |
 |_| \__,_| .__/\_, |_| |_|
          |_|   |__/

0.0.8
[19:32:54] INFO     going to erase /home/melissa/.papyri/html                                                                                                             render.py:1365
Rendering galleries... Done    1 items in 0.03 seconds (   35 item/s)
Rendering Examples... Done    0 items in 0.00 seconds (    0 item/s)
Copying assets Done   28 items in 0.00 seconds ( 6860 item/s)
Rendering Narrative... Done    0 items in 0.00 seconds (    0 item/s)
Traceback (most recent call last):
  File "/home/melissa/projects/papyri/papyri/render.py", line 592, in render_one
    return template.render(
           ^^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'render'

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/home/melissa/micromamba/envs/papyri/bin/papyri", line 8, in <module>
    sys.exit(app())
             ^^^^^
  File "/home/melissa/micromamba/envs/papyri/lib/python3.11/site-packages/typer/main.py", line 328, in __call__
    raise e
  File "/home/melissa/micromamba/envs/papyri/lib/python3.11/site-packages/typer/main.py", line 311, in __call__
    return get_command(self)(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/melissa/micromamba/envs/papyri/lib/python3.11/site-packages/click/core.py", line 1157, in __call__
    return self.main(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/melissa/micromamba/envs/papyri/lib/python3.11/site-packages/typer/core.py", line 778, in main
    return _main(
           ^^^^^^
  File "/home/melissa/micromamba/envs/papyri/lib/python3.11/site-packages/typer/core.py", line 216, in _main
    rv = self.invoke(ctx)
         ^^^^^^^^^^^^^^^^
  File "/home/melissa/micromamba/envs/papyri/lib/python3.11/site-packages/click/core.py", line 1688, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/melissa/micromamba/envs/papyri/lib/python3.11/site-packages/click/core.py", line 1434, in invoke
    return ctx.invoke(self.callback, **ctx.params)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/melissa/micromamba/envs/papyri/lib/python3.11/site-packages/click/core.py", line 783, in invoke
    return __callback(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/melissa/micromamba/envs/papyri/lib/python3.11/site-packages/typer/main.py", line 683, in wrapper
    return callback(**use_params)  # type: ignore
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/home/melissa/projects/papyri/papyri/__init__.py", line 509, in render
    trio.run(m2, ascii, html, dry_run, sidebar, graph, minify)
  File "/home/melissa/micromamba/envs/papyri/lib/python3.11/site-packages/trio/_core/_run.py", line 2093, in run
    raise runner.main_task_outcome.error
  File "/home/melissa/projects/papyri/papyri/render.py", line 1384, in main
    await html_renderer._write_api_file(
  File "/home/melissa/projects/papyri/papyri/render.py", line 772, in _write_api_file
    data = self.render_one(
           ^^^^^^^^^^^^^^^^
  File "/home/melissa/projects/papyri/papyri/render.py", line 608, in render_one
    raise ValueError("qa=", qa) from e
ValueError: ('qa=', 'numpy:savez')

It seems like this was introduced by https://github.com/jupyter/papyri/pull/319/files# (see lines 749-752), which creates an empty template for an html renderer.

More importantly: this did not fail CI - should we add at least a smoke test for rendering?

@melissawm melissawm added the bug Something isn't working label Nov 12, 2023
Carreau added a commit that referenced this issue Nov 13, 2023
@Carreau
Copy link
Member

Carreau commented Nov 13, 2023

Ah sorry, I did a fix locally I forgot to push. Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants