From 33da8adc2673c5556945c8bf16c2fe5aa2123453 Mon Sep 17 00:00:00 2001 From: Jake Tufts Date: Thu, 21 Nov 2024 09:45:55 +0000 Subject: [PATCH] Fix: Updating all pkgs in renv --- renv.lock | 191 ++++++++++++++++++++++-------------------------- renv/activate.R | 105 +++++++++++++++++++++++--- 2 files changed, 183 insertions(+), 113 deletions(-) diff --git a/renv.lock b/renv.lock index 2c7f87a8..3a222de1 100644 --- a/renv.lock +++ b/renv.lock @@ -16,13 +16,6 @@ "Repository": "CRAN", "Hash": "85bf3bd8fa58da21a22d84fd4f4ef0a8" }, - "BH": { - "Package": "BH", - "Version": "1.84.0-0", - "Source": "Repository", - "Repository": "CRAN", - "Hash": "a8235afbcd6316e6e91433ea47661013" - }, "DT": { "Package": "DT", "Version": "0.33", @@ -42,7 +35,7 @@ }, "MASS": { "Package": "MASS", - "Version": "7.3-60.2", + "Version": "7.3-61", "Source": "Repository", "Repository": "RSPM", "Requirements": [ @@ -53,13 +46,13 @@ "stats", "utils" ], - "Hash": "2f342c46163b0b54d7b64d1f798e2c78" + "Hash": "0cafd6f0500e5deba33be22c46bf6055" }, "Matrix": { "Package": "Matrix", - "Version": "1.7-0", + "Version": "1.7-1", "Source": "Repository", - "Repository": "RSPM", + "Repository": "CRAN", "Requirements": [ "R", "grDevices", @@ -70,7 +63,7 @@ "stats", "utils" ], - "Hash": "1920b2f11133b12350024297d8a4ff4a" + "Hash": "5122bb14d8736372411f955e1b16bc8a" }, "R.cache": { "Package": "R.cache", @@ -100,16 +93,16 @@ }, "R.oo": { "Package": "R.oo", - "Version": "1.26.0", + "Version": "1.27.0", "Source": "Repository", - "Repository": "RSPM", + "Repository": "CRAN", "Requirements": [ "R", "R.methodsS3", "methods", "utils" ], - "Hash": "4fed809e53ddb5407b3da3d0f572e591" + "Hash": "6ac79ff194202248cf946fe3a5d6d498" }, "R.utils": { "Package": "R.utils", @@ -181,21 +174,9 @@ ], "Hash": "2f2912ff398384ab8b2d7e1256019894" }, - "anytime": { - "Package": "anytime", - "Version": "0.3.9", - "Source": "Repository", - "Repository": "CRAN", - "Requirements": [ - "BH", - "R", - "Rcpp" - ], - "Hash": "74a64813f17b492da9c6afda6b128e3d" - }, "arrow": { "Package": "arrow", - "Version": "17.0.0", + "Version": "17.0.0.1", "Source": "Repository", "Repository": "CRAN", "Requirements": [ @@ -213,17 +194,17 @@ "utils", "vctrs" ], - "Hash": "1c613070e06bbe73583142920c6f6ea1" + "Hash": "14af96cb2973f6a6c220ce9c3e5b02cd" }, "askpass": { "Package": "askpass", - "Version": "1.2.0", + "Version": "1.2.1", "Source": "Repository", "Repository": "CRAN", "Requirements": [ "sys" ], - "Hash": "cad6cf7f1d5f6e906700b9d3e718c796" + "Hash": "c39f4155b3ceb1a9a2799d700fbd4b6a" }, "assertthat": { "Package": "assertthat", @@ -257,17 +238,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": [ @@ -277,14 +258,14 @@ "stats", "utils" ], - "Hash": "9fe98599ca456d6552421db0d6772d8f" + "Hash": "e84984bf5f12a18628d9a02322128dfd" }, "bitops": { "Package": "bitops", - "Version": "1.0-7", + "Version": "1.0-9", "Source": "Repository", - "Repository": "RSPM", - "Hash": "b7d8d8ee39869c18d8846a184dd8a1af" + "Repository": "CRAN", + "Hash": "d972ef991d58c19e6efa71b21f5e144b" }, "brew": { "Package": "brew", @@ -363,7 +344,7 @@ }, "checkmate": { "Package": "checkmate", - "Version": "2.3.1", + "Version": "2.3.2", "Source": "Repository", "Repository": "CRAN", "Requirements": [ @@ -371,11 +352,11 @@ "backports", "utils" ], - "Hash": "c01cab1cb0f9125211a6fc99d540e315" + "Hash": "0e14e01ce07e7c88fd25de6d4260d26b" }, "chromote": { "Package": "chromote", - "Version": "0.2.0", + "Version": "0.3.1", "Source": "Repository", "Repository": "CRAN", "Requirements": [ @@ -391,7 +372,7 @@ "utils", "websocket" ], - "Hash": "3cfaf9cbd331e07055acada321664e12" + "Hash": "5532726015b620830baae59aa689ea52" }, "cli": { "Package": "cli", @@ -467,13 +448,13 @@ }, "cpp11": { "Package": "cpp11", - "Version": "0.4.7", + "Version": "0.5.0", "Source": "Repository", "Repository": "CRAN", "Requirements": [ "R" ], - "Hash": "5a295d7d963cc5035284dcdbaf334f4e" + "Hash": "91570bba75d0c9d3f1040c835cee8fba" }, "crayon": { "Package": "crayon", @@ -489,7 +470,7 @@ }, "credentials": { "Package": "credentials", - "Version": "2.0.1", + "Version": "2.0.2", "Source": "Repository", "Repository": "CRAN", "Requirements": [ @@ -499,7 +480,7 @@ "openssl", "sys" ], - "Hash": "c7844b32098dcbd1c59cbd8dddb4ecc6" + "Hash": "09fd631e607a236f8cc7f9604db32cb8" }, "crosstalk": { "Package": "crosstalk", @@ -516,13 +497,13 @@ }, "curl": { "Package": "curl", - "Version": "5.2.1", + "Version": "6.0.1", "Source": "Repository", "Repository": "CRAN", "Requirements": [ "R" ], - "Hash": "411ca2c03b1ce5f548345d2fc2685f7a" + "Hash": "e8ba62486230951fcd2b881c5be23f96" }, "cyclocomp": { "Package": "cyclocomp", @@ -587,13 +568,13 @@ }, "dfeR": { "Package": "dfeR", - "Version": "0.5.1", + "Version": "0.6.1.9000", "Source": "GitHub", "RemoteType": "github", "RemoteUsername": "dfe-analytical-services", "RemoteRepo": "dfeR", "RemoteRef": "main", - "RemoteSha": "bb09eda8f55258e34f25d94f401faa139ec781d6", + "RemoteSha": "7010d10184bf913e877f311f00bfe06b110b28b6", "RemoteHost": "api.github.com", "Requirements": [ "R", @@ -610,17 +591,17 @@ "utils", "withr" ], - "Hash": "93f6c19a253e2c836614972f5966c631" + "Hash": "38055f6403dfd3cc32d46b5e9c70db80" }, "dfeshiny": { "Package": "dfeshiny", - "Version": "0.4.2", + "Version": "0.5.1.9000", "Source": "GitHub", "RemoteType": "github", "RemoteUsername": "dfe-analytical-services", "RemoteRepo": "dfeshiny", "RemoteRef": "main", - "RemoteSha": "a97980297b9d45afd5100c424a39c0e180e63524", + "RemoteSha": "ceab34a1cac64d9734247de905b0fdcf9eea9174", "RemoteHost": "api.github.com", "Requirements": [ "R", @@ -635,7 +616,7 @@ "stringr", "styler" ], - "Hash": "26a470de138bb9d64abb9f93b6c4b0ec" + "Hash": "b887ca4019c88340ae1aa2df0c257fd5" }, "diffobj": { "Package": "diffobj", @@ -719,7 +700,7 @@ }, "emoji": { "Package": "emoji", - "Version": "15.0", + "Version": "16.0.0", "Source": "Repository", "Repository": "CRAN", "Requirements": [ @@ -728,7 +709,7 @@ "stringr", "tibble" ], - "Hash": "961ccf8e88d1a8add09f9c811f4d7e29" + "Hash": "216140f0bbbe9c925ab348a67f2e58bd" }, "evaluate": { "Package": "evaluate", @@ -768,7 +749,7 @@ }, "fontawesome": { "Package": "fontawesome", - "Version": "0.5.2", + "Version": "0.5.3", "Source": "Repository", "Repository": "CRAN", "Requirements": [ @@ -776,7 +757,7 @@ "htmltools", "rlang" ], - "Hash": "c2efdd5f0bcd1ea861c2d4e2a883a67d" + "Hash": "bd1297f9b5b1fc1372d19e2c4cd82215" }, "forcats": { "Package": "forcats", @@ -818,7 +799,7 @@ }, "gert": { "Package": "gert", - "Version": "2.1.1", + "Version": "2.1.4", "Source": "Repository", "Repository": "CRAN", "Requirements": [ @@ -829,13 +810,13 @@ "sys", "zip" ], - "Hash": "ab2ca7d6bd706ed218d096b7b16d7233" + "Hash": "ae855ad6d7be20dd7b05d43d25700398" }, "ggiraph": { "Package": "ggiraph", - "Version": "0.8.10", + "Version": "0.8.11", "Source": "Repository", - "Repository": "RSPM", + "Repository": "CRAN", "Requirements": [ "Rcpp", "cli", @@ -850,7 +831,7 @@ "uuid", "vctrs" ], - "Hash": "15748f4335af873289fbdd31610c3f96" + "Hash": "14b3b3b923944afb9542dbef4c68bf4b" }, "ggplot2": { "Package": "ggplot2", @@ -980,18 +961,19 @@ }, "gtable": { "Package": "gtable", - "Version": "0.3.5", + "Version": "0.3.6", "Source": "Repository", - "Repository": "RSPM", + "Repository": "CRAN", "Requirements": [ "R", "cli", "glue", "grid", "lifecycle", - "rlang" + "rlang", + "stats" ], - "Hash": "e18861963cbc65a27736e02b3cd3c4a0" + "Hash": "de949855009e2d4d0e52a844e30617ae" }, "here": { "Package": "here", @@ -1091,7 +1073,7 @@ }, "httr2": { "Package": "httr2", - "Version": "1.0.3", + "Version": "1.0.6", "Source": "Repository", "Repository": "CRAN", "Requirements": [ @@ -1108,7 +1090,7 @@ "vctrs", "withr" ], - "Hash": "10d93e97faad6b629301bb3a2fd23378" + "Hash": "3ef5d07ec78803475a94367d71b40c41" }, "ini": { "Package": "ini", @@ -1354,9 +1336,9 @@ }, "nlme": { "Package": "nlme", - "Version": "3.1-164", + "Version": "3.1-166", "Source": "Repository", - "Repository": "RSPM", + "Repository": "CRAN", "Requirements": [ "R", "graphics", @@ -1364,17 +1346,17 @@ "stats", "utils" ], - "Hash": "a623a2239e642806158bc4dc3f51565d" + "Hash": "ccbb8846be320b627e6aa2b4616a2ded" }, "openssl": { "Package": "openssl", - "Version": "2.2.0", + "Version": "2.2.2", "Source": "Repository", - "Repository": "RSPM", + "Repository": "CRAN", "Requirements": [ "askpass" ], - "Hash": "2bcca3848e4734eb3b16103bc9aa4b8e" + "Hash": "d413e0fef796c9401a4419485f709ca1" }, "openxlsx": { "Package": "openxlsx", @@ -1412,7 +1394,7 @@ }, "pingr": { "Package": "pingr", - "Version": "2.0.3", + "Version": "2.0.4", "Source": "Repository", "Repository": "CRAN", "Requirements": [ @@ -1420,11 +1402,11 @@ "processx", "utils" ], - "Hash": "8d2db1d13f4198a00ebf2f066bf2ab67" + "Hash": "a68ecec33211e55f957631b6163a4898" }, "pkgbuild": { "Package": "pkgbuild", - "Version": "1.4.4", + "Version": "1.4.5", "Source": "Repository", "Repository": "CRAN", "Requirements": [ @@ -1435,7 +1417,7 @@ "desc", "processx" ], - "Hash": "a29e8e134a460a01e0ca67a4763c595b" + "Hash": "30eaaab94db72652e72e3475c1b55278" }, "pkgconfig": { "Package": "pkgconfig", @@ -1449,7 +1431,7 @@ }, "pkgdown": { "Package": "pkgdown", - "Version": "2.1.0", + "Version": "2.1.1", "Source": "Repository", "Repository": "CRAN", "Requirements": [ @@ -1475,28 +1457,29 @@ "xml2", "yaml" ], - "Hash": "0d3d789055c873f48521ce7e23c23f48" + "Hash": "df2912d5873422b55a13002510f02c9f" }, "pkgload": { "Package": "pkgload", - "Version": "1.3.4", + "Version": "1.4.0", "Source": "Repository", "Repository": "CRAN", "Requirements": [ "R", "cli", - "crayon", "desc", "fs", "glue", + "lifecycle", "methods", "pkgbuild", + "processx", "rlang", "rprojroot", "utils", "withr" ], - "Hash": "876c618df5ae610be84356d5d7a5d124" + "Hash": "2ec30ffbeec83da57655b850cf2d3e0e" }, "png": { "Package": "png", @@ -1583,14 +1566,14 @@ }, "ps": { "Package": "ps", - "Version": "1.7.6", + "Version": "1.8.1", "Source": "Repository", "Repository": "CRAN", "Requirements": [ "R", "utils" ], - "Hash": "dd2b9319ee0656c8acf45c7f40c59de7" + "Hash": "b4404b1de13758dea1c0484ad0d48563" }, "purrr": { "Package": "purrr", @@ -1609,14 +1592,14 @@ }, "ragg": { "Package": "ragg", - "Version": "1.3.2", + "Version": "1.3.3", "Source": "Repository", "Repository": "CRAN", "Requirements": [ "systemfonts", "textshaping" ], - "Hash": "e3087db406e079a8a2fd87f413918ed3" + "Hash": "0595fe5e47357111f29ad19101c7d271" }, "rappdirs": { "Package": "rappdirs", @@ -1731,13 +1714,13 @@ }, "renv": { "Package": "renv", - "Version": "1.0.7", + "Version": "1.0.11", "Source": "Repository", - "Repository": "RSPM", + "Repository": "CRAN", "Requirements": [ "utils" ], - "Hash": "397b7b2a265bc5a7a06852524dabae20" + "Hash": "47623f66b4e80b3b0587bc5d7b309888" }, "rex": { "Package": "rex", @@ -1831,10 +1814,10 @@ }, "rstudioapi": { "Package": "rstudioapi", - "Version": "0.16.0", + "Version": "0.17.1", "Source": "Repository", "Repository": "CRAN", - "Hash": "96710351d642b70e8f02ddeb237c46a7" + "Hash": "5f90cd73946d706cfe26024294236113" }, "rversions": { "Package": "rversions", @@ -1930,17 +1913,20 @@ }, "shinyGovstyle": { "Package": "shinyGovstyle", - "Version": "0.0.8", + "Version": "0.1.0", "Source": "Repository", "Repository": "CRAN", "Requirements": [ "R", "htmltools", "jsonlite", + "magrittr", + "purrr", "shiny", - "shinyjs" + "shinyjs", + "stringr" ], - "Hash": "a593ce187f4a7830392e0843041e3ea8" + "Hash": "4a57256cf54590da8a07c53b995c42a8" }, "shinyToastify": { "Package": "shinyToastify", @@ -1958,12 +1944,11 @@ }, "shinyWidgets": { "Package": "shinyWidgets", - "Version": "0.8.6", + "Version": "0.8.7", "Source": "Repository", "Repository": "CRAN", "Requirements": [ "R", - "anytime", "bslib", "grDevices", "htmltools", @@ -1972,7 +1957,7 @@ "sass", "shiny" ], - "Hash": "bc918b6911c4e928e24a9928295de834" + "Hash": "fd8239886f70daa85c36596214958451" }, "shinycssloaders": { "Package": "shinycssloaders", @@ -2143,10 +2128,10 @@ }, "sys": { "Package": "sys", - "Version": "3.4.2", + "Version": "3.4.3", "Source": "Repository", "Repository": "CRAN", - "Hash": "3a1be13d68d47a8cd0bfd74739ca1555" + "Hash": "de342ebfebdbf40477d0758d05426646" }, "systemfonts": { "Package": "systemfonts", @@ -2401,7 +2386,7 @@ }, "websocket": { "Package": "websocket", - "Version": "1.4.1", + "Version": "1.4.2", "Source": "Repository", "Repository": "CRAN", "Requirements": [ @@ -2410,7 +2395,7 @@ "cpp11", "later" ], - "Hash": "76e0d400757e318cca33def29ccebbc2" + "Hash": "e77c5569354172d0d04d54a9dec89e33" }, "whisker": { "Package": "whisker", diff --git a/renv/activate.R b/renv/activate.R index e3e77216..b182ee3a 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.11" 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) } @@ -305,8 +368,11 @@ local({ quiet = TRUE ) - if ("headers" %in% names(formals(utils::download.file))) - args$headers <- renv_bootstrap_download_custom_headers(url) + if ("headers" %in% names(formals(utils::download.file))) { + headers <- renv_bootstrap_download_custom_headers(url) + if (length(headers) && is.character(headers)) + args$headers <- headers + } do.call(utils::download.file, args) @@ -385,10 +451,21 @@ 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(repos) + 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 +547,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 +562,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)