You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Manifest generation for projects only using Python in pre-rendering should include Python #408
I have a project in which I only use a Python script in pre-rendering, but not in any .qmd files. Generating a manifest through:
rsconnect write-manifest quarto . --overwrite
causes the "python" section to not appear, which prevents the requirements.txt from being included, and it seems no Python environment is set up when deploying. The pre-render scripts then fail because they can't import my dependencies.
As a workaround I just added an empty Python cell to one of my .qmd files.
It would be nice if the manifest would also include Python things when there are Python scripts used in pre-rendering.
rsconnect-python relies on the output from quarto inspect. The Python environment is included with the manifest when Quarto indicates that the "jupyter" engine is in use.
We will reach out to the Quarto folks to try to understand if there is another way to determine that a Python environment is required.
Would you be able to share a minimal example showing what you are attempting?
I think it would be nice if rsconnect also checks whether Python is used in any pre- or post-render scripts such that it would produce the manifest as shown in step 4.
Just to be sure, I am aware there are things like ojs_define to pass data from Python cells to OJS cells, but in my actual project the pre-render step is of significant size.
Thanks @johanpel - we'll discuss and figure out how to solve your example. It might be that we need to let you "force" the Python environment even though the document itself does not demand one.
Activity
aronatkins commentedon Apr 14, 2023
rsconnect-python relies on the output from
quarto inspect. The Python environment is included with the manifest when Quarto indicates that the "jupyter" engine is in use.We will reach out to the Quarto folks to try to understand if there is another way to determine that a Python environment is required.
Would you be able to share a minimal example showing what you are attempting?
johanpel commentedon Apr 17, 2023
index.qmd:pre_render.py:_quarto.yml:requirements.txt:Run
rsconnect write-manifest quarto .Manifest now looks as follows:
{ "version": 1, "metadata": { "appmode": "quarto-static" }, "quarto": { "version": "1.2.335", "engines": [ "markdown" ] }, "files": { "_quarto.yml": { "checksum": "b61e2f198e56a15e733b4ee9535dd26a" }, "index.qmd": { "checksum": "94f105523bbe9288351afdd5ec53c71f" }, "pre_render.py": { "checksum": "8d0cbc2773a63a0e14864722ac01668c" }, "requirements.txt": { "checksum": "2f19884f14598d8de5efae75e6d86a7c" } } }{ "version": 1, "locale": "en_US.UTF-8", "metadata": { "appmode": "quarto-static" }, "quarto": { "version": "1.2.335", "engines": [ "jupyter" ] }, "python": { "version": "3.10.6", "package_manager": { "name": "pip", "version": "23.0.1", "package_file": "requirements.txt" } }, "files": { "_quarto.yml": { "checksum": "b61e2f198e56a15e733b4ee9535dd26a" }, "index.qmd": { "checksum": "5fc4682fa23cf39436031e6d570fafab" }, "pre_render.py": { "checksum": "8d0cbc2773a63a0e14864722ac01668c" }, "requirements.txt": { "checksum": "2f19884f14598d8de5efae75e6d86a7c" } } }I think it would be nice if
rsconnectalso checks whether Python is used in any pre- or post-render scripts such that it would produce the manifest as shown in step 4.Just to be sure, I am aware there are things like
ojs_defineto pass data from Python cells to OJS cells, but in my actual project the pre-render step is of significant size.aronatkins commentedon Apr 18, 2023
Thanks @johanpel - we'll discuss and figure out how to solve your example. It might be that we need to let you "force" the Python environment even though the document itself does not demand one.