actions icon indicating copy to clipboard operation
actions copied to clipboard

Notes on a `noSuggests`-like workflow

Open DavisVaughan opened this issue 2 years ago • 1 comments

Example workflow for yardstick: https://github.com/tidymodels/yardstick/pull/281/files

A few notes:

  • Running with cache: false to avoid accidentally restoring Suggested dependencies from a pre-existing cache. Using RSPM means this isn't that painful. We could also use the cache and somehow trim down the resulting library of packages to only what is in the pak lockfile.
  • Only running on Linux with r-release (because of cache: false)
  • Sets dependencies: '"hard"' to install Depends, Imports, LinkingTo dependencies, but not Suggests. Suggests dependencies can still be implicitly installed if they are required by any of the hard dependencies.
  • Always installs testthat, knitr, and rmarkdown to be able to run tests and build vignettes. We know the noSuggests build installs testthat, but I imagine it also installs knitr/rmarkdown too.

DavisVaughan avatar Apr 07 '22 13:04 DavisVaughan

In fundiversity, we leverage the power on the new _R_CHECK_DEPENDS_ONLY_TESTS_ environment variable to do this: https://github.com/Bisaloo/fundiversity/pull/49

As documented, testing packages (testthat, tinytest, etc.) are still automatically installed.

We have not really paid attention to the cache issue but it seems that it's still working in spite of this because tests dependent on suggested packages (e.g., memoise) are still skipped in this job.

You can also test setting this env var locally and it will work despite having all the packages in your library.

This requires r-devel at the moment because it was introduced in R 4.2.0.

Bisaloo avatar Apr 11 '22 17:04 Bisaloo

This issue has been automatically locked. If you believe you have found a related problem, please file a new issue and include a link to this issue

github-actions[bot] avatar Nov 04 '22 13:11 github-actions[bot]