aarongraybill / personal_website

Housing for my personal website
0 stars 0 forks source link

Better handling of dependencies in mini_projects #5

Open aarongraybill opened 2 months ago

aarongraybill commented 2 months ago

I was hoping that quarto and renv would tightly integrate, but that appears not to be the case. The details of this are still quite fuzzy to me, but as far as I can tell, there is really no way for main website directory's renv (here personal_website) to be overtaken by a subdirectory's renv (eg personal_website/mini_projects/quiz_with_balls). Going forward when working on additional mini projects, I want to see if there's a decent way to isolate the dependencies for a mini project.

aarongraybill commented 2 months ago

If a mini_project only uses R, it looks like the best way to handle dependencies is to put an un-included chunk that does source('renv/activate.R') (it seems to be able to figure out that you mean the mini_project renv, and not "personal_website".

As for doing joint python and R. before getting in too deep with the python, it appears that you want to do renv::install('reticulate'). Then renv::use_python(type = "virtualenv",name="_venv"). The _venv makes sure that quarto doesn't try to include this rather large folder in the website's content. Somehow, doing source('renv/activate.R) also takes care of activating the venv for this qmd.

This totally runs contrary to my previous experience trying to get The Quiz With Balls document up and running.

I think that the best MO going forward is to never hit this button: image

This render button has all some undesirable side effects like: