From 2a01e3c30ac8ebebc986ec3d17ca33b0369d6ffd Mon Sep 17 00:00:00 2001 From: Lorenz Walthert Date: Thu, 11 Jan 2024 21:48:33 +0100 Subject: [PATCH 1/7] move source down again --- inst/update-existing-hook-dependencies.R | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/inst/update-existing-hook-dependencies.R b/inst/update-existing-hook-dependencies.R index 4614e0da6..a46aed812 100644 --- a/inst/update-existing-hook-dependencies.R +++ b/inst/update-existing-hook-dependencies.R @@ -1,5 +1,3 @@ -source("renv/activate.R") - options( repos = c(RSPM = renv::lockfile_read()$R$Repositories$RSPM), # CRAN is not an option, always use PPM install.packages.check.source = "no", # don't check if source packages are available @@ -7,6 +5,7 @@ options( ) renv::install("jsonlite") renv_deps <- names(jsonlite::read_json("renv.lock")$Packages) +source("renv/activate.R") renv::load() renv::restore(prompt = FALSE) can_be_updated <- renv::update(setdiff(renv_deps, "renv"), prompt = FALSE, check = FALSE) From 73c5012787ac14faac5187df7f3175eb2bd48baa Mon Sep 17 00:00:00 2001 From: Lorenz Walthert Date: Thu, 11 Jan 2024 21:58:04 +0100 Subject: [PATCH 2/7] common prep for options [ci skip] --- .pre-commit-config.yaml | 2 +- inst/update-dependency-graph-existing-packages.R | 8 +------- inst/update-existing-hook-dependencies.R | 6 +----- inst/update-renv-prepare.R | 5 +++++ 4 files changed, 8 insertions(+), 13 deletions(-) create mode 100644 inst/update-renv-prepare.R diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index d437ab5c3..5a533ab9b 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -83,7 +83,7 @@ repos: (?x)^( inst/hooks/exported/pkgdown.R| tests/testthat/in/.*| - inst/renv-update\.R| + inst/update-renv-prepare.R| inst/update-ppm-url.R| inst/update-dependency-graph-existing-packages\.R| inst/update-existing-hook-dependencies\.R| diff --git a/inst/update-dependency-graph-existing-packages.R b/inst/update-dependency-graph-existing-packages.R index 5ded0a13c..8be8925e1 100644 --- a/inst/update-dependency-graph-existing-packages.R +++ b/inst/update-dependency-graph-existing-packages.R @@ -14,14 +14,8 @@ hook_deps <- function(root) { out <- names(renv:::renv_package_dependencies(out)) return(sort(out)) } -options( - # repos = c( - # RSPM = "https://packagemanager.rstudio.com/all/latest", - # CRAN = "https://cran.rstudio.com" - # ), - install.packages.compile.from.source = "never" -) +source("inst/update-renv-prepare.R") options(renv.snapshot.filter = hook_deps) renv::snapshot(type = "custom", prompt = FALSE) diff --git a/inst/update-existing-hook-dependencies.R b/inst/update-existing-hook-dependencies.R index a46aed812..82b3caade 100644 --- a/inst/update-existing-hook-dependencies.R +++ b/inst/update-existing-hook-dependencies.R @@ -1,8 +1,4 @@ -options( - repos = c(RSPM = renv::lockfile_read()$R$Repositories$RSPM), # CRAN is not an option, always use PPM - install.packages.check.source = "no", # don't check if source packages are available - install.packages.compile.from.source = "never" # probably redundant with the above 'no': If source package is available, only use source if no code needs to be compiled (needs compilation flag on CRAN). -) +source("inst/update-renv-prepare.R") renv::install("jsonlite") renv_deps <- names(jsonlite::read_json("renv.lock")$Packages) source("renv/activate.R") diff --git a/inst/update-renv-prepare.R b/inst/update-renv-prepare.R new file mode 100644 index 000000000..08e7b7eb4 --- /dev/null +++ b/inst/update-renv-prepare.R @@ -0,0 +1,5 @@ +options( + repos = c(RSPM = renv::lockfile_read()$R$Repositories$RSPM), # CRAN is not an option, always use PPM + install.packages.check.source = "no", # don't check if source packages are available + install.packages.compile.from.source = "never" # probably redundant with the above 'no': If source package is available, only use source if no code needs to be compiled (needs compilation flag on CRAN). +) From cbfd591609d08221ed9a9be3b0b7b4ce5f6ecf4d Mon Sep 17 00:00:00 2001 From: Lorenz Walthert Date: Thu, 11 Jan 2024 22:03:51 +0100 Subject: [PATCH 3/7] use system renv before using renv's renv version --- inst/update-dependency-graph-existing-packages.R | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/inst/update-dependency-graph-existing-packages.R b/inst/update-dependency-graph-existing-packages.R index 8be8925e1..d63781cab 100644 --- a/inst/update-dependency-graph-existing-packages.R +++ b/inst/update-dependency-graph-existing-packages.R @@ -1,5 +1,3 @@ -source("renv/activate.R") - hook_deps <- function(root) { out <- renv::dependencies("inst/hooks/exported/")$Package desc <- desc::desc() @@ -16,6 +14,7 @@ hook_deps <- function(root) { } source("inst/update-renv-prepare.R") +source("renv/activate.R") options(renv.snapshot.filter = hook_deps) renv::snapshot(type = "custom", prompt = FALSE) From 738b108438d5faf2442e9288fe5d7cbbc28aa40d Mon Sep 17 00:00:00 2001 From: Lorenz Walthert Date: Thu, 11 Jan 2024 22:07:15 +0100 Subject: [PATCH 4/7] make things work for older renv versions too --- inst/update-renv-prepare.R | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/inst/update-renv-prepare.R b/inst/update-renv-prepare.R index 08e7b7eb4..4f64fe785 100644 --- a/inst/update-renv-prepare.R +++ b/inst/update-renv-prepare.R @@ -1,5 +1,10 @@ +# emulate renv::lockfile_read()$R$Repositories$RSPM, which is not available on previous version of renv + options( - repos = c(RSPM = renv::lockfile_read()$R$Repositories$RSPM), # CRAN is not an option, always use PPM + repos = c(RSPM = { + all_repos <- jsonlite::read_json("renv.lock")$R$Repositories + all_repos[sapply(all_repos, \(x) x$Name == "RSPM")][[1]]$URL + }), # CRAN is not an option, always use PPM install.packages.check.source = "no", # don't check if source packages are available install.packages.compile.from.source = "never" # probably redundant with the above 'no': If source package is available, only use source if no code needs to be compiled (needs compilation flag on CRAN). ) From adc6283addf0345bf7c03ec7a9c25c07b93b34ea Mon Sep 17 00:00:00 2001 From: Lorenz Walthert Date: Thu, 11 Jan 2024 22:16:11 +0100 Subject: [PATCH 5/7] move json lite installation out of script [ci skip] --- .github/workflows/hook-dependencies-update.yml | 4 ++-- inst/update-existing-hook-dependencies.R | 1 - 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/hook-dependencies-update.yml b/.github/workflows/hook-dependencies-update.yml index 0fcb8cf29..fe15ea385 100644 --- a/.github/workflows/hook-dependencies-update.yml +++ b/.github/workflows/hook-dependencies-update.yml @@ -33,8 +33,8 @@ jobs: Rscript -e "install.packages('remotes'); remotes::install_github('r-hub/sysreqs')" sysreqs=$(Rscript -e "cat(sysreqs::sysreq_commands('DESCRIPTION'))") sudo -s eval "$sysreqs" - - name: install renv - run: Rscript -e "install.packages('renv')" + - name: install runtime dependencies + run: Rscript -e "install.packages(c('renv', 'jsonlite'))" - name: update PPM URL run: Rscript inst/update-ppm-url.R - name: update dependency graph among packages diff --git a/inst/update-existing-hook-dependencies.R b/inst/update-existing-hook-dependencies.R index 82b3caade..9be3c4f4e 100644 --- a/inst/update-existing-hook-dependencies.R +++ b/inst/update-existing-hook-dependencies.R @@ -1,5 +1,4 @@ source("inst/update-renv-prepare.R") -renv::install("jsonlite") renv_deps <- names(jsonlite::read_json("renv.lock")$Packages) source("renv/activate.R") renv::load() From 7fd41788fc87e03fb40877c645d12374aef24ce5 Mon Sep 17 00:00:00 2001 From: Lorenz Walthert Date: Thu, 11 Jan 2024 22:37:07 +0100 Subject: [PATCH 6/7] erase cran form lock file to ensure only rspm is used [ci skip] --- inst/update-renv-prepare.R | 6 ------ renv.lock | 4 ---- 2 files changed, 10 deletions(-) diff --git a/inst/update-renv-prepare.R b/inst/update-renv-prepare.R index 4f64fe785..26374e941 100644 --- a/inst/update-renv-prepare.R +++ b/inst/update-renv-prepare.R @@ -1,10 +1,4 @@ -# emulate renv::lockfile_read()$R$Repositories$RSPM, which is not available on previous version of renv - options( - repos = c(RSPM = { - all_repos <- jsonlite::read_json("renv.lock")$R$Repositories - all_repos[sapply(all_repos, \(x) x$Name == "RSPM")][[1]]$URL - }), # CRAN is not an option, always use PPM install.packages.check.source = "no", # don't check if source packages are available install.packages.compile.from.source = "never" # probably redundant with the above 'no': If source package is available, only use source if no code needs to be compiled (needs compilation flag on CRAN). ) diff --git a/renv.lock b/renv.lock index 282120109..ad5fb7683 100644 --- a/renv.lock +++ b/renv.lock @@ -5,10 +5,6 @@ { "Name": "RSPM", "URL": "https://packagemanager.posit.co/cran/2023-11-17" - }, - { - "Name": "CRAN", - "URL": "https://cran.rstudio.com" } ] }, From db5cad94a8bcdaa4343f8bc0ff7c5981132d1dab Mon Sep 17 00:00:00 2001 From: lorenzwalthert Date: Thu, 11 Jan 2024 21:45:43 +0000 Subject: [PATCH 7/7] Update renv dependencies --- renv.lock | 66 +++++++++++++++++++++++-------------------------------- 1 file changed, 27 insertions(+), 39 deletions(-) diff --git a/renv.lock b/renv.lock index ad5fb7683..e0a5c693e 100644 --- a/renv.lock +++ b/renv.lock @@ -4,7 +4,7 @@ "Repositories": [ { "Name": "RSPM", - "URL": "https://packagemanager.posit.co/cran/2023-11-17" + "URL": "https://packagemanager.posit.co/cran/2024-01-08" } ] }, @@ -50,7 +50,7 @@ }, "R.utils": { "Package": "R.utils", - "Version": "2.12.2", + "Version": "2.12.3", "Source": "Repository", "Repository": "RSPM", "Requirements": [ @@ -61,7 +61,7 @@ "tools", "utils" ], - "Hash": "325f01db13da12c04d8f6e7be36ff514" + "Hash": "3dc2829b790254bfba21e60965787651" }, "R6": { "Package": "R6", @@ -96,10 +96,10 @@ }, "brew": { "Package": "brew", - "Version": "1.0-8", + "Version": "1.0-10", "Source": "Repository", "Repository": "RSPM", - "Hash": "d69a786e85775b126bddbee185ae6084" + "Hash": "8f4a384e19dccd8c65356dc096847b76" }, "callr": { "Package": "callr", @@ -116,14 +116,14 @@ }, "cli": { "Package": "cli", - "Version": "3.6.1", + "Version": "3.6.2", "Source": "Repository", "Repository": "RSPM", "Requirements": [ "R", "utils" ], - "Hash": "89e6d8219950eac806ae0c489052048a" + "Hash": "1216ac65ac55ec0058a6f75d7ca0fd52" }, "codetools": { "Package": "codetools", @@ -144,13 +144,13 @@ }, "cpp11": { "Package": "cpp11", - "Version": "0.4.6", + "Version": "0.4.7", "Source": "Repository", "Repository": "RSPM", "Requirements": [ "R" ], - "Hash": "707fae4bbf73697ec8d85f9d7076c061" + "Hash": "5a295d7d963cc5035284dcdbaf334f4e" }, "crayon": { "Package": "crayon", @@ -180,17 +180,16 @@ }, "desc": { "Package": "desc", - "Version": "1.4.2", + "Version": "1.4.3", "Source": "Repository", "Repository": "RSPM", "Requirements": [ "R", "R6", "cli", - "rprojroot", "utils" ], - "Hash": "6b9602c7ebbe87101a9c8edb6e8b6d21" + "Hash": "99b79fcbd6c4d1ce087f5c5c758b384f" }, "digest": { "Package": "digest", @@ -351,7 +350,7 @@ }, "pkgbuild": { "Package": "pkgbuild", - "Version": "1.4.2", + "Version": "1.4.3", "Source": "Repository", "Repository": "RSPM", "Requirements": [ @@ -359,13 +358,10 @@ "R6", "callr", "cli", - "crayon", "desc", - "prettyunits", - "processx", - "rprojroot" + "processx" ], - "Hash": "beb25b32a957a22a5c301a9e441190b3" + "Hash": "c0143443203205e6a2760ce553dafc24" }, "pkgload": { "Package": "pkgload", @@ -388,19 +384,9 @@ ], "Hash": "903d68319ae9923fb2e2ee7fa8230b91" }, - "prettyunits": { - "Package": "prettyunits", - "Version": "1.2.0", - "Source": "Repository", - "Repository": "RSPM", - "Requirements": [ - "R" - ], - "Hash": "6b01fc98b1e86c4f705ce9dcfd2f57c7" - }, "processx": { "Package": "processx", - "Version": "3.8.2", + "Version": "3.8.3", "Source": "Repository", "Repository": "RSPM", "Requirements": [ @@ -409,7 +395,7 @@ "ps", "utils" ], - "Hash": "3efbd8ac1be0296a46c55387aeace0f3" + "Hash": "82d48b1aec56084d9438dbf98087a7e9" }, "ps": { "Package": "ps", @@ -523,7 +509,7 @@ }, "stringi": { "Package": "stringi", - "Version": "1.8.1", + "Version": "1.8.3", "Source": "Repository", "Repository": "RSPM", "Requirements": [ @@ -532,7 +518,7 @@ "tools", "utils" ], - "Hash": "12bf57fdcb9b7068bea39b32f87ecac9" + "Hash": "058aebddea264f4c99401515182e656a" }, "stringr": { "Package": "stringr", @@ -572,7 +558,7 @@ }, "vctrs": { "Package": "vctrs", - "Version": "0.6.4", + "Version": "0.6.5", "Source": "Repository", "Repository": "RSPM", "Requirements": [ @@ -582,7 +568,7 @@ "lifecycle", "rlang" ], - "Hash": "266c1ca411266ba8f365fcc726444b87" + "Hash": "c03fa420630029418f7e6da3667aac4a" }, "withr": { "Package": "withr", @@ -610,14 +596,16 @@ }, "xml2": { "Package": "xml2", - "Version": "1.3.5", + "Version": "1.3.6", "Source": "Repository", "Repository": "RSPM", "Requirements": [ "R", - "methods" + "cli", + "methods", + "rlang" ], - "Hash": "6c40e5cfcc6aefd88110666e18c31f40" + "Hash": "1d0336142f4cd25d8d23cd3ba7a8fb61" }, "xmlparsedata": { "Package": "xmlparsedata", @@ -631,10 +619,10 @@ }, "yaml": { "Package": "yaml", - "Version": "2.3.7", + "Version": "2.3.8", "Source": "Repository", "Repository": "RSPM", - "Hash": "0d0056cc5383fbc240ccd0cb584bf436" + "Hash": "29240487a071f535f5e5d5a323b7afbd" } } }