Skip to content
Prev 6787 / 21312 Next

[Bioc-devel] [devteam-bioc] Use Imports instead of Depends in the DESCRIPTION files of bioconductor packages.

On 12/24/2014 07:31 PM, Maintainer wrote:
R package symbols and other objects are collated at build time into a 'name 
space'. When used,

- Import: loads the name space from disk.
- Depends: loads the name space from disk, and attaches it to the search() path.

Attaching is very inexpensive compared to loading, so there is no speed 
improvement gained by Import'ing instead of Depend'ing.

The main reason to Depend: on a package is because the symbols defined by the 
package are needed by the end-user. Import'ing a package is appropriate when the 
package provides functionality only relevant to the package author.

There are likely to be specific packages that mis-use Depends; packages such as 
IRanges, GenomicRanges, etc use Depends: as intended, to  provide functions that 
are useful to the end user.

Maintainers are certainly encouraged to think carefully about adding packages 
providing functionality irrelevant to the end-user to the Depends: field. The 
codetoolsBioC package (available from svn, see 
http://bioconductor.org/developers/how-to/source-control/) provides some mostly 
reliable hints to package authors about correctly formulating a NAMESPACE file 
to facilitate using Imports: instead of Depends:.

General questions about Bioconductor packages should be addressed to the support 
forum https://support.bioconductor.org.

Questions about Bioconductor development (such as this) should be addressed to 
the bioc-devel mailing list (subscription required) 
https://stat.ethz.ch/mailman/listinfo/bioc-devel.

I have cc'd the bioc-devel mailing list; I hope that is ok.

Martin