Skip to content

Commit

Permalink
Merge pull request #159 from swcarpentry/update/packages
Browse files Browse the repository at this point in the history
Update 12 packages
  • Loading branch information
nselem authored May 7, 2024
2 parents 84dbaf9 + d0ed1b8 commit 91f546a
Show file tree
Hide file tree
Showing 2 changed files with 49 additions and 30 deletions.
43 changes: 31 additions & 12 deletions renv/activate.R
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,13 @@
local({

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

# the project directory
project <- getwd()
project <- Sys.getenv("RENV_PROJECT")
if (!nzchar(project))
project <- getwd()

# use start-up diagnostics if enabled
diagnostics <- Sys.getenv("RENV_STARTUP_DIAGNOSTICS", unset = "FALSE")
Expand Down Expand Up @@ -129,6 +131,21 @@ local({

}

heredoc <- function(text, leave = 0) {

# remove leading, trailing whitespace
trimmed <- gsub("^\\s*\\n|\\n\\s*$", "", text)

# split into lines
lines <- strsplit(trimmed, "\n", fixed = TRUE)[[1L]]

# compute common indent
indent <- regexpr("[^[:space:]]", lines)
common <- min(setdiff(indent, -1L)) - leave
paste(substring(lines, common), collapse = "\n")

}

startswith <- function(string, prefix) {
substring(string, 1, nchar(prefix)) == prefix
}
Expand Down Expand Up @@ -631,6 +648,9 @@ local({

# if the user has requested an automatic prefix, generate it
auto <- Sys.getenv("RENV_PATHS_PREFIX_AUTO", unset = NA)
if (is.na(auto) && getRversion() >= "4.4.0")
auto <- "TRUE"

if (auto %in% c("TRUE", "True", "true", "1"))
return(renv_bootstrap_platform_prefix_auto())

Expand Down Expand Up @@ -822,24 +842,23 @@ local({

# the loaded version of renv doesn't match the requested version;
# give the user instructions on how to proceed
remote <- if (!is.null(description[["RemoteSha"]])) {
dev <- identical(description[["RemoteType"]], "github")
remote <- if (dev)
paste("rstudio/renv", description[["RemoteSha"]], sep = "@")
} else {
else
paste("renv", description[["Version"]], sep = "@")
}

# display both loaded version + sha if available
friendly <- renv_bootstrap_version_friendly(
version = description[["Version"]],
sha = description[["RemoteSha"]]
sha = if (dev) description[["RemoteSha"]]
)

fmt <- paste(
"renv %1$s was loaded from project library, but this project is configured to use renv %2$s.",
"- Use `renv::record(\"%3$s\")` to record renv %1$s in the lockfile.",
"- Use `renv::restore(packages = \"renv\")` to install renv %2$s into the project library.",
sep = "\n"
)
fmt <- heredoc("
renv %1$s was loaded from project library, but this project is configured to use renv %2$s.
- Use `renv::record(\"%3$s\")` to record renv %1$s in the lockfile.
- Use `renv::restore(packages = \"renv\")` to install renv %2$s into the project library.
")
catf(fmt, friendly, renv_bootstrap_version_friendly(version), remote)

FALSE
Expand Down
36 changes: 18 additions & 18 deletions renv/profiles/lesson-requirements/renv.lock
Original file line number Diff line number Diff line change
Expand Up @@ -317,14 +317,14 @@
},
"fs": {
"Package": "fs",
"Version": "1.6.3",
"Version": "1.6.4",
"Source": "Repository",
"Repository": "CRAN",
"Requirements": [
"R",
"methods"
],
"Hash": "47b5f30c720c23999b913a1a635cf0bb"
"Hash": "15aeb8c27f5ea5161f9f6a641fafd93a"
},
"generics": {
"Package": "generics",
Expand All @@ -339,7 +339,7 @@
},
"ggplot2": {
"Package": "ggplot2",
"Version": "3.5.0",
"Version": "3.5.1",
"Source": "Repository",
"Repository": "CRAN",
"Requirements": [
Expand All @@ -360,7 +360,7 @@
"vctrs",
"withr"
],
"Hash": "52ef83f93f74833007f193b2d4c159a2"
"Hash": "44c6a2f8202d5b7e878ea274b1092426"
},
"glue": {
"Package": "glue",
Expand All @@ -375,7 +375,7 @@
},
"gtable": {
"Package": "gtable",
"Version": "0.3.4",
"Version": "0.3.5",
"Source": "Repository",
"Repository": "CRAN",
"Requirements": [
Expand All @@ -386,7 +386,7 @@
"lifecycle",
"rlang"
],
"Hash": "b29cf3031f49b04ab9c852c912547eef"
"Hash": "e18861963cbc65a27736e02b3cd3c4a0"
},
"highr": {
"Package": "highr",
Expand Down Expand Up @@ -415,7 +415,7 @@
},
"htmltools": {
"Package": "htmltools",
"Version": "0.5.8",
"Version": "0.5.8.1",
"Source": "Repository",
"Repository": "CRAN",
"Requirements": [
Expand All @@ -427,7 +427,7 @@
"rlang",
"utils"
],
"Hash": "149431ee39aba5bdc264112c8ff94444"
"Hash": "81d371a9cc60640e74e4ab6ac46dcedc"
},
"htmlwidgets": {
"Package": "htmlwidgets",
Expand Down Expand Up @@ -500,7 +500,7 @@
},
"knitr": {
"Package": "knitr",
"Version": "1.45",
"Version": "1.46",
"Source": "Repository",
"Repository": "CRAN",
"Requirements": [
Expand All @@ -512,7 +512,7 @@
"xfun",
"yaml"
],
"Hash": "1ec462871063897135c1bcbe0fc8f07d"
"Hash": "6e008ab1d696a5283c79765fa7b56b47"
},
"labeling": {
"Package": "labeling",
Expand All @@ -529,7 +529,7 @@
"Package": "lattice",
"Version": "0.22-6",
"Source": "Repository",
"Repository": "CRAN",
"Repository": "RSPM",
"Requirements": [
"R",
"grDevices",
Expand Down Expand Up @@ -738,13 +738,13 @@
},
"renv": {
"Package": "renv",
"Version": "1.0.5",
"Version": "1.0.7",
"Source": "Repository",
"Repository": "CRAN",
"Requirements": [
"utils"
],
"Hash": "32c3f93e8360f667ca5863272ec8ba6a"
"Hash": "397b7b2a265bc5a7a06852524dabae20"
},
"rlang": {
"Package": "rlang",
Expand Down Expand Up @@ -823,16 +823,16 @@
},
"stringi": {
"Package": "stringi",
"Version": "1.8.3",
"Version": "1.8.4",
"Source": "Repository",
"Repository": "RSPM",
"Repository": "carpentries",
"Requirements": [
"R",
"stats",
"tools",
"utils"
],
"Hash": "058aebddea264f4c99401515182e656a"
"Hash": "39e1144fd75428983dc3f63aa53dfa91"
},
"stringr": {
"Package": "stringr",
Expand Down Expand Up @@ -911,13 +911,13 @@
},
"tinytex": {
"Package": "tinytex",
"Version": "0.50",
"Version": "0.51",
"Source": "Repository",
"Repository": "CRAN",
"Requirements": [
"xfun"
],
"Hash": "be7a76845222ad20adb761f462eed3ea"
"Hash": "d44e2fcd2e4e076f0aac540208559d1d"
},
"tzdb": {
"Package": "tzdb",
Expand Down

0 comments on commit 91f546a

Please sign in to comment.