Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

devtools::install_dev_deps() doesn't pass all args through to remotes::install_deps() #2166

Closed
t-gibson opened this issue Dec 17, 2019 · 1 comment · Fixed by #2171
Closed

Comments

@t-gibson
Copy link
Contributor

Hi all, I can see that all args besides upgrade and ... aren't being passed through from devtools::install_dev_deps() to remotes::install_deps().

devtools/R/install.R

Lines 150 to 168 in e463a32

install_dev_deps <- function(pkg = ".",
dependencies = TRUE,
repos = getOption("repos"),
type = getOption("pkgType"),
upgrade = c("default", "ask", "always", "never"),
quiet = FALSE,
build = TRUE,
build_opts = c("--no-resave-data", "--no-manual", " --no-build-vignettes"),
...) {
remotes::update_packages("roxygen2")
pkg <- as.package(pkg)
check_dots_used(action = getOption("devtools.ellipsis_action", rlang::warn))
remotes::install_deps(pkg$path, ...,
dependencies = TRUE, upgrade = upgrade
)
}

If you agree I'm happy to raise a PR and add a test case to cover this.

Here's a reprex illustrating the bug 👇

library(devtools)
#> Loading required package: usethis

# let's give it a package to install
pkg <- "docopt"

if (pkg %in% rownames(installed.packages())) {
  remove.packages(pkg)
}
#> Removing package from 'C:/Users/timjg/Documents/R/win-library/3.5'
#> (as 'lib' is unspecified)

directory <- tempdir()

create(directory, fields = list("Suggests" = pkg))
#> <U+2714> Setting active project to 'C:/Users/timjg/AppData/Local/Temp/RtmpGABqrf'
#> <U+2714> Creating 'R/'
#> <U+2714> Writing 'DESCRIPTION'
#> Package: RtmpGABqrf
#> Title: What the Package Does (One Line, Title Case)
#> Version: 0.0.0.9000
#> Authors@R (parsed):
#>     * First Last <[email protected]> [aut, cre] (<https://orcid.org/YOUR-ORCID-ID>)
#> Description: What the package does (one paragraph).
#> License: What license it uses
#> Suggests:
#>     docopt
#> Encoding: UTF-8
#> LazyData: true
#> <U+2714> Writing 'NAMESPACE'
#> <U+2714> Setting active project to '<no active project>'

# won't pass through our `type` arg to remotes::install_deps
install_dev_deps(directory, type = stop("oh no!")) 
#> 
#> docopt (NA -> 0.6.1) [CRAN]
#> Installing 1 packages: docopt
#> Installing package into 'C:/Users/timjg/Documents/R/win-library/3.5'
#> (as 'lib' is unspecified)
#> package 'docopt' successfully unpacked and MD5 sums checked
#> 
#> The downloaded binary packages are in
#>  C:\Users\timjg\AppData\Local\Temp\RtmpGABqrf\downloaded_packages

# expected behaviour would be to throw the error
remotes::install_deps(directory, dependencies = TRUE, type = stop("oh no!"))
#> Error in serialize(list(repos, type), NULL, ascii = TRUE): oh no!

Created on 2019-12-17 by the reprex package (v0.3.0)

@jimhester
Copy link
Member

A PR would be great, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants