r-lib / devtools

Tools to make an R developer's life easier
https://devtools.r-lib.org
Other
2.39k stars 760 forks source link

Any way to tell `install_local()` to ignore Remotes packages? Or to use the `repos` even for Remotes? #2493

Closed daattali closed 1 year ago

daattali commented 1 year ago

(I realize this may be a strange question)

I want to use install_local() to install a private package. This package does generally on some github-hosted packages, so it contains a Remotes section in the DESCRIPTION. However, in one case, I would like to install the package without access to github. I do have all the latest versions of these github packages available in a CRAN-like repository, but I can't get install_local() to look there. It keeps failing because it tries to reach github. I essentially want either to ignore the Remotes section, or to be able to specify that the Remotes should really be looking in the same repository as the other packages.

jennybc commented 1 year ago

I think @gaborcsardi will have the best answer to this. I'm not super optimistic, because it feels like a pretty fundamental property of Remotes that the specification of a given package also specifies where to install it from.

gaborcsardi commented 1 year ago

If you only use proper repositories, then you don't need devtools, you can install packages with the standard base R tools, they will ignore Remotes.

daattali commented 1 year ago

The exact same command doesn't seem to work with install.packages().

The following devtools command works:

devtools::install_local("relative/path/to/pkg.tar.gz", repos = "file:///absolute/path/to/lib", type = "source", upgrade = "always")

Yet the exact same command with install.packages() doesn't.

I would understand if you don't want to explicitly support this feature, but was wondering if you can think of a workaround with your knowledge of how devtools works. If not, you can close.

gaborcsardi commented 1 year ago

I don't think this is possible with devtools.