-
-
Save paleolimbot/630fdab1e204d70fea97633d8fa15ccb to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
options(future.rng.onMisuse = "ignore") | |
library(furrr) | |
plan(multisession) | |
arrow_r_home <- fs::path_abs("../arrow/r") | |
# Note: RcisTarget is bioconductor | |
# Query reverse depencencies ---------- | |
rev_imports <- c("CDMConnector", "ClickHouseHTTP", "dataversionr", "diffdfs", | |
"disk.frame", "gbifdb", "MolgenisArmadillo", "parqr", | |
"receptiviti", "sfarrow", "starvz", "strand", "tradestatistics" | |
) | |
rev_suggests <- c("analogsea", "arkdb", "duckdb", "mrgsim.parallel", "nflreadr", | |
"noctua", "opencpu", "pins", "plumber", "pointblank", "RAthena", | |
"raveio", "rio", "sparklyr", "targets") | |
rev_deps <- sort(c(rev_imports, rev_suggests)) | |
unlink("rev_deps", recursive = TRUE) | |
dir.create("rev_deps") | |
# Fetch reverse dependency sources ---------- | |
# Fetch dependency sources from cran/XXX | |
future_walk( | |
rev_deps, | |
~system(glue::glue("git clone https://github.com/cran/{.x} rev_deps/{.x}")), | |
.progress = TRUE | |
) | |
# Install dependencies needed for checking ---------- | |
# collect dependencies and install them | |
rev_deps_pak <- paste0("local::rev_deps/", rev_deps) | |
deps <- pak::pkg_deps(rev_deps_pak, upgrade = TRUE, dependencies = TRUE) | |
# install dependencies to a dedicated library | |
deps_ref <- deps$ref | |
# Rmpi not available on MacOS | |
if (Sys.info()["sysname"] == "Darwin") { | |
deps_ref <- setdiff(deps_ref, "Rmpi") | |
} | |
pak::pkg_install(deps_ref, upgrade = TRUE) | |
# Install CRAN arrow | |
pak::pkg_install("arrow") | |
# Run rcmdcheck | |
unlink("check_with_cran", recursive = TRUE) | |
dir.create("check_with_cran") | |
results <- future_map(rev_deps, ~{ | |
pkg <- file.path("rev_deps", .x) | |
try( | |
rcmdcheck::rcmdcheck( | |
pkg, | |
check_dir = file.path(getwd(), "check_with_cran", .x), | |
quiet = TRUE | |
) | |
) | |
}, .progress = TRUE) | |
failed <- vapply(results, inherits, logical(1), "try-error") | |
if (any(failed)) { | |
message(glue::glue("{sum(failed)} packages failed to check:")) | |
message( | |
paste0( | |
glue::glue( | |
"- rcmdcheck::rcmdcheck(\"rev_deps/{rev_deps[failed]}\")", | |
), | |
collapse = "\n" | |
) | |
) | |
} | |
# Install local arrow | |
pak::pkg_install(paste0("local::", arrow_r_home)) | |
# Run the checks again | |
results2 <- future_map(rev_deps, ~{ | |
pkg <- file.path("rev_deps", .x) | |
try( | |
rcmdcheck::rcmdcheck( | |
pkg, | |
check_dir = file.path(getwd(), "check_with_local", .x), | |
quiet = TRUE | |
) | |
) | |
}, .progress = TRUE) | |
failed2 <- vapply(results2, inherits, logical(1), "try-error") | |
if (any(failed2)) { | |
message(glue::glue("{sum(failed)} packages failed to check:")) | |
message( | |
paste0( | |
glue::glue( | |
"- rcmdcheck::rcmdcheck(\"rev_deps/{rev_deps[failed]}\")", | |
), | |
collapse = "\n" | |
) | |
) | |
} | |
saveRDS(rev_deps, "rev_deps.rds") | |
saveRDS(results, "results_with_cran.rds") | |
saveRDS(results2, "results_with_local.rds") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(tidyverse) | |
library(rcmdcheck) | |
rev_deps <- readRDS("rev_deps.rds") | |
results_with_cran <- readRDS("results_with_cran.rds") | |
results_with_local <- readRDS("results_with_local.rds") | |
check_df <- function(lst, label) { | |
has_error <- map_lgl(lst, inherits, "try-error") | |
lst[has_error] <- list(NULL) | |
tibble( | |
label = label, | |
pkg = rev_deps, | |
notes = map(lst, "notes"), | |
warnings = map(lst, "warnings"), | |
errors = map(lst, "errors") | |
) | |
} | |
df_with_cran <- check_df(results_with_cran, "CRAN") | |
df_with_local <- check_df(results_with_local, "local") | |
has_difference <- logical(length(rev_deps)) | |
for (i in seq_along(has_difference)) { | |
has_difference[i] <- !identical(df_with_cran[i, -1], df_with_local[i, -1]) | |
} | |
cat("# Changes\n\n") | |
for (i in which(has_difference)) { | |
cat(glue::glue("## {rev_deps[i]}")) | |
cat("\n\n### With CRAN arrow\n\n```\n") | |
print(results_with_cran[[i]]) | |
cat("\n```\n\n### With local arrow\n\n```\n") | |
print(results_with_local[[i]]) | |
cat("\n\n```\n\n") | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
CDMConnector
With CRAN arrow
With local arrow
dataversionr
With CRAN arrow
With local arrow