[Rd] Suggested dependencies in context of R CMD check
Jan Górecki
J.Gorecki at wit.edu.pl
Mon Apr 4 18:50:42 CEST 2016
Hi Hadley and Gabriel,
What do you think about new field in DESCRIPTION?
For me it does perfect sense to have new field that lists those from
Suggested deps which are truly needed to run check. The same way as
vignetteBuilder. So couldn't be escaped with `if (requireNamespace(.))
...`, or it wouldn't make sense to test the package without them.
This field would not be needed if package author would use `if
(requireNamespace(.)) ...` for all Suggested deps used in tests.
I understand this transition would take quite a long time.
Imagine having 20 suggested deps, and only one of them used in tests.
Many of the other suggested can be tied to system level dependencies,
like databases, etc. And when you are testing rev deps you don't have
much control/knowledge over that.
Current process doesn't scale and I don't see any better way to address it.
Jan
On 4 April 2016 at 16:36, Gabriel Becker <gmbecker at ucdavis.edu> wrote:
> Jan and Hadley,
>
> There's also the issue of tests, vignettes, or examples requiring Suggested
> packages (one of the core applications of Suggests, in fact). These are all
> checked by R CMD check, so to ensure any package which should pass check
> would do so without suggested packages installed would require turning all
> of those checks off, which takes quite a few of the teeth out of R CMD check
> (and thus the assurances granted by knowing a package passes it). AFAIK
> (without going off and checking right now) you /could/ force R CMD check to
> do this now with a combination of options, though, if that's really what you
> want (which would allow your package to pass when _R_CHECK_FORCE_SUGGESTS_
> is set to false).
>
> ~G
>
> On Mon, Apr 4, 2016 at 7:25 AM, Hadley Wickham <h.wickham at gmail.com> wrote:
>>
>> On Sat, Apr 2, 2016 at 5:33 AM, Jan Górecki <J.Gorecki at wit.edu.pl> wrote:
>> > Dear R team,
>> >
>> > Are suggested dependencies mandatory in context of `R CMD check` when
>> > using env var `_R_CHECK_FORCE_SUGGESTS_=FALSE`?
>> >
>> > Suggested dependencies are nice because are optional.
>> > But that feature often isn't valid when trying to run `R CMD check` on
>> > them.
>> > I would like to use `export _R_CHECK_FORCE_SUGGESTS_=FALSE`, which
>> > according to the comment in `tools/R/check.R`:
>> >
>> >> The suggested packages are required for a complete check.
>> > Checking can be attempted without them by setting the environment
>> > variable _R_CHECK_FORCE_SUGGESTS_ to a false value.
>> >
>> > should be sufficient to run *check* process without installing suggested
>> > deps.
>> > If it is not true, then how to differentiate the suggested packages
>> > which are optional from those mandatory?
>> > It would be helpful to have kind of `vignetteBuilder` DESCRIPTION
>> > field called `testChecker`, so DESCRIPTION file could precisely manage
>> > packages dependencies.
>> > That way batch checking packages would be easier, as required dep
>> > metadata would be at hand in description file. Batch checking pkgs
>> > with all their suggests will simply result into testing whole CRAN.
>> >
>> > In a single package it can be handled with `if (requireNamespace(.))
>> > test_package(.)` for `testthat` and `knitr`, also with mocking up
>> > `.Rout` files.
>> >
>> > But I'm interested into canonical design of a suggested package and
>> > `_R_CHECK_FORCE_SUGGESTS_` env var.
>> > Is there any R core dev team recommendation/suggestion on that? and
>> > don't you thing new field `testChecker` in DESCRIPTION could help for
>> > batch checking pkgs? Installing all suggested packages of all reverse
>> > dependencies doesn't scale.
>>
>> In principle, I believe a package should pass R CMD check if no
>> suggested packages are installed. However, since this is not currently
>> automatically checked, many packages will fail to cleanly pass R CMD
>> check if suggested packages are missing. In my experience, it's much
>> easier to simply install all dependencies of your reverse dependencies
>> (although this is obviously much easier when you're using a platform
>> with binary packages available from CRAN). I routinely do this for
>> hundreds to thousands of packages.
>>
>> Hadley
>>
>> --
>> http://hadley.nz
>>
>> ______________________________________________
>> R-devel at r-project.org mailing list
>> https://stat.ethz.ch/mailman/listinfo/r-devel
>
>
>
>
> --
> Gabriel Becker, PhD
> Associate Scientist (Bioinformatics)
> Genentech Research
More information about the R-devel
mailing list