[Rd] Check R version dependency in R CMD Check

Yihui Xie x|e @end|ng |rom y|hu|@n@me
Fri Dec 13 21:52:56 CET 2024


For package authors using Github Action, one reason why they forget to
actually check their packages against the minimal R version specified
in DESCRIPTION may be the use of _relative_ versions in the workflows
like this: https://github.com/r-lib/actions/blob/v2/examples/check-full.yaml
i.e., checking against the 5 last minor releases of R (and this
example workflow says even 5 is likely to be an overkill and
recommends people to test only one old release instead). As a result,
as R makes new releases, packages will not be tested against older
versions of R anymore and package authors won't notice it.

Speaking of guilt, someone has a package that states `Depends: R (>=
3.6.0)` (by coincidence):
https://github.com/yihui/knitr/blob/master/DESCRIPTION#L117 but it's
only checked against R >= 4.0.x (oldrel-4) at the moment:
https://github.com/yihui/knitr/blob/master/.github/workflows/R-CMD-check.yaml#L41

To ensure the package is checked against the minimal R version and
above, we'd have to enumerate all version numbers like this:
https://github.com/yihui/litedown/blob/main/.github/workflows/R-CMD-check.yaml#L19-L29
And this list needs to be updated after each new release of R.

I'm not sure if Jan was proposing to CRAN or package authors for such
checks, but I feel this is primarily the responsibility of package
authors.

Regards,
Yihui

On Fri, Dec 13, 2024 at 1:51 PM Josiah Parry <josiah.parry using gmail.com> wrote:
>
> I’ve been guilty of this myself. I think a check would be good.
>
> In my case I was using the new sort_by() function (I think also 4.1) and a
> user was failing to install on R 4.0.
>
>
> On Fri, Dec 13, 2024 at 11:30 Jan Netík <netikja using gmail.com> wrote:
>
> > Hello,
> >
> > I have a server with R 3.6.3 installed and I struggled a bit with
> > updating several R packages that utilizes some new syntax introduced in R
> > 4.1.0, such as the native pipe |> or function definition shorthand \(x) ...
> >
> > The thing is that these packages states "Depends: R (>= 3.6.0)" and pass R
> > CMD Check without any issues. My problem occurred at the installation time.
> > I can see that developers naturally include the new handy syntax but
> > oftentimes forget to raise R version dependency in their DESCRIPTIONs.
> > Should we employ some new checks?
> >
> > Best,
> > Jan



More information about the R-devel mailing list