From d7c10ebaf7bc9af209b6882f2180298a5811a974 Mon Sep 17 00:00:00 2001 From: John Benninghoff Date: Thu, 26 Sep 2024 10:31:12 -0500 Subject: [PATCH 1/7] Bump version --- DESCRIPTION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DESCRIPTION b/DESCRIPTION index 4735a9dc..dc6048ff 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,6 +1,6 @@ Package: rdev Title: R Development Tools -Version: 1.11.4 +Version: 1.11.4.9000 Authors@R: person("John", "Benninghoff", , "jbenninghoff@mac.com", role = c("aut", "cre"), comment = c(ORCID = "0000-0002-6230-4742")) From 1dff6a39a9c7e94cdfc16579483c1cbe80d4a8ea Mon Sep 17 00:00:00 2001 From: John Benninghoff Date: Thu, 26 Sep 2024 10:35:30 -0500 Subject: [PATCH 2/7] renv::update() --- renv.lock | 53 ++++++++++++------------ renv/activate.R | 105 +++++++++++++++++++++++++++++++++++++++++++----- 2 files changed, 121 insertions(+), 37 deletions(-) diff --git a/renv.lock b/renv.lock index 0a4536e7..a85c4551 100644 --- a/renv.lock +++ b/renv.lock @@ -333,13 +333,13 @@ }, "curl": { "Package": "curl", - "Version": "5.2.2", + "Version": "5.2.3", "Source": "Repository", "Repository": "CRAN", "Requirements": [ "R" ], - "Hash": "8f27335f2bcff4d6035edcc82d7d46de" + "Hash": "d91263322a58af798f6cf3b13fd56dde" }, "cyclocomp": { "Package": "cyclocomp", @@ -473,14 +473,13 @@ }, "evaluate": { "Package": "evaluate", - "Version": "0.24.0", + "Version": "1.0.0", "Source": "Repository", "Repository": "CRAN", "Requirements": [ - "R", - "methods" + "R" ], - "Hash": "a1066cbc05caee9a4bf6d90f194ff4da" + "Hash": "6b567375113ceb7d9f800de4dd42218e" }, "fansi": { "Package": "fansi", @@ -526,7 +525,7 @@ }, "gert": { "Package": "gert", - "Version": "2.1.1", + "Version": "2.1.2", "Source": "Repository", "Repository": "CRAN", "Requirements": [ @@ -537,7 +536,7 @@ "sys", "zip" ], - "Hash": "ab2ca7d6bd706ed218d096b7b16d7233" + "Hash": "347d104ed332650b737f509a703c9c7f" }, "gh": { "Package": "gh", @@ -652,7 +651,7 @@ }, "httr2": { "Package": "httr2", - "Version": "1.0.3", + "Version": "1.0.5", "Source": "Repository", "Repository": "CRAN", "Requirements": [ @@ -669,7 +668,7 @@ "vctrs", "withr" ], - "Hash": "10d93e97faad6b629301bb3a2fd23378" + "Hash": "d84e4c33206aaace37714901ac2b00c3" }, "hunspell": { "Package": "hunspell", @@ -702,13 +701,13 @@ }, "jsonlite": { "Package": "jsonlite", - "Version": "1.8.8", + "Version": "1.8.9", "Source": "Repository", "Repository": "CRAN", "Requirements": [ "methods" ], - "Hash": "e1b9c55281c5adc4dd113652d9e26768" + "Hash": "4e993b65c2c3ffbffce7bb3e2c6f832b" }, "knitr": { "Package": "knitr", @@ -860,13 +859,13 @@ }, "openssl": { "Package": "openssl", - "Version": "2.2.1", + "Version": "2.2.2", "Source": "Repository", "Repository": "CRAN", "Requirements": [ "askpass" ], - "Hash": "c62edf62de70cadf40553e10c739049d" + "Hash": "d413e0fef796c9401a4419485f709ca1" }, "pillar": { "Package": "pillar", @@ -912,7 +911,7 @@ }, "pkgdown": { "Package": "pkgdown", - "Version": "2.1.0", + "Version": "2.1.1", "Source": "Repository", "Repository": "CRAN", "Requirements": [ @@ -938,7 +937,7 @@ "xml2", "yaml" ], - "Hash": "0d3d789055c873f48521ce7e23c23f48" + "Hash": "df2912d5873422b55a13002510f02c9f" }, "pkgload": { "Package": "pkgload", @@ -994,18 +993,16 @@ }, "profvis": { "Package": "profvis", - "Version": "0.3.8", + "Version": "0.4.0", "Source": "Repository", "Repository": "CRAN", "Requirements": [ "R", "htmlwidgets", - "purrr", "rlang", - "stringr", "vctrs" ], - "Hash": "aa5a3864397ce6ae03458f98618395a1" + "Hash": "bffa126bf92987e677c12cfb5651fc1d" }, "promises": { "Package": "promises", @@ -1025,14 +1022,14 @@ }, "ps": { "Package": "ps", - "Version": "1.7.7", + "Version": "1.8.0", "Source": "Repository", "Repository": "CRAN", "Requirements": [ "R", "utils" ], - "Hash": "878b467580097e9c383acbb16adab57a" + "Hash": "4b9c8485b0c7eecdf0a9ba5132a45576" }, "purrr": { "Package": "purrr", @@ -1071,14 +1068,14 @@ }, "ragg": { "Package": "ragg", - "Version": "1.3.2", + "Version": "1.3.3", "Source": "Repository", "Repository": "CRAN", "Requirements": [ "systemfonts", "textshaping" ], - "Hash": "e3087db406e079a8a2fd87f413918ed3" + "Hash": "0595fe5e47357111f29ad19101c7d271" }, "rappdirs": { "Package": "rappdirs", @@ -1138,13 +1135,13 @@ }, "renv": { "Package": "renv", - "Version": "1.0.7", + "Version": "1.0.9", "Source": "Repository", "Repository": "CRAN", "Requirements": [ "utils" ], - "Hash": "397b7b2a265bc5a7a06852524dabae20" + "Hash": "ef233f0e9064fc88c898b340c9add5c2" }, "rex": { "Package": "rex", @@ -1459,13 +1456,13 @@ }, "tinytex": { "Package": "tinytex", - "Version": "0.52", + "Version": "0.53", "Source": "Repository", "Repository": "CRAN", "Requirements": [ "xfun" ], - "Hash": "cfbad971a71f0e27cec22e544a08bc3b" + "Hash": "9db859e8aabbb474293dde3097839420" }, "urlchecker": { "Package": "urlchecker", diff --git a/renv/activate.R b/renv/activate.R index d13f9932..c360bf29 100644 --- a/renv/activate.R +++ b/renv/activate.R @@ -2,7 +2,7 @@ local({ # the requested version of renv - version <- "1.0.7" + version <- "1.0.9" attr(version, "sha") <- NULL # the project directory @@ -98,6 +98,66 @@ local({ unloadNamespace("renv") # load bootstrap tools + ansify <- function(text) { + if (renv_ansify_enabled()) + renv_ansify_enhanced(text) + else + renv_ansify_default(text) + } + + renv_ansify_enabled <- function() { + + override <- Sys.getenv("RENV_ANSIFY_ENABLED", unset = NA) + if (!is.na(override)) + return(as.logical(override)) + + pane <- Sys.getenv("RSTUDIO_CHILD_PROCESS_PANE", unset = NA) + if (identical(pane, "build")) + return(FALSE) + + testthat <- Sys.getenv("TESTTHAT", unset = "false") + if (tolower(testthat) %in% "true") + return(FALSE) + + iderun <- Sys.getenv("R_CLI_HAS_HYPERLINK_IDE_RUN", unset = "false") + if (tolower(iderun) %in% "false") + return(FALSE) + + TRUE + + } + + renv_ansify_default <- function(text) { + text + } + + renv_ansify_enhanced <- function(text) { + + # R help links + pattern <- "`\\?(renv::(?:[^`])+)`" + replacement <- "`\033]8;;ide:help:\\1\a?\\1\033]8;;\a`" + text <- gsub(pattern, replacement, text, perl = TRUE) + + # runnable code + pattern <- "`(renv::(?:[^`])+)`" + replacement <- "`\033]8;;ide:run:\\1\a\\1\033]8;;\a`" + text <- gsub(pattern, replacement, text, perl = TRUE) + + # return ansified text + text + + } + + renv_ansify_init <- function() { + + envir <- renv_envir_self() + if (renv_ansify_enabled()) + assign("ansify", renv_ansify_enhanced, envir = envir) + else + assign("ansify", renv_ansify_default, envir = envir) + + } + `%||%` <- function(x, y) { if (is.null(x)) y else x } @@ -142,7 +202,10 @@ local({ # compute common indent indent <- regexpr("[^[:space:]]", lines) common <- min(setdiff(indent, -1L)) - leave - paste(substring(lines, common), collapse = "\n") + text <- paste(substring(lines, common), collapse = "\n") + + # substitute in ANSI links for executable renv code + ansify(text) } @@ -306,7 +369,11 @@ local({ ) if ("headers" %in% names(formals(utils::download.file))) - args$headers <- renv_bootstrap_download_custom_headers(url) + { + headers <- renv_bootstrap_download_custom_headers(url) + if (length(headers) && is.character(headers)) + args$headers <- headers + } do.call(utils::download.file, args) @@ -385,10 +452,22 @@ local({ for (type in types) { for (repos in renv_bootstrap_repos()) { + # build arguments for utils::available.packages() call + args <- list(type = type, repos = repos) + + # add custom headers if available -- note that + # utils::available.packages() will pass this to download.file() + if ("headers" %in% names(formals(utils::download.file))) + { + headers <- renv_bootstrap_download_custom_headers(url) + if (length(headers) && is.character(headers)) + args$headers <- headers + } + # retrieve package database db <- tryCatch( as.data.frame( - utils::available.packages(type = type, repos = repos), + do.call(utils::available.packages, args), stringsAsFactors = FALSE ), error = identity @@ -470,6 +549,14 @@ local({ } + renv_bootstrap_github_token <- function() { + for (envvar in c("GITHUB_TOKEN", "GITHUB_PAT", "GH_TOKEN")) { + envval <- Sys.getenv(envvar, unset = NA) + if (!is.na(envval)) + return(envval) + } + } + renv_bootstrap_download_github <- function(version) { enabled <- Sys.getenv("RENV_BOOTSTRAP_FROM_GITHUB", unset = "TRUE") @@ -477,16 +564,16 @@ local({ return(FALSE) # prepare download options - pat <- Sys.getenv("GITHUB_PAT") - if (nzchar(Sys.which("curl")) && nzchar(pat)) { + token <- renv_bootstrap_github_token() + if (nzchar(Sys.which("curl")) && nzchar(token)) { fmt <- "--location --fail --header \"Authorization: token %s\"" - extra <- sprintf(fmt, pat) + extra <- sprintf(fmt, token) saved <- options("download.file.method", "download.file.extra") options(download.file.method = "curl", download.file.extra = extra) on.exit(do.call(base::options, saved), add = TRUE) - } else if (nzchar(Sys.which("wget")) && nzchar(pat)) { + } else if (nzchar(Sys.which("wget")) && nzchar(token)) { fmt <- "--header=\"Authorization: token %s\"" - extra <- sprintf(fmt, pat) + extra <- sprintf(fmt, token) saved <- options("download.file.method", "download.file.extra") options(download.file.method = "wget", download.file.extra = extra) on.exit(do.call(base::options, saved), add = TRUE) From a7dcf7218173813605ceb8378537c9574c7a4a1c Mon Sep 17 00:00:00 2001 From: John Benninghoff Date: Thu, 26 Sep 2024 10:51:00 -0500 Subject: [PATCH 3/7] Remove single use of R native pipes --- R/utils.R | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/R/utils.R b/R/utils.R index f9405891..4d917f7b 100644 --- a/R/utils.R +++ b/R/utils.R @@ -237,8 +237,8 @@ package_downloads <- function(packages, when = "last-month") { stop("Querying downloads of R is not supported!") } - df <- cranlogs::cran_downloads(packages = packages, when = when) |> - stats::aggregate(by = count ~ package, FUN = sum) + cl <- cranlogs::cran_downloads(packages = packages, when = when) + df <- stats::aggregate(count ~ package, data = cl, sum) df[order(df$count, decreasing = TRUE), ] } From 5e3a5e78c4258c4994323bb3966b23e769d03f66 Mon Sep 17 00:00:00 2001 From: John Benninghoff Date: Thu, 26 Sep 2024 13:21:33 -0500 Subject: [PATCH 4/7] rdev depends on R >= 4.0.0 --- DESCRIPTION | 2 ++ NEWS.md | 4 ++++ 2 files changed, 6 insertions(+) diff --git a/DESCRIPTION b/DESCRIPTION index dc6048ff..fb865a75 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -10,6 +10,8 @@ License: MIT + file LICENSE URL: https://jabenninghoff.github.io/rdev/, https://github.com/jabenninghoff/rdev BugReports: https://github.com/jabenninghoff/rdev/issues +Depends: + R (>= 4.0.0) Imports: checkmate, cli, diff --git a/NEWS.md b/NEWS.md index f94d84f9..cd826d25 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,3 +1,7 @@ +# rdev 1.11.5 + +* rdev now depends on R >= 4.0.0 + # rdev 1.11.4 * Updated "Introduction to rdev" vignette, `vignette("rdev")` From 696e54d402019f203048d00dacfb953ae4fbe5d5 Mon Sep 17 00:00:00 2001 From: John Benninghoff Date: Thu, 26 Sep 2024 13:26:45 -0500 Subject: [PATCH 5/7] Record dependency on R native pipes --- NEWS.md | 2 ++ R/setup.R | 2 ++ tests/testthat/test-setup.R | 2 ++ 3 files changed, 6 insertions(+) diff --git a/NEWS.md b/NEWS.md index cd826d25..f8424bc3 100644 --- a/NEWS.md +++ b/NEWS.md @@ -2,6 +2,8 @@ * rdev now depends on R >= 4.0.0 +* `use_analysis_package()` now records dependency on R native pipes (R >= 4.1.0) + # rdev 1.11.4 * Updated "Introduction to rdev" vignette, `vignette("rdev")` diff --git a/R/setup.R b/R/setup.R index c1f71b34..0e9f174e 100644 --- a/R/setup.R +++ b/R/setup.R @@ -624,6 +624,8 @@ use_analysis_package <- function(use_quarto = TRUE, prompt = FALSE) { ignore = TRUE, open = rlang::is_interactive() ) + desc::desc_set_dep("R", type = "Depends", version = ">= 4.1.0") + desc::desc_normalize() renv::install("dplyr") usethis::use_package("dplyr", type = "Suggests") diff --git a/tests/testthat/test-setup.R b/tests/testthat/test-setup.R index dcf8c0fa..ed4b4e26 100644 --- a/tests/testthat/test-setup.R +++ b/tests/testthat/test-setup.R @@ -326,6 +326,8 @@ test_that("use_analysis_package returns expected values", { mockery::stub(use_analysis_package, "fs::file_exists", FALSE) mockery::stub(use_analysis_package, "yaml::write_yaml", NULL) mockery::stub(use_analysis_package, "usethis::use_template", NULL) + mockery::stub(use_analysis_package, "desc::desc_set_dep", NULL) + mockery::stub(use_analysis_package, "desc::desc_normalize", NULL) mockery::stub(use_analysis_package, "renv::install", NULL) mockery::stub(use_analysis_package, "usethis::use_package", NULL) mockery::stub(use_analysis_package, "renv::snapshot", NULL) From df2436cfc4327972056c876d3890fc7c24ac44e8 Mon Sep 17 00:00:00 2001 From: John Benninghoff Date: Thu, 26 Sep 2024 13:29:53 -0500 Subject: [PATCH 6/7] GitHub release 1.11.5 --- DESCRIPTION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DESCRIPTION b/DESCRIPTION index fb865a75..e6600a08 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,6 +1,6 @@ Package: rdev Title: R Development Tools -Version: 1.11.4.9000 +Version: 1.11.5 Authors@R: person("John", "Benninghoff", , "jbenninghoff@mac.com", role = c("aut", "cre"), comment = c(ORCID = "0000-0002-6230-4742")) From 68a10f620ef3cbe04dc5142c640e1d2ff504770a Mon Sep 17 00:00:00 2001 From: John Benninghoff Date: Thu, 26 Sep 2024 13:31:28 -0500 Subject: [PATCH 7/7] build_rdev_site() for release 1.11.5 --- README.md | 13 ++++++------- docs/404.html | 4 ++-- docs/LICENSE-text.html | 4 ++-- docs/LICENSE.html | 4 ++-- docs/TODO.html | 4 ++-- docs/articles/analysis-package-layout.html | 4 ++-- docs/articles/index.html | 4 ++-- docs/articles/rdev.html | 4 ++-- docs/articles/style-guide.html | 4 ++-- docs/authors.html | 8 ++++---- docs/index.html | 17 ++++++++--------- docs/news/index.html | 9 +++++++-- docs/pkgdown.js | 8 ++++++++ docs/pkgdown.yml | 6 +++--- docs/reference/Rplot001.png | Bin 1011 -> 0 bytes docs/reference/build_analysis_site.html | 4 ++-- docs/reference/build_quarto_site.html | 4 ++-- docs/reference/build_rdev_site.html | 4 ++-- docs/reference/check_renv.html | 4 ++-- docs/reference/ci.html | 4 ++-- docs/reference/create_github_repo.html | 4 ++-- docs/reference/deps_check.html | 4 ++-- docs/reference/get_license.html | 4 ++-- docs/reference/get_release.html | 4 ++-- docs/reference/html_url_check.html | 4 ++-- docs/reference/index.html | 4 ++-- docs/reference/init.html | 4 ++-- docs/reference/lint_all.html | 4 ++-- docs/reference/local_temppkg.html | 4 ++-- docs/reference/merge_release.html | 4 ++-- docs/reference/new_branch.html | 4 ++-- docs/reference/open_files.html | 4 ++-- docs/reference/package_downloads.html | 4 ++-- docs/reference/quickstart.html | 4 ++-- docs/reference/rdev-package.html | 4 ++-- docs/reference/rmd_metadata.html | 4 ++-- docs/reference/setup_analysis.html | 4 ++-- docs/reference/setup_rdev.html | 4 ++-- docs/reference/sort_file.html | 4 ++-- docs/reference/sort_rbuildignore.html | 4 ++-- docs/reference/spell_check_notebooks.html | 4 ++-- docs/reference/stage_release.html | 4 ++-- docs/reference/style_all.html | 4 ++-- docs/reference/to_document.html | 4 ++-- docs/reference/unfreeze.html | 4 ++-- docs/reference/update_wordlist_notebooks.html | 4 ++-- docs/reference/urlchecker-reexports.html | 4 ++-- docs/reference/use_analysis_package.html | 4 ++-- docs/reference/use_codecov.html | 4 ++-- docs/reference/use_lintr.html | 4 ++-- docs/reference/use_package_r.html | 4 ++-- docs/reference/use_rdev_package.html | 4 ++-- docs/reference/use_rdev_pkgdown.html | 4 ++-- docs/reference/use_rprofile.html | 4 ++-- docs/reference/use_spelling.html | 4 ++-- docs/reference/use_todo.html | 4 ++-- docs/search.json | 2 +- 57 files changed, 135 insertions(+), 124 deletions(-) delete mode 100644 docs/reference/Rplot001.png diff --git a/README.md b/README.md index dcc1f94b..09eec5a5 100644 --- a/README.md +++ b/README.md @@ -234,20 +234,20 @@ ci() #> * creating vignettes ... OK #> * checking for LF line-endings in source and make files and shell scripts #> * checking for empty or unneeded directories -#> * building ‘rdev_1.11.4.tar.gz’ +#> * building ‘rdev_1.11.5.tar.gz’ #> #> ── R CMD check ───────────────────────────────────────────────────────────────── -#> * using log directory ‘/private/var/folders/vn/cw5f9gws42v9m8mdsds_zbl00000gp/T/Rtmp4kM93U/file108c45e03214f/rdev.Rcheck’ +#> * using log directory ‘/private/var/folders/vn/cw5f9gws42v9m8mdsds_zbl00000gp/T/RtmpvN7fYo/file780b4c4de0b/rdev.Rcheck’ #> * using R version 4.4.1 (2024-06-14) #> * using platform: aarch64-apple-darwin20 #> * R was compiled by #> Apple clang version 14.0.0 (clang-1400.0.29.202) #> GNU Fortran (GCC) 12.2.0 -#> * running under: macOS Sonoma 14.6.1 +#> * running under: macOS Sonoma 14.7 #> * using session charset: UTF-8 #> * using option ‘--no-manual’ #> * checking for file ‘rdev/DESCRIPTION’ ... OK -#> * this is package ‘rdev’ version ‘1.11.4’ +#> * this is package ‘rdev’ version ‘1.11.5’ #> * package encoding: UTF-8 #> * checking package namespace information ... OK #> * checking package dependencies ... OK @@ -300,10 +300,9 @@ ci() #> * checking package vignettes ... OK #> * checking re-building of vignette outputs ... OK #> * DONE -#> #> Status: OK -#> ── R CMD check results ──────────────────────────────────────── rdev 1.11.4 ──── -#> Duration: 34s +#> ── R CMD check results ──────────────────────────────────────── rdev 1.11.5 ──── +#> Duration: 34.3s #> #> 0 errors ✔ | 0 warnings ✔ | 0 notes ✔ ``` diff --git a/docs/404.html b/docs/404.html index 1b538c29..e53313f4 100644 --- a/docs/404.html +++ b/docs/404.html @@ -28,7 +28,7 @@ rdev - 1.11.4 + 1.11.5