r-lib / remotes

Install R packages from GitHub, GitLab, Bitbucket, git, svn repositories, URLs
https://remotes.r-lib.org/
Other
325 stars 152 forks source link

load_all / test don't respect package versions (?) #751

Closed black-snow closed 1 year ago

black-snow commented 1 year ago

I don't know if this belongs here or in usethis (or if I'm missing something).

I wanted to specify a dependency on a specific version of a (CRAN) package. I tried taxadb (== 0.1.5) in Depends: as well as in Imports: and while devtools seem to pick it up, they also seem to just ignore it:

ℹ The packages bdc and taxadb (== 0.1.5) are required. ✖ Would you like to install them?

1: Yes 2: No

Selection: 1 taxadb (NA -> 0.2.0) [CRAN] Installing 1 packages: taxadb Installing package into ‘/usr/local/lib/R/site-library’ (as ‘lib’ is unspecified) trying URL 'https://cloud.r-project.org/src/contrib/taxadb_0.2.0.tar.gz'

What the heck? I'm not profound in R, but this is absolutely not what I'd expect ;)

gaborcsardi commented 1 year ago

R does not really have versioned dependencies, and will always install the latest packages from CRAN, so you cannot depend on an exact version.

black-snow commented 1 year ago

@gaborcsardi wait, really? There's no reasonable way for reproducible builds in R?
So many people in science use it. How are you supposed to reproduce anything built on R then?

Any why do devtools apparently note that you are requesting a specific version but then ignore it? Shouldn't they ignore it off the bat and not say "oh you want 0.1.5? Sure, I'll give you 0.2.0 then"? Or even say "sorry mate, we can only give you latest - go looking for the requested version by yourself and drop it into your lib"?

P.S.: thanks for the quick reply!