From ross at biostat.ucsf.edu  Fri Jan 15 19:17:51 2010
From: ross at biostat.ucsf.edu (Ross Boylan)
Date: Fri, 15 Jan 2010 10:17:51 -0800
Subject: [Rd] optional package dependency (enhances)
In-Reply-To: <e71a39ea1001150248v1d833fc0ma2e63efdacc796a4@mail.gmail.com>
References: <1263535210.26202.16.camel@corn.betterworld.us>
	<e71a39ea1001150248v1d833fc0ma2e63efdacc796a4@mail.gmail.com>
Message-ID: <1263579471.26202.36.camel@corn.betterworld.us>

On Fri, 2010-01-15 at 10:48 +0000, Benilton Carvalho wrote:
> How about using:
> 
> Enhances: Rmpi
> 
> ?
> 
> b
The main reason is that "enhances" seems a peculiar way to describe the
relation between a package that (optionally) uses a piece of
infrastructure and the infrastructure.  Similarly, I would not say that
a car enhances metal.  The example given in the R extension
documentation ("e.g., by providing methods for classes from these
packages") seems more in line with the usual meaning of enhance.

A secondary reason is that I can not tell from the documentation exactly
what putting a package in enhances does.  The example of adding
functionality to a class suggests that packages that are enhanced are
required.  However, clearly one could surround code that enhanced a
class from another package with a conditional, so that if the code was
skipped if the enhanced package was absent.  Even that logic isn't quite
right if the enhanced package is added later.

My package only loads/verifies the presence of rmpi if one attempts to
use the distributed features, so the relation is at run time, not load
time.

Ross
> 
> On Fri, Jan 15, 2010 at 6:00 AM, Ross Boylan <ross at biostat.ucsf.edu> wrote:
> > I have a package that can use rmpi, but works fine without it.  None of
> > the automatic test code invokes rmpi functionality.  (One test file
> > illustrates how to use it, but has quit() as its first command.)
> >
> > What's the best way to handle this?  In particular, what is the
> > appropriate form for upload to CRAN?
> >
> > When I omitted rmpi from the DESCRITPION file R CMD check gave
> > <quote>
> > * checking R code for possible problems ... NOTE
> > alldone: no visible global function definition for ?mpi.bcast.Robj?
> > alldone: no visible global function definition for ?mpi.exit?
> > <quote>
> > followed by many more warnings.
> >
> > When I add
> > Suggests: Rmpi
> > in DESCRIPTION the check stops if the package is not installed:
> > <quote>
> > * checking package dependencies ... ERROR
> > Packages required but not available:
> >  Rmpi
> > </quote>
> > Rmpi is not required, but I gather from previous discussion on this list
> > that suggests basically means required for R CMD check.
> >
> > NAMESPACE seems to raise similar issues; I don't see any mechanism for
> > optional imports.  Also, I have not used namespaces, and am not eager to
> > destabilize things so close to release.  At least, I hope I'm close to
> > release :)
> >
> > Thanks for any advice.
> >
> > Ross Boylan
> >
> > P.S. Thanks, Duncan, for your recent advice on my help format problem
> > with R 2.7.  I removed the nested \description, and now things look OK.
> >
> > ______________________________________________
> > R-devel at r-project.org mailing list
> > https://stat.ethz.ch/mailman/listinfo/r-devel
> >



[Rd] optional package dependency (enhances)
Ross Boylan