benmarwick / rrtools

rrtools: Tools for Writing Reproducible Research in R
Other
670 stars 85 forks source link

The use of unexported/internal functions called via ::: is not allowed by CRAN #70

Closed nevrome closed 5 years ago

nevrome commented 5 years ago

We get a new NOTE in the check results:

* checking dependencies in R code ... NOTE
Unexported objects imported by ':::' calls:
  ‘usethis:::done’ ‘usethis:::field’ ‘usethis:::git_uncommitted’
  ‘usethis:::todo’ ‘usethis:::value’
  See the note in ?`:::` about the use of this operator.

We have four options to deal with this:

  1. Ignore it. A CRAN release would be difficult though.
  2. Contact the usethis package authors and ask them to export these functions.
  3. Copy the function source code (and cite the author).
  4. This nasty workaround: https://stat.ethz.ch/pipermail/r-devel/2013-August/067210.html
benmarwick commented 5 years ago

Yes, thanks for raising this, and summarizing the options so nicely. Should we take a vote about what do to?

nevrome commented 5 years ago

Haha - now I'm really curious about the result of a survey.

I personally suggest to copy/reimplement the code. I believe all of these five functions are very small and simple helpers. And as far as I remember rrtools already contains initially foreign code.

joeroe commented 5 years ago

A potential headache with copying the functions is that usethis is GPL licensed. Google says that reusing GPL code under an MIT license isn't kosher. I think you'd have to dual-license the entire package as MIT and GPL (keeping the two parts separate), or switch to GPL.

Fortunately, since this was opened, usethis has decided to export its UI functions, including done(), todo(), field() and value(). See r-lib/usethis/issues/308. So we could just switch to using the exported version on usethis's next release.

That just leaves usethis:::git_uncommitted() to deal with.

benmarwick commented 5 years ago

Thanks, we're now using the newly exported functions from usethis, and we have a local custom version of git_uncommitted()