[R-pkg-devel] When are import version requirements checked?

Duncan Murdoch murdoch@dunc@n @end|ng |rom gm@||@com
Fri Mar 26 14:51:10 CET 2021


Recently I contributed some changes to the pkgdown and downlit packages. 
  The new pkgdown changes require the new downlit changes in order to 
work.  These are still both only on Github, in r-lib/pkgdown and 
r-lib/downlit respectively.

pkgdown lists downlit in the Imports section of DESCRIPTION, but doesn't 
import anything from it:  all calls use the :: syntax, e.g. 
downlit::highlight.

Clearly pkgdown should add a version dependency to its Imports line 
since the old downlit doesn't work.  What I was surprised to find was 
that R pretty much ignores that line.  I can install downlit 0.2.1 from 
CRAN, and put

   downlit (>= 0.2.1.9000),

into the Imports field in DESCRIPTION, and then install the devel 
version of pkgdown without any complaints from R, e.g.

   > packageVersion("downlit")
   [1] ‘0.2.1’
   > install.packages("~/pkgdown_1.6.1.9001.tar.gz", repos=NULL, type = 
"source")
   * installing *source* package ‘pkgdown’ ...
   ** using staged installation
   ** R
   ** inst
   ** byte-compile and prepare package for lazy loading
   ** help
   *** installing help indices
   *** copying figures
   ** building package indices
   ** installing vignettes
   ** testing if installed package can be loaded from temporary location
   ** testing if installed package can be loaded from final location
   ** testing if installed package keeps a record of temporary 
installation path
   * DONE (pkgdown)
   > library(pkgdown)
   >

The first sign of a problem comes when I try to use the modified function:

   > build_reference()
     ... [ lots deleted ] ...
   Error: Failed to parse Rd in build_site.Rd
   ℹ unused argument (output_handler = 
evaluate::new_output_handler(value = pkgdown_print))
   Run `rlang::last_error()` to see where the error occurred.

The problem here is that the "output_handler" argument is new in downlit 
0.2.1.9000, and we aren't using that version.

Should R object to the incompatible versions here?

Duncan Murdoch



More information about the R-package-devel mailing list