diff --git a/NEWS.md b/NEWS.md index 63147026..067eb972 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,6 +1,9 @@ # remotes (development version) +* remotes without package names are now unconditionally installed (#532, @jakubkovac) + * It is now possible to specify a custom host for dependencies listed in the `DESCRIPTION` file with `Remotes: [@host]::/[@ref]`. The `ref` now supports `/` in it for `GitLab` repositories as it did for `GitHub`repositories. (@dagola, #448) + * Internal `package2remote()` function now supports local remotes created by pak. * `install_*()` functions will no longer fail by default if there warnings from `install.packages()`. Concretely the default value of `R_REMOTES_NO_ERRORS_FROM_WARNINGS` has changed to `true` from the previous value of `false`. (#403) diff --git a/R/deps.R b/R/deps.R index c6b9980b..13a0c964 100644 --- a/R/deps.R +++ b/R/deps.R @@ -144,7 +144,7 @@ dev_package_deps <- function(pkgdir = ".", dependencies = NA, res <- do.call(rbind, c(list(res), lapply(get_extra_deps(pkg, dependencies), extra_deps, pkg = pkg), stringsAsFactors = FALSE)) - res[!duplicated(res$package, fromLast = TRUE), ] + res[is.na(res$package) | !duplicated(res$package, fromLast = TRUE), ] } combine_remote_deps <- function(cran_deps, remote_deps) { diff --git a/tests/testthat/test-deps.R b/tests/testthat/test-deps.R index 9a014415..62d09554 100644 --- a/tests/testthat/test-deps.R +++ b/tests/testthat/test-deps.R @@ -548,3 +548,13 @@ test_that("dev_package_deps can retrieve custom fields", { expect_true(any(is_covr)) expect_is(res$remote[is_covr][[1]], "cran_remote") }) + +test_that("dev_package_deps works with url remotes", { + skip_on_cran() + skip_if_offline() + + res <- dev_package_deps(test_path("urlremotes"), dependencies = TRUE) + + expect_equal(sum(is.na(res$package)), 2) + +}) diff --git a/tests/testthat/urlremotes/DESCRIPTION b/tests/testthat/urlremotes/DESCRIPTION new file mode 100644 index 00000000..b6898517 --- /dev/null +++ b/tests/testthat/urlremotes/DESCRIPTION @@ -0,0 +1,15 @@ +Package: noremotes +Title: Tools to make developing R code easier +License: MIT +Description: Package description. +Author: Bugs Bunny +Maintainer: Bugs Bunny +Version: 1.0.0 +Suggests: testthat +Imports: + example, + dtplyr +Remotes: + url::https://www.example.com/, + url::https://github.com/tidyverse/dtplyr +