-
Couldn't load subscription status.
- Fork 155
Pass all authentication and build arguments to dependencies #145
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
Changes from all commits
ef92888
d9c60e0
48c9cb0
f7ce9a1
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -111,7 +111,7 @@ local_package_deps <- function(pkgdir = ".", dependencies = NA) { | |
|
|
||
| dev_package_deps <- function(pkgdir = ".", dependencies = NA, | ||
| repos = getOption("repos"), | ||
| type = getOption("pkgType")) { | ||
| type = getOption("pkgType"), ...) { | ||
|
|
||
| pkg <- load_pkg_description(pkgdir) | ||
| repos <- c(repos, parse_additional_repositories(pkg)) | ||
|
|
@@ -129,7 +129,7 @@ dev_package_deps <- function(pkgdir = ".", dependencies = NA, | |
|
|
||
| combine_deps( | ||
| package_deps(deps, repos = repos, type = type), | ||
| remote_deps(pkg)) | ||
| remote_deps(pkg, ...)) | ||
| } | ||
|
|
||
| combine_deps <- function(cran_deps, remote_deps) { | ||
|
|
@@ -280,25 +280,39 @@ update.package_deps <- function(object, ..., quiet = FALSE, upgrade = TRUE) { | |
|
|
||
| install_packages <- function(packages, repos = getOption("repos"), | ||
| type = getOption("pkgType"), ..., | ||
| dependencies = FALSE, quiet = NULL, | ||
| # These are options to `install()` used when | ||
| # installing remotes, but can get passed to us by | ||
| # `...` so we just ignore them here | ||
| build, build_opts) { | ||
| dependencies = FALSE, quiet = NULL) { | ||
|
|
||
| # We want to pass only args that exist in the downstream functions | ||
| args_to_keep <- | ||
| unique( | ||
| names( | ||
| c( | ||
| formals(install.packages), | ||
| formals(download.file) | ||
| ) | ||
| ) | ||
| ) | ||
|
|
||
| args <- list(...) | ||
| args <- args[names(args) %in% args_to_keep] | ||
|
|
||
| if (is.null(quiet)) | ||
| quiet <- !identical(type, "source") | ||
|
|
||
| message("Installing ", length(packages), " packages: ", | ||
| paste(packages, collapse = ", ")) | ||
|
|
||
| safe_install_packages( | ||
| packages, | ||
| repos = repos, | ||
| type = type, | ||
| ..., | ||
| dependencies = dependencies, | ||
| quiet = quiet | ||
| do.call( | ||
| safe_install_packages, | ||
| c(list( | ||
| packages, | ||
| repos = repos, | ||
| type = type, | ||
| dependencies = dependencies, | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do we need to translate There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Based on an empirical test, this works fine, at least |
||
| quiet = quiet | ||
| ), | ||
| args | ||
| ) | ||
| ) | ||
| } | ||
|
|
||
|
|
@@ -381,7 +395,7 @@ fix_repositories <- function(repos) { | |
| repos | ||
| } | ||
|
|
||
| parse_one_remote <- function(x) { | ||
| parse_one_remote <- function(x, ...) { | ||
| pieces <- strsplit(x, "::", fixed = TRUE)[[1]] | ||
|
|
||
| if (length(pieces) == 1) { | ||
|
|
@@ -397,7 +411,7 @@ parse_one_remote <- function(x) { | |
| fun <- get(paste0(tolower(type), "_remote"), | ||
| envir = asNamespace("remotes"), mode = "function", inherits = FALSE) | ||
|
|
||
| res <- fun(repo) | ||
| res <- fun(repo, ...) | ||
| }, error = function(e) stop("Unknown remote type: ", type, "\n ", conditionMessage(e), call. = FALSE) | ||
| ) | ||
| res | ||
|
|
@@ -412,13 +426,13 @@ split_remotes <- function(x) { | |
| } | ||
|
|
||
|
|
||
| remote_deps <- function(pkg) { | ||
| remote_deps <- function(pkg, ...) { | ||
| if (!has_dev_remotes(pkg)) { | ||
| return(NULL) | ||
| } | ||
|
|
||
| dev_packages <- split_remotes(pkg[["remotes"]]) | ||
| remote <- lapply(dev_packages, parse_one_remote) | ||
| remote <- lapply(dev_packages, parse_one_remote, ...) | ||
|
|
||
| package <- vapply(remote, remote_package_name, character(1), USE.NAMES = FALSE) | ||
| installed <- vapply(package, local_sha, character(1), USE.NAMES = FALSE) | ||
|
|
||
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't really love this, but I am not sure of a better way to do it, you could list even more arguments here to catch them, but that seems like it would be a pain to maintain as the possible number of arguments in the
install_()functions increases.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, it would be nice to have some "centralized" solution for this. But it will do here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could we required that all install functions take
...and then use ellipsis to warn if an argument is never evaluated?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remotes does not have dependencies, by design. ellipsis already has compiled code, and will trigger the DLL locking issue on Windows.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, oops, I forgot about that constraint.