pkgreviewr icon indicating copy to clipboard operation
pkgreviewr copied to clipboard

properly import non-exported functions.

Open annakrystalli opened this issue 7 years ago • 6 comments

Checks note (and SO discussion shows) that ::: function calling within packages is not permitted on CRAN.

To import correctly, Include details in roxygen function documentation, following

#' @importFrom utils getFromNamespace

convention and remove ::: notation in functions.

annakrystalli avatar Jan 27 '18 16:01 annakrystalli

Above method will not work.

Associated -> include copies of functions. ensure proper acknowledgement and license inclusion.

annakrystalli avatar Jan 27 '18 17:01 annakrystalli

MIght be relevant: https://discuss.ropensci.org/t/licensing-a-new-package-that-uses-code-from-another-source/1046

annakrystalli avatar Feb 01 '18 09:02 annakrystalli

Still need to address:

checking dependencies in R code ... WARNING
'::' or ':::' import not declared from: ‘github’
Unexported objects imported by ':::' calls:
  ‘devtools:::github_remote’ ‘usethis:::can_overwrite’
  ‘usethis:::check_installed’ ‘usethis:::project_data’
  ‘usethis:::render_template’ ‘usethis:::uses_git’
  See the note in ?`:::` about the use of this operator.

annakrystalli avatar Feb 04 '18 11:02 annakrystalli

in codemetar I used usethis code e.g https://github.com/ropensci/codemetar/blob/7ce13ba50a439b7b9accd8b694bd486c23685384/R/utils.R#L42

  • I added a permalink to the source

  • I used the same licence as usethis for the whole package

In the future such functions might be exported by another package (if I followed correctly 👼 ) cf e.g comment by @jennybc in this closed issue https://github.com/r-lib/usethis/issues/126#issuecomment-354953026

maelle avatar Jun 25 '18 08:06 maelle

Definitely get in touch about usethis functions that you wish were exported. We just exported a few more, for example, based on feedback: https://github.com/r-lib/usethis/commit/979a8654b002a6fd5ad84fb73f77f77674d30dbc

jennybc avatar Jun 25 '18 20:06 jennybc

Oh yeyy! write_over() is being exported!

pkgreviewer makes use of a number of currently unxeported usethis functions as it's so much about templating, but is also meant to be interactive.

Here's the checks output:

checking dependencies in R code ... NOTE
Unexported objects imported by ':::' calls:
  ‘usethis:::can_overwrite’ ‘usethis:::check_installed’
  ‘usethis:::package_data’ ‘usethis:::render_template’
  ‘usethis:::uses_git’ ‘usethis:::write_over’

I did the same as @maelle for the whole style.R script but need to change the license! 😬

This is a lot I know. Perhaps I could take a stab at some roxygen documentation if you'd consider exporting any of the above?

I also wonder if in future, some might make sense as standalone lightweight packages of their own. eg I could see the styling functions as a useful and sensible collection. Also some functions for checking or working with project/package metadata might also make sense together.

annakrystalli avatar Jun 26 '18 09:06 annakrystalli

no ::: anymore in this package

maelle avatar Feb 17 '25 16:02 maelle