Skip to content

Commit 73c5012

Browse files
common prep for options
[ci skip]
1 parent 2a01e3c commit 73c5012

File tree

4 files changed

+8
-13
lines changed

4 files changed

+8
-13
lines changed

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ repos:
8383
(?x)^(
8484
inst/hooks/exported/pkgdown.R|
8585
tests/testthat/in/.*|
86-
inst/renv-update\.R|
86+
inst/update-renv-prepare.R|
8787
inst/update-ppm-url.R|
8888
inst/update-dependency-graph-existing-packages\.R|
8989
inst/update-existing-hook-dependencies\.R|

inst/update-dependency-graph-existing-packages.R

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,8 @@ hook_deps <- function(root) {
1414
out <- names(renv:::renv_package_dependencies(out))
1515
return(sort(out))
1616
}
17-
options(
18-
# repos = c(
19-
# RSPM = "https://packagemanager.rstudio.com/all/latest",
20-
# CRAN = "https://cran.rstudio.com"
21-
# ),
22-
install.packages.compile.from.source = "never"
23-
)
2417

18+
source("inst/update-renv-prepare.R")
2519
options(renv.snapshot.filter = hook_deps)
2620

2721
renv::snapshot(type = "custom", prompt = FALSE)

inst/update-existing-hook-dependencies.R

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,4 @@
1-
options(
2-
repos = c(RSPM = renv::lockfile_read()$R$Repositories$RSPM), # CRAN is not an option, always use PPM
3-
install.packages.check.source = "no", # don't check if source packages are available
4-
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).
5-
)
1+
source("inst/update-renv-prepare.R")
62
renv::install("jsonlite")
73
renv_deps <- names(jsonlite::read_json("renv.lock")$Packages)
84
source("renv/activate.R")

inst/update-renv-prepare.R

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
options(
2+
repos = c(RSPM = renv::lockfile_read()$R$Repositories$RSPM), # CRAN is not an option, always use PPM
3+
install.packages.check.source = "no", # don't check if source packages are available
4+
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).
5+
)

0 commit comments

Comments
 (0)