Skip to content

Commit

Permalink
Fix reverse dependency checks
Browse files Browse the repository at this point in the history
  • Loading branch information
wlandau-lilly committed Aug 5, 2022
1 parent d8ed219 commit e7850d0
Show file tree
Hide file tree
Showing 8 changed files with 72 additions and 1 deletion.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Description: As a pipeline toolkit for Statistics and data science in R,
the underlying code and data. The methodology in this package
borrows from GNU 'Make' (2015, ISBN:978-9881443519)
and 'drake' (2018, <doi:10.21105/joss.00550>).
Version: 0.13.0
Version: 0.13.1
License: MIT + file LICENSE
URL: https://docs.ropensci.org/targets/, https://github.com/ropensci/targets
BugReports: https://github.com/ropensci/targets/issues
Expand Down
1 change: 1 addition & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -277,6 +277,7 @@ S3method(value_validate,tar_group)
S3method(value_validate,tar_value)
export(all_of)
export(any_of)
export(callr_args_default)
export(contains)
export(ends_with)
export(everything)
Expand Down
4 changes: 4 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# targets 0.13.1

* Fix reverse dependency checks.

# targets 0.13.0

## Bug fixes
Expand Down
28 changes: 28 additions & 0 deletions R/utils_callr.R
Original file line number Diff line number Diff line change
Expand Up @@ -129,10 +129,38 @@ callr_prepare_arguments <- function(callr_function, callr_arguments) {
#' that starts an external R process.
#' @param reporter Character of length 1, choice of reporter
#' for [tar_make()] or a related function.
#' @examples
#' tar_callr_args_default(callr::r)
tar_callr_args_default <- function(callr_function, reporter = NULL) {
if (is.null(callr_function)) {
return(list())
}
out <- list(spinner = !identical(reporter, "summary"))
out[intersect(names(out), names(formals(callr_function)))]
}

#' @title Deprecated: `callr` arguments.
#' @export
#' @keywords internal
#' @description Deprecated on 2022-08-05 (version 0.13.1).
#' Please use [tar_callr_args_default()] instead.
#' @details Not a user-side function. Do not invoke directly.
#' Exported for internal purposes only.
#' @return A list of arguments to `callr_function`.
#' @param callr_function A function from the `callr` package
#' that starts an external R process.
#' @param reporter Character of length 1, choice of reporter
#' for [tar_make()] or a related function.
#' @examples
#' tar_callr_args_default(callr::r)
callr_args_default <- function(callr_function, reporter = NULL) {
msg <- paste(
"callr_args_default() is deprecated in {targets}.",
"please use tar_callr_args_default() instead"
)
cli_red_x(msg)
tar_callr_args_default(
callr_function = callr_function,
reporter = reporter
)
}
30 changes: 30 additions & 0 deletions man/callr_args_default.Rd

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

3 changes: 3 additions & 0 deletions man/tar_callr_args_default.Rd

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

5 changes: 5 additions & 0 deletions tests/testthat/test-utils_callr.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
tar_test("callr_args_default", {
skip_on_cran()
expect_message(out <- callr_args_default(callr::r))
expect_equal(out, tar_callr_args_default(callr::r))
})
File renamed without changes.

0 comments on commit e7850d0

Please sign in to comment.