Skip to content

deploy notebook --static requires a requirements file it never uses #923

Open

Description

@tdstein

Problem

rsconnect deploy notebook --static requires a requirements file (or --force-generate), even though the static bundle contains only the rendered HTML and Connect never builds a Python environment for it.

$ rsconnect deploy notebook --static nb.ipynb
Error: The requirements file 'requirements.txt' does not exist in '.'.
Please create the file or specify a different file with --requirements-file.
To have the requirements file generated using pip freeze, pass --force-generate.

Reproduce (main @ 01878e8)

In a directory containing only nb.ipynb, with nbconvert and ipykernel installed in the active Python:

rsconnect deploy notebook --static nb.ipynb                     # fails as above
rsconnect deploy notebook --static --force-generate nb.ipynb    # works

With --force-generate, the deployed bundle contains only nb.html and a manifest.json with appmode: static and no python section. The generated requirements are computed and then discarded.

Cause

deploy_notebook calls resolve_requirements_file(...) and Environment.create_python_environment(...) before branching on static (main.py#L2195-L2202). The static path only needs the environment's interpreter, to run nbconvert locally.

Expected

--static doesn't require or generate a requirements file. It only needs a Python interpreter with nbconvert to render the notebook.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions