Skip to content

Commit

Permalink
Update base image and packages
Browse files Browse the repository at this point in the history
  • Loading branch information
wkmor1 committed Mar 14, 2024
1 parent 7b28a8b commit e15de72
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 30 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM ghcr.io/luomus/base-r-image@sha256:0f9cc984724cfc5a268ecc9bfea057fc8f6ef2251f7dcf96baa173de4579e711
FROM ghcr.io/luomus/base-r-image@sha256:b274fdd5ea06de31652330f805ea75e4ecdfb054399a2da812088fde11e3e309

ENV FINBIF_USER_AGENT=https://github.com/luomus/fin-biodiv-indicators

Expand Down
39 changes: 19 additions & 20 deletions renv.lock
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"R": {
"Version": "4.3.2",
"Version": "4.3.3",
"Repositories": [
{
"Name": "CRAN",
Expand Down Expand Up @@ -104,7 +104,7 @@
},
"RcppEigen": {
"Package": "RcppEigen",
"Version": "0.3.3.9.4",
"Version": "0.3.4.0.0",
"Source": "Repository",
"Repository": "CRAN",
"Requirements": [
Expand All @@ -113,7 +113,7 @@
"stats",
"utils"
],
"Hash": "acb0a5bf38490f26ab8661b467f4f53a"
"Hash": "df49e3306f232ec28f1604e36a202847"
},
"abind": {
"Package": "abind",
Expand Down Expand Up @@ -352,24 +352,24 @@
},
"curl": {
"Package": "curl",
"Version": "5.2.0",
"Version": "5.2.1",
"Source": "Repository",
"Repository": "CRAN",
"Requirements": [
"R"
],
"Hash": "ce88d13c0b10fe88a37d9c59dba2d7f9"
"Hash": "411ca2c03b1ce5f548345d2fc2685f7a"
},
"data.table": {
"Package": "data.table",
"Version": "1.15.0",
"Version": "1.15.2",
"Source": "Repository",
"Repository": "CRAN",
"Requirements": [
"R",
"methods"
],
"Hash": "cfbbb4aed6e78cd45f17123a9ec9981a"
"Hash": "536dfe4ac4093b5d115caed7a1a7223b"
},
"dbplyr": {
"Package": "dbplyr",
Expand Down Expand Up @@ -429,14 +429,14 @@
},
"digest": {
"Package": "digest",
"Version": "0.6.34",
"Version": "0.6.35",
"Source": "Repository",
"Repository": "CRAN",
"Requirements": [
"R",
"utils"
],
"Hash": "7ede2ee9ea8d3edbf1ca84c1e333ad1a"
"Hash": "698ece7ba5a4fa4559e3d537e7ec3d31"
},
"downlit": {
"Package": "downlit",
Expand Down Expand Up @@ -1155,14 +1155,14 @@
},
"ragg": {
"Package": "ragg",
"Version": "1.2.7",
"Version": "1.3.0",
"Source": "Repository",
"Repository": "CRAN",
"Requirements": [
"systemfonts",
"textshaping"
],
"Hash": "90a1b8b7e518d7f90480d56453b4d062"
"Hash": "082e1a198e3329d571f4448ef0ede4bc"
},
"rapidoc": {
"Package": "rapidoc",
Expand Down Expand Up @@ -1211,13 +1211,13 @@
},
"renv": {
"Package": "renv",
"Version": "1.0.4",
"Version": "1.0.5",
"Source": "Repository",
"Repository": "CRAN",
"Requirements": [
"utils"
],
"Hash": "11abaf7c540ff33f94514d50f929bfd1"
"Hash": "32c3f93e8360f667ca5863272ec8ba6a"
},
"rlang": {
"Package": "rlang",
Expand All @@ -1232,7 +1232,7 @@
},
"rmarkdown": {
"Package": "rmarkdown",
"Version": "2.25",
"Version": "2.26",
"Source": "Repository",
"Repository": "CRAN",
"Requirements": [
Expand All @@ -1245,14 +1245,13 @@
"jsonlite",
"knitr",
"methods",
"stringr",
"tinytex",
"tools",
"utils",
"xfun",
"yaml"
],
"Hash": "d65e35823c817f09f4de424fcdfa812a"
"Hash": "9b148e7f95d33aac01f31282d49e4f44"
},
"rprojroot": {
"Package": "rprojroot",
Expand Down Expand Up @@ -1391,14 +1390,14 @@
},
"systemfonts": {
"Package": "systemfonts",
"Version": "1.0.5",
"Version": "1.0.6",
"Source": "Repository",
"Repository": "CRAN",
"Requirements": [
"R",
"cpp11"
],
"Hash": "15b594369e70b975ba9f064295983499"
"Hash": "6d538cff441f0f1f36db2209ac7495ac"
},
"testthat": {
"Package": "testthat",
Expand Down Expand Up @@ -1496,7 +1495,7 @@
},
"tidyselect": {
"Package": "tidyselect",
"Version": "1.2.0",
"Version": "1.2.1",
"Source": "Repository",
"Repository": "CRAN",
"Requirements": [
Expand All @@ -1508,7 +1507,7 @@
"vctrs",
"withr"
],
"Hash": "79540e5fcd9e0435af547d885f184fd5"
"Hash": "829f27b9c4919c16b593794a6344d6c0"
},
"timechange": {
"Package": "timechange",
Expand Down
39 changes: 30 additions & 9 deletions renv/activate.R
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
local({

# the requested version of renv
version <- "1.0.4"
version <- "1.0.5"
attr(version, "sha") <- NULL

# the project directory
Expand Down Expand Up @@ -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(
Expand All @@ -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")
Expand Down Expand Up @@ -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)

Expand All @@ -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)

Expand All @@ -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]]

Expand Down Expand Up @@ -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))) {
Expand All @@ -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))
}
}

Expand Down

0 comments on commit e15de72

Please sign in to comment.