Skip to content

Commit

Permalink
Use httr conditionally (#2574)
Browse files Browse the repository at this point in the history
* Use httr conditionally

* Tweak NEWS

---------

Co-authored-by: Jenny Bryan <[email protected]>
  • Loading branch information
catalamarti and jennybc committed Jul 29, 2024
1 parent 28ae8d6 commit 6d6ebab
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 0 deletions.
3 changes: 3 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
1 change: 1 addition & 0 deletions R/check-mac.R
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
1 change: 1 addition & 0 deletions R/release.R
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
1 change: 1 addition & 0 deletions R/run-source.R
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 6d6ebab

Please sign in to comment.