Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
* `submit_cran()` gives a more informative error when the CRAN submission form can't be used, suggesting that the user consult <https://cran.r-project.org> to see if there's a CRAN closure (#2700).
* `check_built()` no longer prints `R_CHECK_` check env variables - now handled by `rcmdcheck::rcmdcheck()` directly as of r-lib/rcmdcheck#237 (#2621)

* `update_packages()` now recommends `remotes::update_packages()`, which checks installed packages for updates when called without arguments (@M-Colley, #2709).

# devtools 2.5.2

* `install()` uses a new feature of `pak::local_install_deps()` to consider the current `.libPaths()` when resolving dependencies, instead of consulting only `.libPaths()[1]`. This was an unintended behavioral change introduced in 2.5.0 (#2691).
Expand Down
14 changes: 12 additions & 2 deletions R/remotes.R
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,17 @@
#' | `install_svn("url")` | `remotes::install_svn("url")` |
#' | `install_url("url")` | `pak::pak("url::url")` |
#' | `install_version("pkg", "1.0.0")` | `pak::pak("pkg@1.0.0")` |
#' | `update_packages("pkg")` | `pak::pak("pkg")` |
#' | `update_packages()` | `remotes::update_packages()` |
#' | `update_packages("pkg")` | `remotes::update_packages("pkg")` |
#' | `dev_package_deps()` | `pak::local_dev_deps()` |
#' | `github_pull("123")` | `remotes::github_pull("123")` |
#' | `github_release()` | `remotes::github_release()` |
#'
#' With no arguments, `remotes::update_packages()` checks installed packages for
#' updates. Use `pak::pak("pkg")` to install or update a named package from a
#' configured source. Use `pak::pak()` to install or update the current package
#' project's development dependencies.
#'
#' @name install-deprecated
#' @keywords internal
NULL
Expand Down Expand Up @@ -147,7 +153,11 @@ install_version <- function(...) {
#' @rdname install-deprecated
#' @export
update_packages <- function(...) {
lifecycle::deprecate_warn("2.5.0", "update_packages()", "pak::pak()")
lifecycle::deprecate_warn(
"2.5.0",
"update_packages()",
"remotes::update_packages()"
)
check_installed("remotes")
pkgbuild::with_build_tools(remotes::update_packages(...), required = FALSE)
}
Expand Down
8 changes: 7 additions & 1 deletion man/install-deprecated.Rd

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

9 changes: 9 additions & 0 deletions tests/testthat/_snaps/remotes.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,12 @@
`github_release()` was deprecated in devtools 2.5.0.
i Please use `remotes::github_release()` instead.

# update_packages() recommends remotes for installed packages

Code
withRestarts(update_packages(), skip_package_update = function() invisible(NULL))
Condition
Warning:
`update_packages()` was deprecated in devtools 2.5.0.
i Please use `remotes::update_packages()` instead.

14 changes: 14 additions & 0 deletions tests/testthat/test-remotes.R
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,17 @@ test_that("github_ functions are deprecated", {
. <- github_release()
})
})

test_that("update_packages() recommends remotes for installed packages", {
withr::local_options(lifecycle_verbosity = "warning")
local_mocked_bindings(
check_installed = function(...) invokeRestart("skip_package_update")
)

expect_snapshot(
withRestarts(
update_packages(),
skip_package_update = function() invisible(NULL)
)
)
})
Loading