posit-dev / publisher

MIT License
3 stars 0 forks source link

Quarto Website not deploying as expected #2266

Open sagerb opened 1 week ago

sagerb commented 1 week ago

From: https://positpbc.slack.com/archives/C05D7NZD52S/p1726064950810009

I have a Quarto website project. I don’t really understand what needs to be considered the “entrypoint” in this context. I’m given my .qmd files, my .py pre-render script, and one rendered HTML file, but the _quarto.yml file (which is the closest option in my mental model) isn’t offered.

Image

I want to deploy this project as source (not rendered) and include the files:

Proceeding with the deployment workflow, it missed the pre-render allocation.py script and did not identify that the project requires R as well as Python. The Quarto inspect output DOES say that knitr is used:

  "engines": [
    "jupyter",
    "markdown",
    "knitr"
  ],

I tried to guess about the [r] syntax:

[r]
version = '4.3.3'

I got an ugly error (attached). The TOML was updated with placeholders which also violated the configuration:

[r]
version = '4.3.3'
package_file = ''
package_manager = ''

Image

I tried to package_manager = 'none' and got a complaint when trying to deploy; I was trying to use my standard library, not renv.

Image

:cry: The deployed manifest does not indicate that Quarto needs the knitr engine and therefore does not cause Connect to install R packages.

    "quarto": {
        "version": "1.5.57",
        "engines": [
            "jupyter",
            "markdown"
        ]
    },

For those following along, I was able to successfully deploy with:

rsconnect::deployApp(server = "rsc.radixu.com", account = "aron", python = file.path(getwd(), "env/bin/python"))

This one is a little awkward because it doesn’t use reticulate. Instead, it uses both the knitr and jupyter engines. rsconnect could do better at detecting the need for Python in this situation.

Note: I still have package_manager = 'none' but renv was required.

See slack link for archive of project, created with:

tar cf mixed.tar --exclude mixed/_site --exclude mixed/env --exclude mixed/renv/library --exclude mixed/.quarto mixed

My Python virtual env was in env.

aronatkins commented 6 days ago

There are a few different problems here:

  1. The concept of "entrypoint" is vague for a Quarto website, and the _quarto.yml file is not offered.
  2. The knitr engine did not imply the use of R (discovered prior to renv initialization)
  3. r.package_manager = 'none' was not the default and did not appear to be respected.
  4. R dependencies were required and shared in the manifest.json, but quarto.engines lacked knitr.