[R-pkg-devel] PkgA imports PkgB, and PkgB suggests PkgA?

Iñaki Ucar |uc@r @end|ng |rom |edor@project@org
Sat Nov 4 09:41:07 CET 2023


El sáb., 4 nov. 2023 5:43, Shu Fai Cheung <shufai.cheung using gmail.com>
escribió:

> Hi All,
>
> I vaguely recall that, on CRAN, if PkgA imports PkgB, then PkgB cannot
> import PkgA. (Please correct me if I am wrong.)
>
> How about this?
>
> PkgA imports PkgB (because PkgA has some helper functions for using PkgB)
> PkgB suggests PkgA (because some vignettes or examples in PkgB use
> those helpers from PkgA)
>

Or some tests are based on PkgA, or...

Is this allowed on CRAN?
>

Yes, it is. For example: testthat imports a bunch of packages to do is
thing, and those packages suggest testthat because their test suite is
based on it.

Cycles of hard dependencies (Depends, Imports) are not allowed for obvious
reasons. But packages should install and work without soft dependencies, so
there's no problem there.

Iñaki

	[[alternative HTML version deleted]]



More information about the R-package-devel mailing list