inbo/inborutils

Require specific versions of packages we depend on?

Closed this issue · 2 comments

Hi,

I might be wrong because I'm still not familiar with the "R culture", but I was a bit surprised that the package regularly breaks (#74, #87, ...) because some dependency has changed its interface.

I was therefore wondering if it wouldn't a good practice to:

  • require specific versions in DESCRIPTION: for example explicitly requiring dplyr version 0.8.5 would have avoided issue #87.
  • (since end-users have to deal with multiple projects and packages, each having possibly conflicting requirements regarding version): encourage people (during coding clubs for example) to use isolated R environments, for example using tools such as Packrat or Anaconda R environments.

Hope this helps!

First of all, try to avoid dependencies. Note that you can also list packages under 'Suggests:instead ofImports:when you only need it for a couple functions. [Here](https://cran.r-project.org/doc/manuals/R-exts.html#Suggested-packages) is how to do that. The user don't need to install every dependency, only those mentioned inDependsandImports`.

Restricting a package to older versions of dependencies is a no-no IMHO. You are postphoning the problem and forcing users to not upgrade their packages (or to abandon your package). Rather fix the problem and require a minimal version of a dependency if required. So Imports: dplyr (>= 1.0.0) is OK for me, Imports: dplyr (<= 0.8.5) is not.

If the user needs a stable project, then he can opt for an isolated environment. I currently recommend renv. It is the successor of packrat.

The error message in #87 seems pretty clear to me and should be sufficient to solve them problem.

Perfect, thanks!