From 97fd048a29434c55ea4c5a0bec2d3b4311fffdda Mon Sep 17 00:00:00 2001 From: Pawel Rucki <12943682+pawelru@users.noreply.github.com> Date: Wed, 9 Oct 2024 17:43:28 +0200 Subject: [PATCH] vbump testthat; add utils prefix to avoid R CMD NOTE --- DESCRIPTION | 2 +- R/get_ref.R | 8 ++++---- R/utils.R | 6 +++--- tests/testthat/helper.R | 2 +- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index e70fe34..1a322f3 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -31,7 +31,7 @@ Suggests: knitr (>= 1.42), pingr, rmarkdown (>= 2.23), - testthat (>= 3.0.4) + testthat (>= 3.1.9) Remotes: r-lib/pkgcache Config/Needs/verdepcheck: diff --git a/R/get_ref.R b/R/get_ref.R index f0a91e6..6f8f0ce 100644 --- a/R/get_ref.R +++ b/R/get_ref.R @@ -527,7 +527,7 @@ get_release_date.remote_ref <- function(remote_ref) { #' verdepcheck:::get_release_data("MultiAssayExperiment") get_release_data <- function(package) { cran_archive <- pkgcache::cran_archive_list(packages = package)[, c("package", "version", "mtime")] - cran_current <- head( + cran_current <- utils::head( pkgcache::meta_cache_list(packages = package)[, c("type", "package", "version", "published")], 1 ) @@ -613,11 +613,11 @@ get_avail_date.remote_ref_cran <- function(remote_ref, start = get_release_date( ppm_url <- get_ppm_snapshot_by_date(date) date <- `if`( grepl("/latest$", ppm_url), - tail(pkgcache::ppm_snapshots(), 1)$date, + utils::tail(pkgcache::ppm_snapshots(), 1)$date, unname(as.Date(sub(".*/", "", ppm_url))) ) if (remote_ref$atleast != "") { - data <- available.packages( + data <- utils::available.packages( repos = ppm_url, filters = list( function(db) { @@ -638,7 +638,7 @@ get_avail_date.remote_ref_cran <- function(remote_ref, start = get_release_date( ) ) } else { - data <- available.packages( + data <- utils::available.packages( repos = ppm_url, filters = list(function(db) db[db[, "Package"] == remote_ref$package, ]) ) diff --git a/R/utils.R b/R/utils.R index 060272e..26a93db 100644 --- a/R/utils.R +++ b/R/utils.R @@ -33,11 +33,11 @@ get_ppm_snapshot_by_date <- function(date = NA) { if (is.na(date)) { return(pkgcache::repo_resolve("PPM@latest")) } - if (date >= tail(pkgcache::ppm_snapshots(), 1)$date) { + if (date >= utils::tail(pkgcache::ppm_snapshots(), 1)$date) { return(pkgcache::repo_resolve("PPM@latest")) } - if (date <= head(pkgcache::ppm_snapshots(), 1)$date) { - return(pkgcache::repo_resolve(sprintf("PPM@%s", head(pkgcache::ppm_snapshots(), 1)$date))) + if (date <= utils::head(pkgcache::ppm_snapshots(), 1)$date) { + return(pkgcache::repo_resolve(sprintf("PPM@%s", utils::head(pkgcache::ppm_snapshots(), 1)$date))) } tryCatch( pkgcache::repo_resolve(sprintf("PPM@%s", as.character(as.Date(date) + 1))), diff --git a/tests/testthat/helper.R b/tests/testthat/helper.R index c64693b..8e5546f 100644 --- a/tests/testthat/helper.R +++ b/tests/testthat/helper.R @@ -69,7 +69,7 @@ test_proposal_common <- function(x, # CRAN if (is.null(pkg_gh_str) && is.null(pkg_ver_target)) { pkg_ver_target <- package_version( - available.packages( + utils::available.packages( repos = pkgcache::default_cran_mirror(), filters = list( add = TRUE, function(x) x[x[, "Package"] == pkg_name, ]