From eda4df20a237ae8468297c9084240fa68fed11fe Mon Sep 17 00:00:00 2001 From: zkamvar Date: Tue, 5 Mar 2024 00:07:55 +0000 Subject: [PATCH] [actions] update 14 packages --- renv/activate.R | 39 ++++++++++++---- renv/profiles/lesson-requirements/renv.lock | 52 ++++++++++----------- 2 files changed, 56 insertions(+), 35 deletions(-) diff --git a/renv/activate.R b/renv/activate.R index cb5401f9..9b2e7f18 100644 --- a/renv/activate.R +++ b/renv/activate.R @@ -2,7 +2,7 @@ local({ # the requested version of renv - version <- "1.0.3" + version <- "1.0.5" attr(version, "sha") <- NULL # the project directory @@ -31,6 +31,14 @@ local({ if (!is.null(override)) return(override) + # if we're being run in a context where R_LIBS is already set, + # don't load -- presumably we're being run as a sub-process and + # the parent process has already set up library paths for us + rcmd <- Sys.getenv("R_CMD", unset = NA) + rlibs <- Sys.getenv("R_LIBS", unset = NA) + if (!is.na(rlibs) && !is.na(rcmd)) + return(FALSE) + # next, check environment variables # TODO: prefer using the configuration one in the future envvars <- c( @@ -50,9 +58,22 @@ local({ }) - if (!enabled) + # bail if we're not enabled + if (!enabled) { + + # if we're not enabled, we might still need to manually load + # the user profile here + profile <- Sys.getenv("R_PROFILE_USER", unset = "~/.Rprofile") + if (file.exists(profile)) { + cfg <- Sys.getenv("RENV_CONFIG_USER_PROFILE", unset = "TRUE") + if (tolower(cfg) %in% c("true", "t", "1")) + sys.source(profile, envir = globalenv()) + } + return(FALSE) + } + # avoid recursion if (identical(getOption("renv.autoloader.running"), TRUE)) { warning("ignoring recursive attempt to run renv autoloader") @@ -1041,7 +1062,7 @@ local({ # if jsonlite is loaded, use that instead if ("jsonlite" %in% loadedNamespaces()) { - json <- catch(renv_json_read_jsonlite(file, text)) + json <- tryCatch(renv_json_read_jsonlite(file, text), error = identity) if (!inherits(json, "error")) return(json) @@ -1050,7 +1071,7 @@ local({ } # otherwise, fall back to the default JSON reader - json <- catch(renv_json_read_default(file, text)) + json <- tryCatch(renv_json_read_default(file, text), error = identity) if (!inherits(json, "error")) return(json) @@ -1063,14 +1084,14 @@ local({ } renv_json_read_jsonlite <- function(file = NULL, text = NULL) { - text <- paste(text %||% read(file), collapse = "\n") + text <- paste(text %||% readLines(file, warn = FALSE), collapse = "\n") jsonlite::fromJSON(txt = text, simplifyVector = FALSE) } renv_json_read_default <- function(file = NULL, text = NULL) { # find strings in the JSON - text <- paste(text %||% read(file), collapse = "\n") + text <- paste(text %||% readLines(file, warn = FALSE), collapse = "\n") pattern <- '["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]' locs <- gregexpr(pattern, text, perl = TRUE)[[1]] @@ -1118,14 +1139,14 @@ local({ map <- as.list(map) # remap strings in object - remapped <- renv_json_remap(json, map) + remapped <- renv_json_read_remap(json, map) # evaluate eval(remapped, envir = baseenv()) } - renv_json_remap <- function(json, map) { + renv_json_read_remap <- function(json, map) { # fix names if (!is.null(names(json))) { @@ -1152,7 +1173,7 @@ local({ # recurse if (is.recursive(json)) { for (i in seq_along(json)) { - json[i] <- list(renv_json_remap(json[[i]], map)) + json[i] <- list(renv_json_read_remap(json[[i]], map)) } } diff --git a/renv/profiles/lesson-requirements/renv.lock b/renv/profiles/lesson-requirements/renv.lock index 87e575d0..27116e74 100644 --- a/renv/profiles/lesson-requirements/renv.lock +++ b/renv/profiles/lesson-requirements/renv.lock @@ -19,7 +19,7 @@ "Packages": { "MASS": { "Package": "MASS", - "Version": "7.3-60", + "Version": "7.3-60.0.1", "Source": "Repository", "Repository": "CRAN", "Requirements": [ @@ -30,13 +30,13 @@ "stats", "utils" ], - "Hash": "a56a6365b3fa73293ea8d084be0d9bb0" + "Hash": "b765b28387acc8ec9e9c1530713cb19c" }, "Matrix": { "Package": "Matrix", - "Version": "1.6-4", + "Version": "1.6-5", "Source": "Repository", - "Repository": "RSPM", + "Repository": "CRAN", "Requirements": [ "R", "grDevices", @@ -47,7 +47,7 @@ "stats", "utils" ], - "Hash": "d9c655b30a2edc6bb2244c1d1e8d549d" + "Hash": "8c7115cd3a0e048bda2a7cd110549f7a" }, "R6": { "Package": "R6", @@ -206,14 +206,14 @@ }, "digest": { "Package": "digest", - "Version": "0.6.33", + "Version": "0.6.34", "Source": "Repository", "Repository": "CRAN", "Requirements": [ "R", "utils" ], - "Hash": "b18a9cf3c003977b0cc49d5e76ebe48d" + "Hash": "7ede2ee9ea8d3edbf1ca84c1e333ad1a" }, "dplyr": { "Package": "dplyr", @@ -322,7 +322,7 @@ }, "ggplot2": { "Package": "ggplot2", - "Version": "3.4.4", + "Version": "3.5.0", "Source": "Repository", "Repository": "CRAN", "Requirements": [ @@ -343,18 +343,18 @@ "vctrs", "withr" ], - "Hash": "313d31eff2274ecf4c1d3581db7241f9" + "Hash": "52ef83f93f74833007f193b2d4c159a2" }, "glue": { "Package": "glue", - "Version": "1.6.2", + "Version": "1.7.0", "Source": "Repository", - "Repository": "RSPM", + "Repository": "CRAN", "Requirements": [ "R", "methods" ], - "Hash": "4f2596dfb05dac67b9dc558e5c6fba2e" + "Hash": "e0b3a53876554bd45879e596cdb10a52" }, "gtable": { "Package": "gtable", @@ -660,7 +660,7 @@ }, "readr": { "Package": "readr", - "Version": "2.1.4", + "Version": "2.1.5", "Source": "Repository", "Repository": "CRAN", "Requirements": [ @@ -679,7 +679,7 @@ "utils", "vroom" ], - "Hash": "b5047343b3825f37ad9d3b5d89aa1078" + "Hash": "9de96463d2117f6ac49980577939dfb3" }, "readxl": { "Package": "readxl", @@ -705,24 +705,24 @@ }, "renv": { "Package": "renv", - "Version": "1.0.3", + "Version": "1.0.5", "Source": "Repository", "Repository": "CRAN", "Requirements": [ "utils" ], - "Hash": "41b847654f567341725473431dd0d5ab" + "Hash": "32c3f93e8360f667ca5863272ec8ba6a" }, "rlang": { "Package": "rlang", - "Version": "1.1.2", + "Version": "1.1.3", "Source": "Repository", "Repository": "CRAN", "Requirements": [ "R", "utils" ], - "Hash": "50a6dbdc522936ca35afc5e2082ea91b" + "Hash": "42548638fae05fd9a9b5f3f437fbbbe2" }, "rmarkdown": { "Package": "rmarkdown", @@ -833,7 +833,7 @@ }, "tidyr": { "Package": "tidyr", - "Version": "1.3.0", + "Version": "1.3.1", "Source": "Repository", "Repository": "CRAN", "Requirements": [ @@ -852,7 +852,7 @@ "utils", "vctrs" ], - "Hash": "e47debdc7ce599b070c8e78e8ac0cfcf" + "Hash": "915fb7ce036c22a6a33b5a8adb712eb1" }, "tidyselect": { "Package": "tidyselect", @@ -953,27 +953,27 @@ }, "withr": { "Package": "withr", - "Version": "2.5.2", + "Version": "3.0.0", "Source": "Repository", "Repository": "CRAN", "Requirements": [ "R", "grDevices", - "graphics", - "stats" + "graphics" ], - "Hash": "4b25e70111b7d644322e9513f403a272" + "Hash": "d31b6c62c10dcf11ec530ca6b0dd5d35" }, "xfun": { "Package": "xfun", - "Version": "0.41", + "Version": "0.42", "Source": "Repository", "Repository": "CRAN", "Requirements": [ + "grDevices", "stats", "tools" ], - "Hash": "460a5e0fe46a80ef87424ad216028014" + "Hash": "fd1349170df31f7a10bd98b0189e85af" }, "yaml": { "Package": "yaml",