Skip to content

Commit

Permalink
vbump testthat; add utils prefix to avoid R CMD NOTE
Browse files Browse the repository at this point in the history
  • Loading branch information
pawelru committed Oct 9, 2024
1 parent 8b10f38 commit 97fd048
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
8 changes: 4 additions & 4 deletions R/get_ref.R
Original file line number Diff line number Diff line change
Expand Up @@ -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
)
Expand Down Expand Up @@ -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) {
Expand All @@ -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, ])
)
Expand Down
6 changes: 3 additions & 3 deletions R/utils.R
Original file line number Diff line number Diff line change
Expand Up @@ -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))),
Expand Down
2 changes: 1 addition & 1 deletion tests/testthat/helper.R
Original file line number Diff line number Diff line change
Expand Up @@ -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, ]
Expand Down

0 comments on commit 97fd048

Please sign in to comment.