ropensci / ReLTER

An Interface for the 'eLTER' Community
http://docs.ropensci.org/ReLTER
GNU General Public License v3.0
12 stars 6 forks source link

Resources on dependencies limitations #71

Open maelle opened 2 years ago

maelle commented 2 years ago

For info @oggioniale, these might be useful when reducing the number of Imports.

micha-silver commented 1 year ago

@oggioniale : I had a look at chapter 12 of Hadley Wickham's book.

@maelle : Any further comments on this?? Thanks

maelle commented 1 year ago

What's the specific question? In any case yes it is better to not import (in the NAMESPACE) a whole package when you use only a few functions of that package.

micha-silver commented 1 year ago

Here's what I see (not sure if this is the correct way to test...)

direct_deps <- remotes::local_package_deps()
length(direct_deps)
[1] 46
all_deps <- renv::dependencies()
Finding R package dependencies ... Done!
length(all_deps$Package)
[1] 401

So we are declaring@import of 46 packages. And these are pulling along (recursively) another 350. And with all the importFrom() lines in NAMESPACE we are actually attaching all these right from the start. Is this a problem?

maelle commented 1 year ago

Yes it is a problem, especially as there is a hard CRAN limit on direct Imports in DESCRIPTION (20 if I remember correctly).