diff --git a/NEWS.md b/NEWS.md index 30c1fbf1a..c67e0bc1c 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,5 +1,8 @@ # devtools (development version) +* Functions that use httr now explicitly check that it is installed + (@catalamarti, #2573). + * `test_coverage()` now works if the package has not been installed. * `test_coverage_active_file()` now reports if any tests failed and does diff --git a/R/check-mac.R b/R/check-mac.R index 90b82a132..3346775d2 100644 --- a/R/check-mac.R +++ b/R/check-mac.R @@ -40,6 +40,7 @@ check_mac_release <- function(pkg = ".", dep_pkgs = character(), args = NULL, ma url <- "https://mac.r-project.org/macbuilder/v1/submit" + rlang::check_installed("httr") body <- list(pkgfile = httr::upload_file(built_path)) if (length(dep_built_paths) > 0) { diff --git a/R/release.R b/R/release.R index 6a62a3cfe..352c5886b 100644 --- a/R/release.R +++ b/R/release.R @@ -277,6 +277,7 @@ upload_cran <- function(pkg, built_path, call = parent.frame()) { # Initial upload --------- cli::cli_inform(c(i = "Uploading package & comments")) + rlang::check_installed("httr") body <- list( pkg_id = "", name = maint$name, diff --git a/R/run-source.R b/R/run-source.R index b3a0ca317..3c8ac9ae4 100644 --- a/R/run-source.R +++ b/R/run-source.R @@ -31,6 +31,7 @@ source_url <- function(url, ..., sha1 = NULL) { stopifnot(is.character(url), length(url) == 1) rlang::check_installed("digest") + rlang::check_installed("httr") temp_file <- file_temp() on.exit(file_delete(temp_file), add = TRUE)