Skip to content

Commit

Permalink
Use httr conditionally
Browse files Browse the repository at this point in the history
  • Loading branch information
catalamarti committed Jul 28, 2024
1 parent 28ae8d6 commit 33990d3
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)

* Use `httr` package conditionally with `rlang::check_installed("httr")`
(#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")

Check warning on line 43 in R/check-mac.R

View check run for this annotation

Codecov / codecov/patch

R/check-mac.R#L43

Added line #L43 was not covered by tests
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")

Check warning on line 280 in R/release.R

View check run for this annotation

Codecov / codecov/patch

R/release.R#L280

Added line #L280 was not covered by tests
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")

Check warning on line 34 in R/run-source.R

View check run for this annotation

Codecov / codecov/patch

R/run-source.R#L34

Added line #L34 was not covered by tests

temp_file <- file_temp()
on.exit(file_delete(temp_file), add = TRUE)
Expand Down

0 comments on commit 33990d3

Please sign in to comment.