From c85197c349cb275eb86bfa94b350f5e92041b043 Mon Sep 17 00:00:00 2001 From: milanmlft Date: Tue, 1 Oct 2024 00:08:35 +0000 Subject: [PATCH] [actions] update 24 packages --- renv/activate.R | 105 +++++++++++++++-- renv/profiles/lesson-requirements/renv.lock | 123 +++++++++++++------- 2 files changed, 178 insertions(+), 50 deletions(-) diff --git a/renv/activate.R b/renv/activate.R index d13f9932a..c360bf296 100644 --- a/renv/activate.R +++ b/renv/activate.R @@ -2,7 +2,7 @@ local({ # the requested version of renv - version <- "1.0.7" + version <- "1.0.9" attr(version, "sha") <- NULL # the project directory @@ -98,6 +98,66 @@ local({ unloadNamespace("renv") # load bootstrap tools + ansify <- function(text) { + if (renv_ansify_enabled()) + renv_ansify_enhanced(text) + else + renv_ansify_default(text) + } + + renv_ansify_enabled <- function() { + + override <- Sys.getenv("RENV_ANSIFY_ENABLED", unset = NA) + if (!is.na(override)) + return(as.logical(override)) + + pane <- Sys.getenv("RSTUDIO_CHILD_PROCESS_PANE", unset = NA) + if (identical(pane, "build")) + return(FALSE) + + testthat <- Sys.getenv("TESTTHAT", unset = "false") + if (tolower(testthat) %in% "true") + return(FALSE) + + iderun <- Sys.getenv("R_CLI_HAS_HYPERLINK_IDE_RUN", unset = "false") + if (tolower(iderun) %in% "false") + return(FALSE) + + TRUE + + } + + renv_ansify_default <- function(text) { + text + } + + renv_ansify_enhanced <- function(text) { + + # R help links + pattern <- "`\\?(renv::(?:[^`])+)`" + replacement <- "`\033]8;;ide:help:\\1\a?\\1\033]8;;\a`" + text <- gsub(pattern, replacement, text, perl = TRUE) + + # runnable code + pattern <- "`(renv::(?:[^`])+)`" + replacement <- "`\033]8;;ide:run:\\1\a\\1\033]8;;\a`" + text <- gsub(pattern, replacement, text, perl = TRUE) + + # return ansified text + text + + } + + renv_ansify_init <- function() { + + envir <- renv_envir_self() + if (renv_ansify_enabled()) + assign("ansify", renv_ansify_enhanced, envir = envir) + else + assign("ansify", renv_ansify_default, envir = envir) + + } + `%||%` <- function(x, y) { if (is.null(x)) y else x } @@ -142,7 +202,10 @@ local({ # compute common indent indent <- regexpr("[^[:space:]]", lines) common <- min(setdiff(indent, -1L)) - leave - paste(substring(lines, common), collapse = "\n") + text <- paste(substring(lines, common), collapse = "\n") + + # substitute in ANSI links for executable renv code + ansify(text) } @@ -306,7 +369,11 @@ local({ ) if ("headers" %in% names(formals(utils::download.file))) - args$headers <- renv_bootstrap_download_custom_headers(url) + { + headers <- renv_bootstrap_download_custom_headers(url) + if (length(headers) && is.character(headers)) + args$headers <- headers + } do.call(utils::download.file, args) @@ -385,10 +452,22 @@ local({ for (type in types) { for (repos in renv_bootstrap_repos()) { + # build arguments for utils::available.packages() call + args <- list(type = type, repos = repos) + + # add custom headers if available -- note that + # utils::available.packages() will pass this to download.file() + if ("headers" %in% names(formals(utils::download.file))) + { + headers <- renv_bootstrap_download_custom_headers(url) + if (length(headers) && is.character(headers)) + args$headers <- headers + } + # retrieve package database db <- tryCatch( as.data.frame( - utils::available.packages(type = type, repos = repos), + do.call(utils::available.packages, args), stringsAsFactors = FALSE ), error = identity @@ -470,6 +549,14 @@ local({ } + renv_bootstrap_github_token <- function() { + for (envvar in c("GITHUB_TOKEN", "GITHUB_PAT", "GH_TOKEN")) { + envval <- Sys.getenv(envvar, unset = NA) + if (!is.na(envval)) + return(envval) + } + } + renv_bootstrap_download_github <- function(version) { enabled <- Sys.getenv("RENV_BOOTSTRAP_FROM_GITHUB", unset = "TRUE") @@ -477,16 +564,16 @@ local({ return(FALSE) # prepare download options - pat <- Sys.getenv("GITHUB_PAT") - if (nzchar(Sys.which("curl")) && nzchar(pat)) { + token <- renv_bootstrap_github_token() + if (nzchar(Sys.which("curl")) && nzchar(token)) { fmt <- "--location --fail --header \"Authorization: token %s\"" - extra <- sprintf(fmt, pat) + extra <- sprintf(fmt, token) saved <- options("download.file.method", "download.file.extra") options(download.file.method = "curl", download.file.extra = extra) on.exit(do.call(base::options, saved), add = TRUE) - } else if (nzchar(Sys.which("wget")) && nzchar(pat)) { + } else if (nzchar(Sys.which("wget")) && nzchar(token)) { fmt <- "--header=\"Authorization: token %s\"" - extra <- sprintf(fmt, pat) + extra <- sprintf(fmt, token) saved <- options("download.file.method", "download.file.extra") options(download.file.method = "wget", download.file.extra = extra) on.exit(do.call(base::options, saved), add = TRUE) diff --git a/renv/profiles/lesson-requirements/renv.lock b/renv/profiles/lesson-requirements/renv.lock index 6ae80671f..b0b90e358 100644 --- a/renv/profiles/lesson-requirements/renv.lock +++ b/renv/profiles/lesson-requirements/renv.lock @@ -30,13 +30,13 @@ }, "Deriv": { "Package": "Deriv", - "Version": "4.1.3", + "Version": "4.1.6", "Source": "Repository", "Repository": "CRAN", "Requirements": [ "methods" ], - "Hash": "bc727aba82bcda74db0bbe188ec6757c" + "Hash": "cd52c065c9e687c60c56b51f10f7bcd3" }, "DiagrammeR": { "Package": "DiagrammeR", @@ -66,6 +66,17 @@ ], "Hash": "584c1e1cbb6f9b6c3b0f4ef0ad960966" }, + "Formula": { + "Package": "Formula", + "Version": "1.2-5", + "Source": "Repository", + "Repository": "CRAN", + "Requirements": [ + "R", + "stats" + ], + "Hash": "7a29697b75e027767a53fde6c903eca7" + }, "MASS": { "Package": "MASS", "Version": "7.3-61", @@ -131,6 +142,25 @@ ], "Hash": "45f0398006e83a5b10b72a90663d8d8c" }, + "RSQLite": { + "Package": "RSQLite", + "Version": "2.3.7", + "Source": "Repository", + "Repository": "CRAN", + "Requirements": [ + "DBI", + "R", + "bit64", + "blob", + "cpp11", + "memoise", + "methods", + "pkgconfig", + "plogr", + "rlang" + ], + "Hash": "46b45a4dd7bb0e0f4e3fc22245817240" + }, "Rcpp": { "Package": "Rcpp", "Version": "1.0.13", @@ -171,7 +201,7 @@ }, "abind": { "Package": "abind", - "Version": "1.4-5", + "Version": "1.4-8", "Source": "Repository", "Repository": "CRAN", "Requirements": [ @@ -179,7 +209,7 @@ "methods", "utils" ], - "Hash": "4f57884290cc75ab22f4af9e9d4ca862" + "Hash": "2288423bb0f20a457800d7fc47f6aa54" }, "aod": { "Package": "aod", @@ -225,17 +255,17 @@ }, "bit": { "Package": "bit", - "Version": "4.0.5", + "Version": "4.5.0", "Source": "Repository", "Repository": "CRAN", "Requirements": [ "R" ], - "Hash": "d242abec29412ce988848d0294b208fd" + "Hash": "5dc7b2677d65d0e874fc4aaf0e879987" }, "bit64": { "Package": "bit64", - "Version": "4.0.5", + "Version": "4.5.2", "Source": "Repository", "Repository": "CRAN", "Requirements": [ @@ -245,7 +275,7 @@ "stats", "utils" ], - "Hash": "9fe98599ca456d6552421db0d6772d8f" + "Hash": "e84984bf5f12a18628d9a02322128dfd" }, "blob": { "Package": "blob", @@ -273,7 +303,7 @@ }, "broom": { "Package": "broom", - "Version": "1.0.6", + "Version": "1.0.7", "Source": "Repository", "Repository": "CRAN", "Requirements": [ @@ -289,7 +319,7 @@ "tibble", "tidyr" ], - "Hash": "a4652c36d1f8abfc3ddf4774f768c934" + "Hash": "8fcc818f3b9887aebaf206f141437cc9" }, "bslib": { "Package": "bslib", @@ -339,10 +369,11 @@ }, "car": { "Package": "car", - "Version": "3.1-2", + "Version": "3.1-3", "Source": "Repository", "Repository": "CRAN", "Requirements": [ + "Formula", "MASS", "R", "abind", @@ -359,7 +390,7 @@ "stats", "utils" ], - "Hash": "839b351f31d56e0147439eb22c00a66a" + "Hash": "82067bf302d1440b730437693a86406a" }, "carData": { "Package": "carData", @@ -479,13 +510,13 @@ }, "curl": { "Package": "curl", - "Version": "5.2.2", + "Version": "5.2.3", "Source": "Repository", "Repository": "CRAN", "Requirements": [ "R" ], - "Hash": "8f27335f2bcff4d6035edcc82d7d46de" + "Hash": "d91263322a58af798f6cf3b13fd56dde" }, "data.table": { "Package": "data.table", @@ -605,14 +636,13 @@ }, "evaluate": { "Package": "evaluate", - "Version": "0.24.0", + "Version": "1.0.0", "Source": "Repository", "Repository": "CRAN", "Requirements": [ - "R", - "methods" + "R" ], - "Hash": "a1066cbc05caee9a4bf6d90f194ff4da" + "Hash": "6b567375113ceb7d9f800de4dd42218e" }, "fansi": { "Package": "fansi", @@ -739,14 +769,14 @@ }, "glue": { "Package": "glue", - "Version": "1.7.0", + "Version": "1.8.0", "Source": "Repository", "Repository": "CRAN", "Requirements": [ "R", "methods" ], - "Hash": "e0b3a53876554bd45879e596cdb10a52" + "Hash": "5899f1eaa825580172bb56c08266f37c" }, "goftest": { "Package": "goftest", @@ -1005,13 +1035,13 @@ }, "jsonlite": { "Package": "jsonlite", - "Version": "1.8.8", + "Version": "1.8.9", "Source": "Repository", "Repository": "CRAN", "Requirements": [ "methods" ], - "Hash": "e1b9c55281c5adc4dd113652d9e26768" + "Hash": "4e993b65c2c3ffbffce7bb3e2c6f832b" }, "knitr": { "Package": "knitr", @@ -1171,14 +1201,15 @@ }, "microbenchmark": { "Package": "microbenchmark", - "Version": "1.4.10", + "Version": "1.5.0", "Source": "Repository", "Repository": "CRAN", "Requirements": [ + "R", "graphics", "stats" ], - "Hash": "db81b552e393ed092872cf7023469bc2" + "Hash": "f9d226d88d4087d817d4e616626ce8e5" }, "mime": { "Package": "mime", @@ -1313,13 +1344,13 @@ }, "openssl": { "Package": "openssl", - "Version": "2.2.1", + "Version": "2.2.2", "Source": "Repository", "Repository": "CRAN", "Requirements": [ "askpass" ], - "Hash": "c62edf62de70cadf40553e10c739049d" + "Hash": "d413e0fef796c9401a4419485f709ca1" }, "pbkrtest": { "Package": "pbkrtest", @@ -1366,6 +1397,13 @@ ], "Hash": "01f28d4278f15c76cddbea05899c5d6f" }, + "plogr": { + "Package": "plogr", + "Version": "0.2.0", + "Source": "Repository", + "Repository": "CRAN", + "Hash": "09eb987710984fc2905c7129c7d85e65" + }, "prettyunits": { "Package": "prettyunits", "Version": "1.2.0", @@ -1421,14 +1459,14 @@ }, "ps": { "Package": "ps", - "Version": "1.7.7", + "Version": "1.8.0", "Source": "Repository", "Repository": "CRAN", "Requirements": [ "R", "utils" ], - "Hash": "878b467580097e9c383acbb16adab57a" + "Hash": "4b9c8485b0c7eecdf0a9ba5132a45576" }, "purrr": { "Package": "purrr", @@ -1465,14 +1503,17 @@ }, "ragg": { "Package": "ragg", - "Version": "1.3.2", + "Version": "1.3.3", "Source": "Repository", - "Repository": "carpentries", + "Repository": "https://carpentries.r-universe.dev", + "RemoteUrl": "https://github.com/r-lib/ragg", + "RemoteRef": "v1.3.3", + "RemoteSha": "6f2279ae8cd0e0d7e9d0e1ede2b742666f9f1d49", "Requirements": [ "systemfonts", "textshaping" ], - "Hash": "e3087db406e079a8a2fd87f413918ed3" + "Hash": "0595fe5e47357111f29ad19101c7d271" }, "rappdirs": { "Package": "rappdirs", @@ -1541,13 +1582,13 @@ }, "renv": { "Package": "renv", - "Version": "1.0.7", + "Version": "1.0.9", "Source": "Repository", "Repository": "CRAN", "Requirements": [ "utils" ], - "Hash": "397b7b2a265bc5a7a06852524dabae20" + "Hash": "ef233f0e9064fc88c898b340c9add5c2" }, "reprex": { "Package": "reprex", @@ -1633,7 +1674,7 @@ }, "sandwich": { "Package": "sandwich", - "Version": "3.1-0", + "Version": "3.1-1", "Source": "Repository", "Repository": "CRAN", "Requirements": [ @@ -1642,7 +1683,7 @@ "utils", "zoo" ], - "Hash": "1cf6ae532f0179350862fefeb0987c9b" + "Hash": "072bb2d27425f2a58fe71fe1080676ce" }, "sass": { "Package": "sass", @@ -1738,7 +1779,7 @@ "Package": "stringi", "Version": "1.8.4", "Source": "Repository", - "Repository": "carpentries", + "Repository": "RSPM", "Requirements": [ "R", "stats", @@ -1791,7 +1832,7 @@ "Package": "systemfonts", "Version": "1.1.0", "Source": "Repository", - "Repository": "carpentries", + "Repository": "RSPM", "Requirements": [ "R", "cpp11", @@ -1803,7 +1844,7 @@ "Package": "textshaping", "Version": "0.4.0", "Source": "Repository", - "Repository": "carpentries", + "Repository": "RSPM", "Requirements": [ "R", "cpp11", @@ -1923,13 +1964,13 @@ }, "tinytex": { "Package": "tinytex", - "Version": "0.52", + "Version": "0.53", "Source": "Repository", "Repository": "CRAN", "Requirements": [ "xfun" ], - "Hash": "cfbad971a71f0e27cec22e544a08bc3b" + "Hash": "9db859e8aabbb474293dde3097839420" }, "tzdb": { "Package": "tzdb", @@ -2059,7 +2100,7 @@ "Package": "xml2", "Version": "1.3.6", "Source": "Repository", - "Repository": "carpentries", + "Repository": "RSPM", "Requirements": [ "R", "cli",