Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hook dependencies update #537

Closed
wants to merge 7 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/hook-dependencies-update.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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|
Expand Down
11 changes: 2 additions & 9 deletions inst/update-dependency-graph-existing-packages.R
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
source("renv/activate.R")

hook_deps <- function(root) {
out <- renv::dependencies("inst/hooks/exported/")$Package
desc <- desc::desc()
Expand All @@ -14,14 +12,9 @@ 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")
source("renv/activate.R")
options(renv.snapshot.filter = hook_deps)

renv::snapshot(type = "custom", prompt = FALSE)
10 changes: 2 additions & 8 deletions inst/update-existing-hook-dependencies.R
Original file line number Diff line number Diff line change
@@ -1,12 +1,6 @@
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
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).
)
renv::install("jsonlite")
source("inst/update-renv-prepare.R")
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)
Expand Down
4 changes: 4 additions & 0 deletions inst/update-renv-prepare.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
options(
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).
)
70 changes: 27 additions & 43 deletions renv.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,7 @@
"Repositories": [
{
"Name": "RSPM",
"URL": "https://packagemanager.posit.co/cran/2023-11-17"
},
{
"Name": "CRAN",
"URL": "https://cran.rstudio.com"
"URL": "https://packagemanager.posit.co/cran/2024-01-08"
}
]
},
Expand Down Expand Up @@ -54,7 +50,7 @@
},
"R.utils": {
"Package": "R.utils",
"Version": "2.12.2",
"Version": "2.12.3",
"Source": "Repository",
"Repository": "RSPM",
"Requirements": [
Expand All @@ -65,7 +61,7 @@
"tools",
"utils"
],
"Hash": "325f01db13da12c04d8f6e7be36ff514"
"Hash": "3dc2829b790254bfba21e60965787651"
},
"R6": {
"Package": "R6",
Expand Down Expand Up @@ -100,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",
Expand All @@ -120,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",
Expand All @@ -148,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",
Expand Down Expand Up @@ -184,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",
Expand Down Expand Up @@ -355,21 +350,18 @@
},
"pkgbuild": {
"Package": "pkgbuild",
"Version": "1.4.2",
"Version": "1.4.3",
"Source": "Repository",
"Repository": "RSPM",
"Requirements": [
"R",
"R6",
"callr",
"cli",
"crayon",
"desc",
"prettyunits",
"processx",
"rprojroot"
"processx"
],
"Hash": "beb25b32a957a22a5c301a9e441190b3"
"Hash": "c0143443203205e6a2760ce553dafc24"
},
"pkgload": {
"Package": "pkgload",
Expand All @@ -392,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": [
Expand All @@ -413,7 +395,7 @@
"ps",
"utils"
],
"Hash": "3efbd8ac1be0296a46c55387aeace0f3"
"Hash": "82d48b1aec56084d9438dbf98087a7e9"
},
"ps": {
"Package": "ps",
Expand Down Expand Up @@ -527,7 +509,7 @@
},
"stringi": {
"Package": "stringi",
"Version": "1.8.1",
"Version": "1.8.3",
"Source": "Repository",
"Repository": "RSPM",
"Requirements": [
Expand All @@ -536,7 +518,7 @@
"tools",
"utils"
],
"Hash": "12bf57fdcb9b7068bea39b32f87ecac9"
"Hash": "058aebddea264f4c99401515182e656a"
},
"stringr": {
"Package": "stringr",
Expand Down Expand Up @@ -576,7 +558,7 @@
},
"vctrs": {
"Package": "vctrs",
"Version": "0.6.4",
"Version": "0.6.5",
"Source": "Repository",
"Repository": "RSPM",
"Requirements": [
Expand All @@ -586,7 +568,7 @@
"lifecycle",
"rlang"
],
"Hash": "266c1ca411266ba8f365fcc726444b87"
"Hash": "c03fa420630029418f7e6da3667aac4a"
},
"withr": {
"Package": "withr",
Expand Down Expand Up @@ -614,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",
Expand All @@ -635,10 +619,10 @@
},
"yaml": {
"Package": "yaml",
"Version": "2.3.7",
"Version": "2.3.8",
"Source": "Repository",
"Repository": "RSPM",
"Hash": "0d0056cc5383fbc240ccd0cb584bf436"
"Hash": "29240487a071f535f5e5d5a323b7afbd"
}
}
}
Loading