forked from tidyverse/dplyr
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcheck.R
84 lines (63 loc) · 2.2 KB
/
check.R
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
if (Sys.getenv("DISPLAY") == "") stop("Run with xvfb-run")
free <- system(paste0("df --output=avail ", tempdir(), " | tail -n 1"), intern = TRUE)
if (as.numeric(free) < 1e8) stop("Set TMPDIR to a location with at least 100 GB free space")
package <- basename(getwd())
library(revdepcheck)
dir_setup(getwd())
if (!revdepcheck:::db_exists(getwd())) {
revdepcheck:::db_setup(getwd())
}
if (length(revdep_todo()) == 0) {
import_revdeps <- revdepcheck:::cran_revdeps(package = package, dependencies = c("Depends", "Imports"), bioc = TRUE)
import_revdeps <- setdiff(import_revdeps, package)
todo_import_revdeps <- import_revdeps
while (FALSE && length(todo_import_revdeps) > 0) {
print(length(todo_import_revdeps))
print(todo_import_revdeps)
print(Sys.time())
new_import_revdeps <- unlist(purrr::map(todo_import_revdeps, revdepcheck:::cran_revdeps, dependencies = c("Depends", "Imports"), bioc = TRUE))
todo_import_revdeps <- setdiff(new_import_revdeps, import_revdeps)
import_revdeps <- union(import_revdeps, new_import_revdeps)
print(new_import_revdeps)
break # only one level for now
}
weak_revdeps <- revdepcheck:::cran_revdeps(package = package, dependencies = c("Suggests", "Enhances", "LinkingTo"), bioc = TRUE)
print(weak_revdeps)
revdep_add(".", c(import_revdeps, weak_revdeps))
}
options(repos = revdepcheck:::get_repos(bioc = TRUE))
todo <- revdep_todo()
withr::with_temp_libpaths(action = "replace", {
crancache::install_packages(c(
todo,
"pillar"
))
remotes::install_local(".")
})
repos <- paste0(
"file://",
file.path(crancache::get_cache_dir(), c("cran-bin", "bioc-bin", "other-bin"))
)
names(repos) <- c("CRAN", "Bioc", "other")
options(repos = repos)
N <- 100
for (i in seq_len(N)) {
try(
revdepcheck::revdep_check(
bioc = TRUE,
dependencies = character(),
quiet = FALSE,
num_workers = 24,
timeout = as.difftime(60, units = "mins")
)
)
if (length(revdep_todo()) == 0) break
}
options(repos = revdepcheck:::get_repos(bioc = TRUE))
withr::with_output_sink(
"revdep/cran.md",
revdep_report_cran()
)
system("git add revdep/*.md")
system("git commit -m 'update revdep results'")
system("git push -u origin HEAD")