[R-pkg-devel] nit-picking about CRAN repository policy
Duncan Murdoch
murdoch@dunc@n @end|ng |rom gm@||@com
Sun May 8 01:38:19 CEST 2022
On 07/05/2022 7:30 p.m., Ben Bolker wrote:
>
>
> On 2022-05-07 7:17 p.m., Duncan Murdoch wrote:
>> On 07/05/2022 6:43 p.m., Ben Bolker wrote:
>>>
>>> Folks,
>>>
>>> CRAN has recently set up an auxiliary 'noSuggests' test platform that
>>> tests that packages are using suggested packages conditionally, as
>>> recommended in Writing R Extensions, and as (sort of) specified in the
>>> CRAN repository policy.
>>>
>>> Specifically, the CRP (revision 5236) says:
>>>
>>> > A package listed in ‘Suggests’ or ‘Enhances’ should be used
>>> conditionally in examples or tests if it cannot straightforwardly be
>>> installed on the major R platforms. (‘Writing R Extensions’ recommends
>>> that they are always used conditionally.)
>>>
>>> One of my packages failed on the 'noSuggest' test platform
>>> <https://www.stats.ox.ac.uk/pub/bdr/noSuggests/bbmle.out> because two
>>> suggested packages were used unconditionally in the vignette. There are
>>> two reasons (IMO) that this should *not* have triggered a threat of
>>> archiving:
>>>
>>> (1) the unconditional package use was in a vignette, not in examples
>>> or tests
>>> (2) the relevant packages (AICcmodavg and MuMIn) are available on
>>> CRAN and install easily on Linux/Windows/MacOS (they are R-only, no
>>> compiled code or extra requirements, binaries are available on CRAN).
>>>
>>> Is it worth suggesting to CRAN maintainers that either they refine
>>> their 'noSuggests' test so that it conforms to the wording in the CRP,
>>> or that they change the CRP wording to something stricter like
>>>
>>> > Any package listed in ‘Suggests’ or ‘Enhances’ should be used
>>> conditionally in examples, tests, and vignettes.
>>
>> I wouldn't think it's worth the time, but you could submit a suggested
>> patch to them if you feel like it.
>>
>> Personally I'd take a more extreme position than theirs: your package
>> should check without errors if any subset of the Suggests packages is
>> installed. This isn't practical to test, but "all" and "none" is at
>> least something.
>>
>> With vignette formats based on knitr, it's very easy to implement this.
>> Just add a code chunk at the beginning with code like this:
>>
>> if (!requireNamespace("sug1") ||
>> !requireNamespace("sug2")) {
>> warning(call. = FALSE, "This vignette requires sug1 and sug2 to be
>> installed")
>> knitr::knit_exit()
>> }
>>
>> I don't know if other vignette engines make it so easy to bail out, but
>> they should.
>>
>> Duncan Murdoch
>
>
> Thanks.
>
> Fixing the problems isn't difficult or unreasonable (I will do it in
> a more subtle way, running chunks of code conditionally). I'm just
> feeling a little bit grumpy/defensive because:
>
> * CRAN asked me to submit a patched version before May 7
> * I submitted a patched version to CRAN at 7:30 PM local time on May 6
> (which is admittedly May 7 in UK/European time)
> * I woke up to an e-mail from CRAN to me and 50 downstream package
> maintainers saying that my package was scheduled for archiving, and a
> concerned message from a downstream package maintainer ...
As far as I know, the folks at CRAN are *always* grumpy.
Duncan
More information about the R-package-devel
mailing list