[R-pkg-devel] Handling Not-Always-Needed Dependencies? - Part 2

Paul Gilbert pgilbert902 at gmail.com
Thu Aug 4 19:57:26 CEST 2016



On 08/04/2016 11:51 AM, Dirk Eddelbuettel wrote:
>
> On 4 August 2016 at 11:46, Paul Gilbert wrote:
> | If my package has a test that needs another package, but that package is
> | not needed in the /R code of my package, then I indicate it as
> | "Suggests", not as "Depends" nor as "Imports".  If that package is not
> | available when I run R CMD check, should the test pass?
>
> Wrong question.
>
> Better question:  Should the test be running?  My preference is for only
> inside of a requireNamespace() (or equivalent) block as the package is not
> guaranteed to be present.  In theory.

At the level of R CMD check throwing an error or not, I think this is 
arguing that it should be possible to pass the tests (not throw an 
error) even though they are not run, isn't it? (So your answer to my 
question is yes, at least the way I was thinking of the question.) Or do 
you mean you would just like the tests to fail with a more appropriate 
error message? Or do you mean, as Duncan suggests, that the person 
writing the test should be allowed to code in something to decide if the 
test is really important or not?

>
> In practice people seem to unconditionally install it anyway, and think that
> is a good idea.  I disagree on both counts but remain in the vocal minority.

Actually, I think you are in agreement with Uwe and Duncan on this 
point, Duncan having added the refinement that the test writer gets to 
decide. No one so far seems to be advocating for my position that the 
tests should necessarily fail if they cannot be run. So I guess I am the 
one in the minority.

Paul
>
> Dirk
>



More information about the R-package-devel mailing list