Skip to content

Commit

Permalink
Allow install_deps to be called from anywhere in the directory tree
Browse files Browse the repository at this point in the history
This is how it used to work, so we will restore that functionality.

Fixes #1905
  • Loading branch information
jimhester committed Oct 26, 2018
1 parent 12cfc38 commit 4953bd6
Show file tree
Hide file tree
Showing 7 changed files with 106 additions and 37 deletions.
1 change: 0 additions & 1 deletion NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,6 @@ importFrom(remotes,github_release)
importFrom(remotes,install_bioc)
importFrom(remotes,install_bitbucket)
importFrom(remotes,install_cran)
importFrom(remotes,install_deps)
importFrom(remotes,install_dev)
importFrom(remotes,install_git)
importFrom(remotes,install_github)
Expand Down
2 changes: 2 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# devtools 2.0.0.9000 - Development

* `install_deps()` now again works from any directory within a package (#1905)

* Add a RStudio addin for `test_coverage()`.

* `install()` now correctly passes the `upgrade` parameter to
Expand Down
49 changes: 44 additions & 5 deletions R/install.R
Original file line number Diff line number Diff line change
Expand Up @@ -99,13 +99,52 @@ install <-
invisible(TRUE)
}

#' Install package dependencies if needed.

#' `install_deps()` will install the
#' user dependencies needed to run the package, `install_dev_deps()` will also
#' install the development dependencies needed to test and build the package.
#' @inheritParams install
#' @inherit remotes::install_deps
#' @export
install_dev_deps <- function(pkg = ".", upgrade = "ask", ...) {
remotes::update_packages("roxygen2")
install_deps(pkg, ...,
dependencies = TRUE, upgrade = upgrade,
bioc_packages = TRUE
install_deps <- function(pkg = ".",
dependencies = NA,
repos = getOption("repos"),
type = getOption("pkgType"),
upgrade = c("ask", "always", "never"),
quiet = FALSE,
build = TRUE,
build_opts = c("--no-resave-data", "--no-manual", " --no-build-vignettes"),
...) {
pkg <- as.package(pkg)

remotes::install_deps(pkg$path,
dependencies = dependencies,
repos = repos,
type = type,
upgrade = upgrade,
quiet = quiet,
build = build,
build_opts = build_opts,
...
)
}

#' @rdname install_deps
#' @export
install_dev_deps <- function(pkg = ".",
dependencies = TRUE,
repos = getOption("repos"),
type = getOption("pkgType"),
upgrade = c("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)

remotes::install_deps(pkg$path, ...,
dependencies = TRUE, upgrade = upgrade)
}
4 changes: 0 additions & 4 deletions R/remotes.R
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,6 @@ remotes::install_url
#' @export
remotes::install_version

#' @importFrom remotes install_deps
#' @export
remotes::install_deps

#' @importFrom remotes update_packages
#' @export
remotes::update_packages
Expand Down
59 changes: 59 additions & 0 deletions man/install_deps.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

25 changes: 0 additions & 25 deletions man/install_dev_deps.Rd

This file was deleted.

3 changes: 1 addition & 2 deletions man/reexports.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 4953bd6

Please sign in to comment.