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
Based on this issue I understand that the workflow for dependency handling during package development is that you:
restore() to install Imports dependencies of the package being developed.
install() to install Suggests dependencies, eg. packages lige devtools, usethis and testthat.
At this point I can meaningfully work on the package whose source dir I'm in.
(btw why should the intended renv workflow have two steps for a single operation?)
However when I run renv::snapshot() in the source dir, this happens:
> renv::settings$snapshot.type()
[1] "explicit"
> renv::snapshot()
The following required packages are not installed:
- BiocManager [required by renv]
- callr [required by withr]
- cli [required by renv]
- conflicted [required by here]
- covr [required by fs, here, renv, and 1 other]
- cpp11 [required by renv]
- crayon [required by fs]
- DBI [required by withr]
- devtools [required by renv]
- gitcreds [required by renv]
- jsonlite [required by renv]
- jsonvalidate [required by renv]
- knitr [required by fs, here, renv, and 2 others]
- lifecycle [required by rprojroot]
- miniUI [required by renv]
- mockr [required by rprojroot]
- modules [required by renv]
- packrat [required by renv]
- pak [required by renv]
- palmerpenguins [required by here]
- pillar [required by fs]
- plyr [required by here]
- R6 [required by renv]
- readr [required by here]
- remotes [required by renv]
- reticulate [required by renv]
- rlang [required by here, rprojroot, withr]
- rmarkdown [required by fs, here, renv, and 2 others]
- RSQLite [required by withr]
- rstudioapi [required by renv]
- shiny [required by renv]
- spelling [required by fs]
- testthat [required by fs, here, renv, and 2 others]
- tibble [required by fs]
- uuid [required by here, renv]
- vctrs [required by fs]
- waldo [required by renv]
- webfakes [required by renv]
- yaml [required by renv]
Consider reinstalling these packages before snapshotting the lockfile.
Do you want to proceed? [Y/n]:
- The lockfile is already up to date.
>
Why would snapshot suggest (re)installing all these packages before snapshoting, when snapshoting isnt going to record them any way, since I'm in explicit mode?
How can I even install all those packages short of mouse-drag-select copying, putting string quotes around each of them, comma separating and pasting them into a very manual renv::install call? (renv::install() does not do it)
Why not limit this advice/suggestion to the Suggests field instead? That would produce actual useful advice as opposed to this list, and it would produce a list of packages that renv::install() actually installs for you.
And finally a minor thing: Few, or none, of the packages listed are required by these packages, as stated. They are typically Suggested in those packages.
I'm trying to help set up meaningful workflows for colleagues with renv when developing R packages, and this is confusing. (Personally I can live with just ignoring the above as misplaced advice, but if someone had presented this as a normal worfklow to me, I would definitely have asked the meaning of all this)
On a related note, why don't renv::restore() restore the Suggests: field in DESCRIPTION? If I ever find myself needing to do renv::restore() in a source dir of an R package (which is where DESCRIPTION belongs), surely I'd be in a situation where I intend to develop this package, and I'd then need those Suggests dependencies (eg. testthat and devtools). If I just want to "try" a package without installing it, I'd run devtools::load_all() in the source dir, which would handle the dependencies for me.
In fact, when would you ever be in the source dir of an R package and need to restore only the formal package dependencies?
(This final question belongs in that other issue but I thought I wouldn't revive that old and completed issue)
The text was updated successfully, but these errors were encountered:
Based on this issue I understand that the workflow for dependency handling during package development is that you:
Imports
dependencies of the package being developed.Suggests
dependencies, eg. packages lige devtools, usethis and testthat.At this point I can meaningfully work on the package whose source dir I'm in.
(btw why should the intended renv workflow have two steps for a single operation?)
However when I run renv::snapshot() in the source dir, this happens:
My
DESCRIPTION
file has these dependencies:This begs some questions:
explicit
mode?renv::install()
does not do it)Suggests
field instead? That would produce actual useful advice as opposed to this list, and it would produce a list of packages thatrenv::install()
actually installs for you.Suggested
in those packages.I'm trying to help set up meaningful workflows for colleagues with renv when developing R packages, and this is confusing. (Personally I can live with just ignoring the above as misplaced advice, but if someone had presented this as a normal worfklow to me, I would definitely have asked the meaning of all this)
On a related note, why don't
renv::restore()
restore theSuggests:
field inDESCRIPTION
? If I ever find myself needing to dorenv::restore()
in a source dir of an R package (which is where DESCRIPTION belongs), surely I'd be in a situation where I intend to develop this package, and I'd then need those Suggests dependencies (eg. testthat and devtools). If I just want to "try" a package without installing it, I'd rundevtools::load_all()
in the source dir, which would handle the dependencies for me.In fact, when would you ever be in the source dir of an R package and need to restore only the formal package dependencies?
(This final question belongs in that other issue but I thought I wouldn't revive that old and completed issue)
The text was updated successfully, but these errors were encountered: