Skip to content

Commit

Permalink
Update use of renv pretty printing, plus don't validate snapshots in …
Browse files Browse the repository at this point in the history
…tests
  • Loading branch information
juliasilge committed Aug 14, 2023
1 parent cb6fa0c commit 4696961
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion R/pin-read-write.R
Original file line number Diff line number Diff line change
Expand Up @@ -140,9 +140,9 @@ renv_report_actions <- function(current, model) {
lhs <- renv$renv_records(current)
rhs <- renv$renv_records(model)
renv$renv_pretty_print_records_pair(
"The following package(s) do not match your model:",
lhs[names(lhs) %in% names(diff)],
rhs[names(rhs) %in% names(diff)],
"The following package(s) do not match your model:",
"Consider installing the same versions that your model was trained with."
)

Expand Down
7 changes: 4 additions & 3 deletions tests/testthat/setup.R
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
options(pins.verbose = FALSE)
options(pins.quiet = TRUE)
options(renv.verbose = FALSE)
Sys.setenv(RENV_CONFIG_SNAPSHOT_VALIDATE = FALSE)

clean_python_tmp_dir <- function() {
if (!rlang::is_installed("reticulate"))
return()

if(!reticulate::py_available())
return()

tryCatch(
error = function(cnd) {
cli::cli_inform("Cannot clean Python temp directory: {cnd}")
Expand All @@ -24,7 +25,7 @@ clean_python_tmp_dir <- function() {
)
fs::file_delete(detritus)
}
)
)
}

withr::defer(clean_python_tmp_dir(), teardown_env())

0 comments on commit 4696961

Please sign in to comment.