[Bioc-devel] Why can't NAMESPACE be a strict subset of DESCRIPTION Imports?

McDavid, Andrew Andrew_Mcdavid at URMC.Rochester.edu
Tue Oct 4 23:07:00 CEST 2016


BiocCheck throws a warning when a package is listed as Imports: in DESCRIPTION but not used in the NAMESPACE.  This may happen when a developer uses the fully qualified names of objects within a package.  I am unclear as to the rationale for this warning.

Per Hadley:

It's common for packages to be listed in Imports in DESCRIPTION, but not in NAMESPACE. In fact, this is what I recommend: list the package in DESCRIPTION so that it's installed, then always refer to it explicitly with pkg::fun(). Unless there is a strong reason not to, it's better to be explicit. It's a little more work to write, but a lot easier to read when you come back to the code in the future.

Per R extensions:

If a package only needs a few objects from another package it can use a fully qualified variable reference in the code instead of a formal import. A fully qualified reference to the function f in package foo is of the form foo::f.

-Andrew


	[[alternative HTML version deleted]]



More information about the Bioc-devel mailing list