Skip to content

Commit c0b1350

Browse files
lorenzwalthertgithub-actions[bot]
authored andcommitted
Update renv dependencies
1 parent 208dced commit c0b1350

File tree

2 files changed

+114
-28
lines changed

2 files changed

+114
-28
lines changed

renv.lock

Lines changed: 18 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"Repositories": [
55
{
66
"Name": "RSPM",
7-
"URL": "https://packagemanager.posit.co/cran/2024-09-12"
7+
"URL": "https://packagemanager.posit.co/cran/2024-10-11"
88
}
99
]
1010
},
@@ -137,10 +137,10 @@
137137
},
138138
"commonmark": {
139139
"Package": "commonmark",
140-
"Version": "1.9.1",
140+
"Version": "1.9.2",
141141
"Source": "Repository",
142142
"Repository": "RSPM",
143-
"Hash": "5d8225445acb167abf7797de48b2ee3c"
143+
"Hash": "14eb0596f987c71535d07c3aff814742"
144144
},
145145
"cpp11": {
146146
"Package": "cpp11",
@@ -214,14 +214,13 @@
214214
},
215215
"evaluate": {
216216
"Package": "evaluate",
217-
"Version": "0.24.0",
217+
"Version": "1.0.1",
218218
"Source": "Repository",
219219
"Repository": "RSPM",
220220
"Requirements": [
221-
"R",
222-
"methods"
221+
"R"
223222
],
224-
"Hash": "a1066cbc05caee9a4bf6d90f194ff4da"
223+
"Hash": "3fd29944b231036ad67c3edb32e02201"
225224
},
226225
"fs": {
227226
"Package": "fs",
@@ -236,14 +235,14 @@
236235
},
237236
"glue": {
238237
"Package": "glue",
239-
"Version": "1.7.0",
238+
"Version": "1.8.0",
240239
"Source": "Repository",
241240
"Repository": "RSPM",
242241
"Requirements": [
243242
"R",
244243
"methods"
245244
],
246-
"Hash": "e0b3a53876554bd45879e596cdb10a52"
245+
"Hash": "5899f1eaa825580172bb56c08266f37c"
247246
},
248247
"here": {
249248
"Package": "here",
@@ -268,15 +267,15 @@
268267
},
269268
"hunspell": {
270269
"Package": "hunspell",
271-
"Version": "3.0.4",
270+
"Version": "3.0.5",
272271
"Source": "Repository",
273272
"Repository": "RSPM",
274273
"Requirements": [
275274
"R",
276275
"Rcpp",
277276
"digest"
278277
],
279-
"Hash": "f543163714aba1ff9e8cfe76d8d15381"
278+
"Hash": "e58f80d4c5b4f0bab1456956d6ca6aad"
280279
},
281280
"knitr": {
282281
"Package": "knitr",
@@ -400,14 +399,14 @@
400399
},
401400
"ps": {
402401
"Package": "ps",
403-
"Version": "1.7.7",
402+
"Version": "1.8.0",
404403
"Source": "Repository",
405404
"Repository": "RSPM",
406405
"Requirements": [
407406
"R",
408407
"utils"
409408
],
410-
"Hash": "878b467580097e9c383acbb16adab57a"
409+
"Hash": "4b9c8485b0c7eecdf0a9ba5132a45576"
411410
},
412411
"purrr": {
413412
"Package": "purrr",
@@ -440,13 +439,13 @@
440439
},
441440
"renv": {
442441
"Package": "renv",
443-
"Version": "1.0.7",
442+
"Version": "1.0.10",
444443
"Source": "Repository",
445444
"Repository": "RSPM",
446445
"Requirements": [
447446
"utils"
448447
],
449-
"Hash": "397b7b2a265bc5a7a06852524dabae20"
448+
"Hash": "d0387d5687ec933dd7587efd4cfa2d85"
450449
},
451450
"rex": {
452451
"Package": "rex",
@@ -507,7 +506,7 @@
507506
},
508507
"spelling": {
509508
"Package": "spelling",
510-
"Version": "2.3.0",
509+
"Version": "2.3.1",
511510
"Source": "Repository",
512511
"Repository": "RSPM",
513512
"Requirements": [
@@ -516,7 +515,7 @@
516515
"knitr",
517516
"xml2"
518517
],
519-
"Hash": "632e9e83d3dc774d361b9415b15642bb"
518+
"Hash": "e167300a047e21d28c754b00cbfc55ef"
520519
},
521520
"stringi": {
522521
"Package": "stringi",
@@ -595,7 +594,7 @@
595594
},
596595
"xfun": {
597596
"Package": "xfun",
598-
"Version": "0.47",
597+
"Version": "0.48",
599598
"Source": "Repository",
600599
"Repository": "RSPM",
601600
"Requirements": [
@@ -604,7 +603,7 @@
604603
"stats",
605604
"tools"
606605
],
607-
"Hash": "36ab21660e2d095fef0d83f689e0477c"
606+
"Hash": "89e455b87c84e227eb7f60a1b4e5fe1f"
608607
},
609608
"xml2": {
610609
"Package": "xml2",

renv/activate.R

Lines changed: 96 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
local({
33

44
# the requested version of renv
5-
version <- "1.0.7"
5+
version <- "1.0.10"
66
attr(version, "sha") <- NULL
77

88
# the project directory
@@ -98,6 +98,66 @@ local({
9898
unloadNamespace("renv")
9999

100100
# load bootstrap tools
101+
ansify <- function(text) {
102+
if (renv_ansify_enabled())
103+
renv_ansify_enhanced(text)
104+
else
105+
renv_ansify_default(text)
106+
}
107+
108+
renv_ansify_enabled <- function() {
109+
110+
override <- Sys.getenv("RENV_ANSIFY_ENABLED", unset = NA)
111+
if (!is.na(override))
112+
return(as.logical(override))
113+
114+
pane <- Sys.getenv("RSTUDIO_CHILD_PROCESS_PANE", unset = NA)
115+
if (identical(pane, "build"))
116+
return(FALSE)
117+
118+
testthat <- Sys.getenv("TESTTHAT", unset = "false")
119+
if (tolower(testthat) %in% "true")
120+
return(FALSE)
121+
122+
iderun <- Sys.getenv("R_CLI_HAS_HYPERLINK_IDE_RUN", unset = "false")
123+
if (tolower(iderun) %in% "false")
124+
return(FALSE)
125+
126+
TRUE
127+
128+
}
129+
130+
renv_ansify_default <- function(text) {
131+
text
132+
}
133+
134+
renv_ansify_enhanced <- function(text) {
135+
136+
# R help links
137+
pattern <- "`\\?(renv::(?:[^`])+)`"
138+
replacement <- "`\033]8;;ide:help:\\1\a?\\1\033]8;;\a`"
139+
text <- gsub(pattern, replacement, text, perl = TRUE)
140+
141+
# runnable code
142+
pattern <- "`(renv::(?:[^`])+)`"
143+
replacement <- "`\033]8;;ide:run:\\1\a\\1\033]8;;\a`"
144+
text <- gsub(pattern, replacement, text, perl = TRUE)
145+
146+
# return ansified text
147+
text
148+
149+
}
150+
151+
renv_ansify_init <- function() {
152+
153+
envir <- renv_envir_self()
154+
if (renv_ansify_enabled())
155+
assign("ansify", renv_ansify_enhanced, envir = envir)
156+
else
157+
assign("ansify", renv_ansify_default, envir = envir)
158+
159+
}
160+
101161
`%||%` <- function(x, y) {
102162
if (is.null(x)) y else x
103163
}
@@ -142,7 +202,10 @@ local({
142202
# compute common indent
143203
indent <- regexpr("[^[:space:]]", lines)
144204
common <- min(setdiff(indent, -1L)) - leave
145-
paste(substring(lines, common), collapse = "\n")
205+
text <- paste(substring(lines, common), collapse = "\n")
206+
207+
# substitute in ANSI links for executable renv code
208+
ansify(text)
146209

147210
}
148211

@@ -306,7 +369,11 @@ local({
306369
)
307370

308371
if ("headers" %in% names(formals(utils::download.file)))
309-
args$headers <- renv_bootstrap_download_custom_headers(url)
372+
{
373+
headers <- renv_bootstrap_download_custom_headers(url)
374+
if (length(headers) && is.character(headers))
375+
args$headers <- headers
376+
}
310377

311378
do.call(utils::download.file, args)
312379

@@ -385,10 +452,22 @@ local({
385452
for (type in types) {
386453
for (repos in renv_bootstrap_repos()) {
387454

455+
# build arguments for utils::available.packages() call
456+
args <- list(type = type, repos = repos)
457+
458+
# add custom headers if available -- note that
459+
# utils::available.packages() will pass this to download.file()
460+
if ("headers" %in% names(formals(utils::download.file)))
461+
{
462+
headers <- renv_bootstrap_download_custom_headers(url)
463+
if (length(headers) && is.character(headers))
464+
args$headers <- headers
465+
}
466+
388467
# retrieve package database
389468
db <- tryCatch(
390469
as.data.frame(
391-
utils::available.packages(type = type, repos = repos),
470+
do.call(utils::available.packages, args),
392471
stringsAsFactors = FALSE
393472
),
394473
error = identity
@@ -470,23 +549,31 @@ local({
470549

471550
}
472551

552+
renv_bootstrap_github_token <- function() {
553+
for (envvar in c("GITHUB_TOKEN", "GITHUB_PAT", "GH_TOKEN")) {
554+
envval <- Sys.getenv(envvar, unset = NA)
555+
if (!is.na(envval))
556+
return(envval)
557+
}
558+
}
559+
473560
renv_bootstrap_download_github <- function(version) {
474561

475562
enabled <- Sys.getenv("RENV_BOOTSTRAP_FROM_GITHUB", unset = "TRUE")
476563
if (!identical(enabled, "TRUE"))
477564
return(FALSE)
478565

479566
# prepare download options
480-
pat <- Sys.getenv("GITHUB_PAT")
481-
if (nzchar(Sys.which("curl")) && nzchar(pat)) {
567+
token <- renv_bootstrap_github_token()
568+
if (nzchar(Sys.which("curl")) && nzchar(token)) {
482569
fmt <- "--location --fail --header \"Authorization: token %s\""
483-
extra <- sprintf(fmt, pat)
570+
extra <- sprintf(fmt, token)
484571
saved <- options("download.file.method", "download.file.extra")
485572
options(download.file.method = "curl", download.file.extra = extra)
486573
on.exit(do.call(base::options, saved), add = TRUE)
487-
} else if (nzchar(Sys.which("wget")) && nzchar(pat)) {
574+
} else if (nzchar(Sys.which("wget")) && nzchar(token)) {
488575
fmt <- "--header=\"Authorization: token %s\""
489-
extra <- sprintf(fmt, pat)
576+
extra <- sprintf(fmt, token)
490577
saved <- options("download.file.method", "download.file.extra")
491578
options(download.file.method = "wget", download.file.extra = extra)
492579
on.exit(do.call(base::options, saved), add = TRUE)

0 commit comments

Comments
 (0)