rstudio / rsconnect

Publish Shiny Applications, RMarkdown Documents, Jupyter Notebooks, Plumber APIs, and more
http://rstudio.github.io/rsconnect/
131 stars 80 forks source link

deployDoc does not include local requirements.txt file in the bundle #919

Closed samperman closed 1 year ago

samperman commented 1 year ago

I have an rmarkdown document using reticulate and also created my own requirements.txt file. If I run the following:

rsconnect::deployDoc("mydoc.Rmd", ...)

the resulting bundle includes a requirements.txt file that was generated by rsconnect rather than the one I had created.

As a workaround, this will do what i want:

rsconnect::deployApp(appDir = getwd(), appPrimaryDoc = "mydoc.Rmd", appFiles = c("mydoc.Rmd", "requirements.txt"), ...)
aronatkins commented 1 year ago

This is happening because deployDoc uses rmarkdown::find_external_resources to scan the document for external dependencies; we do not incorporate additional, unreferenced files that live alongside the document.

https://github.com/rstudio/rsconnect/blob/647bb4def63db199be547c0c48603bc511db3686/R/deployDoc.R#L51-L75

hadley commented 1 year ago

We could/should special case requirements.txt in the same way as .Rprofile.