From f39e4b211708b4d429bab4849a6e2811a428d829 Mon Sep 17 00:00:00 2001 From: Chet Ismay Date: Mon, 11 Nov 2024 13:26:55 -0700 Subject: [PATCH] Update lockfile --- renv.lock | 242 ++++++++++++++++++++++++------------------------ renv/activate.R | 105 +++++++++++++++++++-- 2 files changed, 215 insertions(+), 132 deletions(-) diff --git a/renv.lock b/renv.lock index 16ba203cf..953391b74 100644 --- a/renv.lock +++ b/renv.lock @@ -1,6 +1,6 @@ { "R": { - "Version": "4.4.0", + "Version": "4.4.2", "Repositories": [ { "Name": "CRAN", @@ -32,7 +32,7 @@ }, "MASS": { "Package": "MASS", - "Version": "7.3-60.2", + "Version": "7.3-61", "Source": "Repository", "Repository": "CRAN", "Requirements": [ @@ -43,11 +43,11 @@ "stats", "utils" ], - "Hash": "2f342c46163b0b54d7b64d1f798e2c78" + "Hash": "0cafd6f0500e5deba33be22c46bf6055" }, "Matrix": { "Package": "Matrix", - "Version": "1.7-0", + "Version": "1.7-1", "Source": "Repository", "Repository": "CRAN", "Requirements": [ @@ -60,7 +60,7 @@ "stats", "utils" ], - "Hash": "1920b2f11133b12350024297d8a4ff4a" + "Hash": "5122bb14d8736372411f955e1b16bc8a" }, "R6": { "Package": "R6", @@ -84,24 +84,24 @@ }, "Rcpp": { "Package": "Rcpp", - "Version": "1.0.13", + "Version": "1.0.13-1", "Source": "Repository", "Repository": "CRAN", "Requirements": [ "methods", "utils" ], - "Hash": "f27411eb6d9c3dada5edd444b8416675" + "Hash": "6b868847b365672d6c1677b1608da9ed" }, "askpass": { "Package": "askpass", - "Version": "1.2.0", + "Version": "1.2.1", "Source": "Repository", "Repository": "CRAN", "Requirements": [ "sys" ], - "Hash": "cad6cf7f1d5f6e906700b9d3e718c796" + "Hash": "c39f4155b3ceb1a9a2799d700fbd4b6a" }, "backports": { "Package": "backports", @@ -125,17 +125,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": [ @@ -145,7 +145,7 @@ "stats", "utils" ], - "Hash": "9fe98599ca456d6552421db0d6772d8f" + "Hash": "e84984bf5f12a18628d9a02322128dfd" }, "blob": { "Package": "blob", @@ -161,7 +161,7 @@ }, "bookdown": { "Package": "bookdown", - "Version": "0.40", + "Version": "0.41", "Source": "Repository", "Repository": "CRAN", "Requirements": [ @@ -174,7 +174,7 @@ "xfun", "yaml" ], - "Hash": "896a79478a50c78fb035a37148638f4e" + "Hash": "d8b74e267a5774ded5c91786d6d777bb" }, "brew": { "Package": "brew", @@ -195,7 +195,7 @@ }, "broom": { "Package": "broom", - "Version": "1.0.6", + "Version": "1.0.7", "Source": "Repository", "Repository": "CRAN", "Requirements": [ @@ -211,11 +211,11 @@ "tibble", "tidyr" ], - "Hash": "a4652c36d1f8abfc3ddf4774f768c934" + "Hash": "8fcc818f3b9887aebaf206f141437cc9" }, "bslib": { "Package": "bslib", - "Version": "0.7.0", + "Version": "0.8.0", "Source": "Repository", "Repository": "CRAN", "Requirements": [ @@ -233,7 +233,7 @@ "rlang", "sass" ], - "Hash": "8644cc53f43828f19133548195d7e59e" + "Hash": "b299c6741ca9746fb227debcb0f9fb6c" }, "cachem": { "Package": "cachem", @@ -294,7 +294,7 @@ }, "colorspace": { "Package": "colorspace", - "Version": "2.1-0", + "Version": "2.1-1", "Source": "Repository", "Repository": "CRAN", "Requirements": [ @@ -304,14 +304,14 @@ "methods", "stats" ], - "Hash": "f20c47fd52fae58b4e377c37bb8c335b" + "Hash": "d954cb1c57e8d8b756165d7ba18aa55a" }, "commonmark": { "Package": "commonmark", - "Version": "1.9.1", + "Version": "1.9.2", "Source": "Repository", "Repository": "CRAN", - "Hash": "5d8225445acb167abf7797de48b2ee3c" + "Hash": "14eb0596f987c71535d07c3aff814742" }, "conflicted": { "Package": "conflicted", @@ -328,13 +328,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", @@ -350,7 +350,7 @@ }, "credentials": { "Package": "credentials", - "Version": "2.0.1", + "Version": "2.0.2", "Source": "Repository", "Repository": "CRAN", "Requirements": [ @@ -360,28 +360,28 @@ "openssl", "sys" ], - "Hash": "c7844b32098dcbd1c59cbd8dddb4ecc6" + "Hash": "09fd631e607a236f8cc7f9604db32cb8" }, "curl": { "Package": "curl", - "Version": "5.2.1", + "Version": "6.0.0", "Source": "Repository", "Repository": "CRAN", "Requirements": [ "R" ], - "Hash": "411ca2c03b1ce5f548345d2fc2685f7a" + "Hash": "ff51697d9205fe715f29e7171e874c6e" }, "data.table": { "Package": "data.table", - "Version": "1.15.4", + "Version": "1.16.2", "Source": "Repository", "Repository": "CRAN", "Requirements": [ "R", "methods" ], - "Hash": "8ee9ac56ef633d0c7cab8b2ca87d683e" + "Hash": "2e00b378fc3be69c865120d9f313039a" }, "dbplyr": { "Package": "dbplyr", @@ -475,14 +475,14 @@ }, "digest": { "Package": "digest", - "Version": "0.6.36", + "Version": "0.6.37", "Source": "Repository", "Repository": "CRAN", "Requirements": [ "R", "utils" ], - "Hash": "fd6824ad91ede64151e93af67df6376b" + "Hash": "33698c4b3127fc9f506654607fb73676" }, "downlit": { "Package": "downlit", @@ -574,14 +574,13 @@ }, "evaluate": { "Package": "evaluate", - "Version": "0.24.0", + "Version": "1.0.1", "Source": "Repository", "Repository": "CRAN", "Requirements": [ - "R", - "methods" + "R" ], - "Hash": "a1066cbc05caee9a4bf6d90f194ff4da" + "Hash": "3fd29944b231036ad67c3edb32e02201" }, "fansi": { "Package": "fansi", @@ -662,14 +661,14 @@ }, "fs": { "Package": "fs", - "Version": "1.6.4", + "Version": "1.6.5", "Source": "Repository", "Repository": "CRAN", "Requirements": [ "R", "methods" ], - "Hash": "15aeb8c27f5ea5161f9f6a641fafd93a" + "Hash": "7f48af39fa27711ea5fbd183b399920d" }, "gapminder": { "Package": "gapminder", @@ -717,7 +716,7 @@ }, "gert": { "Package": "gert", - "Version": "2.1.0", + "Version": "2.1.4", "Source": "Repository", "Repository": "CRAN", "Requirements": [ @@ -728,7 +727,7 @@ "sys", "zip" ], - "Hash": "bdc909d9f16e2478d615b0e6a7330435" + "Hash": "ae855ad6d7be20dd7b05d43d25700398" }, "ggplot2": { "Package": "ggplot2", @@ -767,7 +766,7 @@ }, "ggrepel": { "Package": "ggrepel", - "Version": "0.9.5", + "Version": "0.9.6", "Source": "Repository", "Repository": "CRAN", "Requirements": [ @@ -779,7 +778,7 @@ "scales", "withr" ], - "Hash": "cc3361e234c4a5050e29697d675764aa" + "Hash": "3d4156850acc1161f2f24bc61c9217c1" }, "gh": { "Package": "gh", @@ -811,14 +810,14 @@ }, "glue": { "Package": "glue", - "Version": "1.7.0", + "Version": "1.8.0", "Source": "Repository", "Repository": "CRAN", "Requirements": [ "R", "methods" ], - "Hash": "e0b3a53876554bd45879e596cdb10a52" + "Hash": "5899f1eaa825580172bb56c08266f37c" }, "googledrive": { "Package": "googledrive", @@ -889,7 +888,7 @@ }, "gtable": { "Package": "gtable", - "Version": "0.3.5", + "Version": "0.3.6", "Source": "Repository", "Repository": "CRAN", "Requirements": [ @@ -898,9 +897,10 @@ "glue", "grid", "lifecycle", - "rlang" + "rlang", + "stats" ], - "Hash": "e18861963cbc65a27736e02b3cd3c4a0" + "Hash": "de949855009e2d4d0e52a844e30617ae" }, "haven": { "Package": "haven", @@ -1021,7 +1021,7 @@ }, "httr2": { "Package": "httr2", - "Version": "1.0.2", + "Version": "1.0.6", "Source": "Repository", "Repository": "CRAN", "Requirements": [ @@ -1038,7 +1038,7 @@ "vctrs", "withr" ], - "Hash": "320c8fe23fcb25a6690ef7bdb6a3a705" + "Hash": "3ef5d07ec78803475a94367d71b40c41" }, "ids": { "Package": "ids", @@ -1053,9 +1053,14 @@ }, "infer": { "Package": "infer", - "Version": "1.0.7", - "Source": "Repository", - "Repository": "CRAN", + "Version": "1.0.7.9000", + "Source": "GitHub", + "RemoteType": "github", + "RemoteHost": "api.github.com", + "RemoteUsername": "tidymodels", + "RemoteRepo": "infer", + "RemoteRef": "main", + "RemoteSha": "288542bb7269e2510b72cd476bf177e2f22b0e00", "Requirements": [ "R", "broom", @@ -1075,7 +1080,7 @@ "tidyr", "vctrs" ], - "Hash": "8d30ac9c5e21efd8575f934bdb5c3029" + "Hash": "51fd8fbeabe006fdce260a2eb9a980ec" }, "ini": { "Package": "ini", @@ -1129,13 +1134,13 @@ }, "jsonlite": { "Package": "jsonlite", - "Version": "1.8.8", + "Version": "1.8.9", "Source": "Repository", "Repository": "CRAN", "Requirements": [ "methods" ], - "Hash": "e1b9c55281c5adc4dd113652d9e26768" + "Hash": "4e993b65c2c3ffbffce7bb3e2c6f832b" }, "kableExtra": { "Package": "kableExtra", @@ -1164,7 +1169,7 @@ }, "knitr": { "Package": "knitr", - "Version": "1.48", + "Version": "1.49", "Source": "Repository", "Repository": "CRAN", "Requirements": [ @@ -1176,7 +1181,7 @@ "xfun", "yaml" ], - "Hash": "acf380f300c721da9fde7df115a5f86f" + "Hash": "9fcb189926d93c636dea94fbe4f44480" }, "labeling": { "Package": "labeling", @@ -1321,7 +1326,7 @@ }, "moderndive": { "Package": "moderndive", - "Version": "0.6.1", + "Version": "0.7.0", "Source": "Repository", "Repository": "CRAN", "Requirements": [ @@ -1335,11 +1340,13 @@ "janitor", "knitr", "magrittr", + "purrr", "rlang", "stringr", - "tibble" + "tibble", + "tidyr" ], - "Hash": "42f9381b293b8910d1e1db969cb01c06" + "Hash": "35dad0e05fab337a7b8044e88e16b70d" }, "munsell": { "Package": "munsell", @@ -1354,18 +1361,18 @@ }, "mvtnorm": { "Package": "mvtnorm", - "Version": "1.2-5", + "Version": "1.3-2", "Source": "Repository", "Repository": "CRAN", "Requirements": [ "R", "stats" ], - "Hash": "4d1891e59ac7a12b4e7e8a69349125f1" + "Hash": "9e8405eacb262c0a939e121650247f4b" }, "nlme": { "Package": "nlme", - "Version": "3.1-164", + "Version": "3.1-166", "Source": "Repository", "Repository": "CRAN", "Requirements": [ @@ -1375,28 +1382,17 @@ "stats", "utils" ], - "Hash": "a623a2239e642806158bc4dc3f51565d" - }, - "nycflights13": { - "Package": "nycflights13", - "Version": "1.0.2", - "Source": "Repository", - "Repository": "CRAN", - "Requirements": [ - "R", - "tibble" - ], - "Hash": "61eb941328b49a62d7f9816dfed7d959" + "Hash": "ccbb8846be320b627e6aa2b4616a2ded" }, "openssl": { "Package": "openssl", - "Version": "2.2.0", + "Version": "2.2.2", "Source": "Repository", "Repository": "CRAN", "Requirements": [ "askpass" ], - "Hash": "2bcca3848e4734eb3b16103bc9aa4b8e" + "Hash": "d413e0fef796c9401a4419485f709ca1" }, "operator.tools": { "Package": "operator.tools", @@ -1410,11 +1406,12 @@ }, "patchwork": { "Package": "patchwork", - "Version": "1.2.0", + "Version": "1.3.0", "Source": "Repository", "Repository": "CRAN", "Requirements": [ "cli", + "farver", "ggplot2", "grDevices", "graphics", @@ -1424,7 +1421,7 @@ "stats", "utils" ], - "Hash": "9c8ab14c00ac07e9e04d1664c0b74486" + "Hash": "e23fb9ecb1258207bcb763d78d513439" }, "pillar": { "Package": "pillar", @@ -1445,7 +1442,7 @@ }, "pkgbuild": { "Package": "pkgbuild", - "Version": "1.4.4", + "Version": "1.4.5", "Source": "Repository", "Repository": "CRAN", "Requirements": [ @@ -1456,7 +1453,7 @@ "desc", "processx" ], - "Hash": "a29e8e134a460a01e0ca67a4763c595b" + "Hash": "30eaaab94db72652e72e3475c1b55278" }, "pkgconfig": { "Package": "pkgconfig", @@ -1470,7 +1467,7 @@ }, "pkgdown": { "Package": "pkgdown", - "Version": "2.1.0", + "Version": "2.1.1", "Source": "Repository", "Repository": "CRAN", "Requirements": [ @@ -1496,7 +1493,7 @@ "xml2", "yaml" ], - "Hash": "0d3d789055c873f48521ce7e23c23f48" + "Hash": "df2912d5873422b55a13002510f02c9f" }, "pkgload": { "Package": "pkgload", @@ -1552,18 +1549,16 @@ }, "profvis": { "Package": "profvis", - "Version": "0.3.8", + "Version": "0.4.0", "Source": "Repository", "Repository": "CRAN", "Requirements": [ "R", "htmlwidgets", - "purrr", "rlang", - "stringr", "vctrs" ], - "Hash": "aa5a3864397ce6ae03458f98618395a1" + "Hash": "bffa126bf92987e677c12cfb5651fc1d" }, "progress": { "Package": "progress", @@ -1597,14 +1592,14 @@ }, "ps": { "Package": "ps", - "Version": "1.7.7", + "Version": "1.8.1", "Source": "Repository", "Repository": "CRAN", "Requirements": [ "R", "utils" ], - "Hash": "878b467580097e9c383acbb16adab57a" + "Hash": "b4404b1de13758dea1c0484ad0d48563" }, "purrr": { "Package": "purrr", @@ -1623,14 +1618,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", @@ -1735,8 +1730,13 @@ }, "renv": { "Package": "renv", - "Version": "1.0.7", - "Source": "Repository" + "Version": "1.0.11", + "Source": "Repository", + "Repository": "CRAN", + "Requirements": [ + "utils" + ], + "Hash": "47623f66b4e80b3b0587bc5d7b309888" }, "repr": { "Package": "repr", @@ -1789,7 +1789,7 @@ }, "rmarkdown": { "Package": "rmarkdown", - "Version": "2.27", + "Version": "2.29", "Source": "Repository", "Repository": "CRAN", "Requirements": [ @@ -1808,7 +1808,7 @@ "xfun", "yaml" ], - "Hash": "27f9502e1cdbfa195f94e03b0f517484" + "Hash": "df99277f63d01c34e95e3d2f06a79736" }, "roxygen2": { "Package": "roxygen2", @@ -1848,10 +1848,10 @@ }, "rstudioapi": { "Package": "rstudioapi", - "Version": "0.16.0", + "Version": "0.17.1", "Source": "Repository", "Repository": "CRAN", - "Hash": "96710351d642b70e8f02ddeb237c46a7" + "Hash": "5f90cd73946d706cfe26024294236113" }, "rversions": { "Package": "rversions", @@ -1946,7 +1946,7 @@ }, "shiny": { "Package": "shiny", - "Version": "1.8.1.1", + "Version": "1.9.1", "Source": "Repository", "Repository": "CRAN", "Requirements": [ @@ -1975,7 +1975,7 @@ "withr", "xtable" ], - "Hash": "54b26646816af9960a4c64d8ceec75d6" + "Hash": "6a293995a66e12c48d13aa1f957d09c7" }, "skimr": { "Package": "skimr", @@ -2067,10 +2067,10 @@ }, "sys": { "Package": "sys", - "Version": "3.4.2", + "Version": "3.4.3", "Source": "Repository", "Repository": "CRAN", - "Hash": "3a1be13d68d47a8cd0bfd74739ca1555" + "Hash": "de342ebfebdbf40477d0758d05426646" }, "systemfonts": { "Package": "systemfonts", @@ -2237,13 +2237,13 @@ }, "tinytex": { "Package": "tinytex", - "Version": "0.52", + "Version": "0.54", "Source": "Repository", "Repository": "CRAN", "Requirements": [ "xfun" ], - "Hash": "cfbad971a71f0e27cec22e544a08bc3b" + "Hash": "3ec7e3ddcacc2d34a9046941222bf94d" }, "tzdb": { "Package": "tzdb", @@ -2272,7 +2272,7 @@ }, "usethis": { "Package": "usethis", - "Version": "2.2.3", + "Version": "3.0.0", "Source": "Repository", "Repository": "CRAN", "Requirements": [ @@ -2299,7 +2299,7 @@ "withr", "yaml" ], - "Hash": "d524fd42c517035027f866064417d7e6" + "Hash": "b2fbf93c2127bedd2cbe9b799530d5d2" }, "utf8": { "Package": "utf8", @@ -2313,13 +2313,13 @@ }, "uuid": { "Package": "uuid", - "Version": "1.2-0", + "Version": "1.2-1", "Source": "Repository", "Repository": "CRAN", "Requirements": [ "R" ], - "Hash": "303c19bfd970bece872f93a824e323d9" + "Hash": "34e965e62a41fcafb1ca60e9b142085b" }, "vctrs": { "Package": "vctrs", @@ -2386,21 +2386,18 @@ }, "waldo": { "Package": "waldo", - "Version": "0.5.2", + "Version": "0.6.1", "Source": "Repository", "Repository": "CRAN", "Requirements": [ "R", "cli", "diffobj", - "fansi", "glue", "methods", - "rematch2", - "rlang", - "tibble" + "rlang" ], - "Hash": "c7d3fd6d29ab077cbac8f0e2751449e6" + "Hash": "52f574062a7b66e56926988c3fbdb3b7" }, "webshot": { "Package": "webshot", @@ -2424,7 +2421,7 @@ }, "withr": { "Package": "withr", - "Version": "3.0.0", + "Version": "3.0.2", "Source": "Repository", "Repository": "CRAN", "Requirements": [ @@ -2432,19 +2429,20 @@ "grDevices", "graphics" ], - "Hash": "d31b6c62c10dcf11ec530ca6b0dd5d35" + "Hash": "cc2d62c76458d425210d1eb1478b30b4" }, "xfun": { "Package": "xfun", - "Version": "0.46", + "Version": "0.49", "Source": "Repository", "Repository": "CRAN", "Requirements": [ + "R", "grDevices", "stats", "tools" ], - "Hash": "00ce32f398db0415dde61abfef11300c" + "Hash": "8687398773806cfff9401a2feca96298" }, "xml2": { "Package": "xml2", @@ -2484,7 +2482,7 @@ }, "xts": { "Package": "xts", - "Version": "0.14.0", + "Version": "0.14.1", "Source": "Repository", "Repository": "CRAN", "Requirements": [ @@ -2492,14 +2490,14 @@ "methods", "zoo" ], - "Hash": "288bc0fd02bb4e1489f37831d8803b2b" + "Hash": "be0d8259b62c520dac5097ad7ba9baea" }, "yaml": { "Package": "yaml", - "Version": "2.3.9", + "Version": "2.3.10", "Source": "Repository", "Repository": "CRAN", - "Hash": "9cb28d11799d93c953f852083d55ee9e" + "Hash": "51dab85c6c98e50a18d7551e9d49f76c" }, "zip": { "Package": "zip", diff --git a/renv/activate.R b/renv/activate.R index d13f9932a..0eb51088a 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)