diff --git a/.Rbuildignore b/.Rbuildignore index 447c96b..e18d08e 100644 --- a/.Rbuildignore +++ b/.Rbuildignore @@ -3,6 +3,7 @@ #---------------------------- ^.svn ^.git +^.github ^.make INSTALL[.]md OVERVIEW[.]md diff --git a/.github/.gitignore b/.github/.gitignore new file mode 100644 index 0000000..2d19fc7 --- /dev/null +++ b/.github/.gitignore @@ -0,0 +1 @@ +*.html diff --git a/.github/workflows/R-CMD-check.yaml b/.github/workflows/R-CMD-check.yaml new file mode 100644 index 0000000..2c9a486 --- /dev/null +++ b/.github/workflows/R-CMD-check.yaml @@ -0,0 +1,58 @@ +on: [push, pull_request] + +name: R-CMD-check + +jobs: + R-CMD-check: + name: ${{ matrix.config.os }} (${{ matrix.config.r }}) + if: "! contains(github.event.head_commit.message, '[ci skip]')" + runs-on: ${{ matrix.config.os }} + + strategy: + fail-fast: false + matrix: + config: + - {os: windows-latest, r: 'devel' } + - {os: windows-latest, r: 'release' } + - {os: macOS-latest, r: 'devel' } + - {os: macOS-latest, r: 'release' } + - {os: ubuntu-20.04, r: 'devel', rspm: "https://packagemanager.rstudio.com/cran/__linux__/focal/latest"} + - {os: ubuntu-20.04, r: 'release', rspm: "https://packagemanager.rstudio.com/cran/__linux__/focal/latest"} + + env: + R_REMOTES_NO_ERRORS_FROM_WARNINGS: true + RSPM: ${{ matrix.config.rspm }} + + steps: + - uses: actions/checkout@v2 + + - uses: r-lib/actions/setup-r@master + with: + r-version: ${{ matrix.config.r }} + + - name: Query dependencies + run: | + install.packages('remotes') + saveRDS(remotes::dev_package_deps(dependencies = TRUE), ".github/depends.Rds", version = 2) + writeLines(sprintf("R-%i.%i", getRversion()$major, getRversion()$minor), ".github/R-version") + shell: Rscript {0} + + - name: Cache R packages + if: runner.os != 'Windows' + uses: actions/cache@v1 + with: + path: ${{ env.R_LIBS_USER }} + key: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-${{ hashFiles('.github/depends.Rds') }} + restore-keys: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1- + + - name: Install dependencies + run: | + remotes::install_deps(dependencies = TRUE) + remotes::install_cran("rcmdcheck") + shell: Rscript {0} + + - name: Check + env: + _R_CHECK_CRAN_INCOMING_REMOTE_: false + run: rcmdcheck::rcmdcheck(args = c("--no-manual", "--as-cran"), error_on = "warning", check_dir = "check") + shell: Rscript {0} diff --git a/.travis.yml b/.travis.yml index 80a6b28..30253b6 100644 --- a/.travis.yml +++ b/.travis.yml @@ -30,10 +30,6 @@ matrix: - _R_CHECK_LENGTH_1_CONDITION_=true - _R_CHECK_LENGTH_1_LOGIC2_=true - _R_CLASS_MATRIX_ARRAY_=true - - os: osx - r: oldrel - - os: osx - r: release - os: linux r: release r_check_args: --no-build-vignettes --no-codoc --no-examples --no-tests --no-manual --ignore-vignettes diff --git a/DESCRIPTION b/DESCRIPTION index 3bcdca9..671de50 100755 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,12 +1,12 @@ Package: R.cache -Version: 0.14.0 +Version: 0.15.0 Depends: R (>= 2.14.0) Imports: utils, - R.methodsS3 (>= 1.7.1), - R.oo (>= 1.23.0), - R.utils (>= 2.8.0), + R.methodsS3 (>= 1.8.1), + R.oo (>= 1.24.0), + R.utils (>= 2.10.1), digest (>= 0.6.13) Title: Fast and Light-Weight Caching (Memoization) of Objects and Results to Speed Up Computations Authors@R: c(person("Henrik", "Bengtsson", role=c("aut", "cre", "cph"), diff --git a/NAMESPACE b/NAMESPACE index 5b23bb6..db91fb9 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -24,6 +24,8 @@ importFrom("R.utils", "removeDirectory") importFrom("R.utils", "touchFile") importFrom("utils", "compareVersion") importFrom("utils", "packageVersion") +importFrom("utils", "file_test") +importFrom("utils", "menu") importFrom("digest", "digest") ## Manually adjusted diff --git a/NEWS b/NEWS index 69b1ff0..d05e7de 100755 --- a/NEWS +++ b/NEWS @@ -1,6 +1,23 @@ Package: R.cache ================ +Version: 0.15.0 [2021-04-27] + +SIGNIFICANT CHANGES: + + * The location of the root cache folder as introduced in R.cache 0.14.0 has + been updated to match that of tools::R_user_dir(), which was introduced + in R 4.0.0. On Linux, this was already the case in R.cache 0.14.0, + whereas on macOS and MS Windows, the folder locations have changed + slightly. If an old cache folder location is detected, then the user will + be queried what action to take, i.e. abort, ignore the old folder, remove + the old folder, or move the old folder to the new location. In + non-interactive mode, the default action is always to ignore. + + * The package will no longer ask for permission to create the cache folder + as long as the cache folder is compatible with tools::R_user_dir(). + + Version: 0.14.0 [2019-12-05] SIGNIFICANT CHANGES: @@ -13,7 +30,7 @@ SIGNIFICANT CHANGES: On modern versions of Microsoft Windows, environment variables such as 'LOCALAPPDATA' will be used, which typically resolves to '%USERPROFILE%/AppData/Local, e.g. 'C:/Users/alice/AppData/Local'. - If R.cache fails find a proper OS-specific cache folder, it will fall + If R.cache fails to find a proper OS-specific cache folder, it will fall back to using ~/.Rcache as previously done. Importantly, if ~/.Rcache already exists, then that will be used by default. This is done in order to not lose previously cached files. diff --git a/R/getOSCacheRootPath.R b/R/getOSCacheRootPath.R index 86745a3..54b721d 100644 --- a/R/getOSCacheRootPath.R +++ b/R/getOSCacheRootPath.R @@ -30,13 +30,11 @@ getWindowsLocalAppData <- function() { } -findOSCachePath <- function() { - os <- getOS() - +findOSCachePath_0.14.0 <- function(os = getOS()) { root <- switch(os, windows = getWindowsLocalAppData(), - macos = "~/Library/Caches", - unix = Sys.getenv("XDG_CACHE_HOME", "~/.cache"), + macos = file.path("~", "Library", "Caches"), + unix = Sys.getenv("XDG_CACHE_HOME", file.path("~", ".cache")), NA_character_ ) @@ -49,9 +47,123 @@ findOSCachePath <- function() { path <- c("~", ".Rcache") } - path <- do.call(file.path, args = as.list(path)) + do.call(file.path, args = as.list(path)) +} + +findOSCachePath_0.15.0 <- if (getRversion() >= "4.0.0") { + function(os = getOS()) { +# message("findOSCachePath_0.15.0() ...") +# on.exit(message("findOSCachePath_0.15.0() ... done")) + +# message("os=", os) +# message("getOS()=", getOS()) + if (os != getOS()) { + if (os == "macos") { + tracer <- quote(Sys.info <- function() c(sysname = "Darwin")) + } else { + tracer <- quote(.Platform <- list(OS.type = os)) + } + message("- trace(tools::R_user_dir, tracer = tracer) ...") + trace(tools::R_user_dir, tracer = tracer) + message("- trace(tools::R_user_dir, tracer = tracer) ... done") + on.exit(untrace(tools::R_user_dir)) + } + tools::R_user_dir(.packageName, which = "cache") + } +} else function(os = getOS()) { + path <- Sys.getenv("R_USER_CACHE_DIR", NA_character_) + if (is.na(path)) path <- Sys.getenv("XDG_CACHE_HOME", NA_character_) + if (is.na(path)) { + path <- switch(os, + windows = file.path(Sys.getenv("LOCALAPPDATA"), "R", "cache"), + macos = file.path("~", "Library", "Caches", "org.R-project.R"), + unix = file.path("~", ".cache") + ) + } + file.path(path, "R", .packageName) +} + + +#' @importFrom utils file_test menu +findOSCachePath <- function(os = getOS(), action = c("query", "error", "warn", "remove", "move", "ignore")) { + rm_folder_if_empty <- function(path) { + if (!file_test("-d", path)) return(FALSE) + content <- dir(path = path, all.files = TRUE) + content <- setdiff(content, c(".", "..")) + has_README <- ("README.md" %in% content) + if (has_README) content <- setdiff(content, "README.md") + if (length(content) > 0) return(TRUE) + unlink(path, recursive = has_README) + file_test("-d", path) + } + +# message("findOSCachePath() ...") +# on.exit(message("findOSCachePath() ... done")) + + action <- match.arg(action) + + if (action == "query") { + ## Cannot query user? + if (!interactive() || isTRUE(getOption("R.cache.onLoad", FALSE))) { + action <- "ignore" + } + } + + path <- findOSCachePath_0.15.0(os = os) path <- normalizePath(path, mustWork = FALSE) + ## Is there another, old cache folder? Can we migrate it? + if (action != "ignore") { + path_old <- findOSCachePath_0.14.0(os = os) + path_old <- normalizePath(path_old, mustWork = FALSE) + exists_old <- rm_folder_if_empty(path_old) + exists <- rm_folder_if_empty(path) + if (path != path_old && exists_old) { + if (action == "query") { + choices <- c( + "Abort", + "Ignore old R.cache folder", + "Remove old R.cache folder", + if (!exists) "Try to move it to the new location" + ) + repeat { + ans <- menu(choices, title = "What to do with old non-empty R.cache folder?") + if (ans != 0L) break + } + action <- c("error", "warn", "remove", "move")[ans] + } + if (action == "remove") { + if (exists_old) { + unlink(path_old, recursive = TRUE) + exists_old <- file_test("-d", path_old) + if (exists_old) { + stop("Failed to remove all of folder: ", sQuote(path_old)) + } + } + } else if (action == "move") { + ## Can we move the whole folder as-is? + if (!exists) { + file.rename(path_old, path) + exists <- file_test("-d", path) + exists_old <- file_test("-d", path_old) + if (!exists || exists_old) { + stop(sprintf("Failed to move folder: %s (%s) -> %s (%s)", + sQuote(path_old), if (exists_old) "still exists" else "gone", + sQuote(path), if (exists) "exists" else "missing")) + } + } else { + action <- "error" + } + } + + if (action %in% c("error", "warn")) { + msg <- sprintf("There is an non-empty old-style R.cache folder that is no longer used. To reuse its content, move files and subfolders from %s to %s", sQuote(path_old), sQuote(path)) + if (action == "error") stop(msg) + warning(msg, immediate. = TRUE) + } + } + } ## if (action != "ignore") + path } diff --git a/R/queryRCmdCheck.R b/R/queryRCmdCheck.R new file mode 100644 index 0000000..fe3b323 --- /dev/null +++ b/R/queryRCmdCheck.R @@ -0,0 +1,67 @@ +queryRCmdCheck <- function(...) { + evidences <- list() + + # Memoization + evidences[["R_CMD_CHECK"]] <- isTRUE(as.logical(Sys.getenv("R_CMD_CHECK"))) + + # Command line arguments + args <- commandArgs() + evidences[["vanilla"]] <- is.element("--vanilla", args) + + # Check the working directory; any components containing .Rcheck/tests + evidences[["pwd"]] <- FALSE + path <- getwd() + last_path <- "" + while (path != last_path) { + last_path <- path + if (basename(path) == "tests") { + if (grepl(".+[.]Rcheck$", dirname(path))) { + evidences[["pwd"]] <- TRUE + break + } + } + path <- dirname(path) + } + + # Is 'R CMD check' checking examples? + evidences[["examples"]] <- is.element("CheckExEnv", search()) + + + # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + # Conclusions + # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + if (evidences$R_CMD_CHECK) { + res <- "R_CMD_CHECK" + } else if (!evidences[["vanilla"]]) { + res <- "notRunning" + } else if (evidences[["examples"]]) { + res <- "checkingExamples" + } else if (evidences[["pwd"]]) { + res <- "checkingTests" + } else { + res <- "notRunning" + } + + # Make it stick + if (res != "notRunning") { + Sys.setenv(R_CMD_CHECK = "true") + } + + attr(res, "evidences") <- evidences + + if (isTRUE(as.logical(Sys.getenv("R_R_CACHE_DEBUG")))) { + file <- file.path("~", ".cache", "R", sprintf("R.cache-%d.log", Sys.getpid())) + dir.create(dirname(file), recursive = TRUE, showWarnings = FALSE) + cat(sprintf("Call: %s\n", paste(commandArgs(), collapse = " ")), file = file, append = TRUE) + cat(sprintf("PID: %s\n", Sys.getpid()), file = file, append = TRUE) + cat(sprintf("pwd: %s\n", getwd()), file = file, append = TRUE) + cat(sprintf("search(): %s\n", paste(sQuote(search()), collapse = ", ")), file = file, append = TRUE) + cat(sprintf("R_CMD_CHECK: %s\n", sQuote(Sys.getenv("R_CMD_CHECK", NA_character_))), file = file, append = TRUE) + cat(sprintf("queryRCmdCheck(): %s\n", sQuote(res)), file = file, append = TRUE) + } + + res +} + + +inRCmdCheck <- function() (queryRCmdCheck() != "notRunning") diff --git a/R/setupCacheRootPath.R b/R/setupCacheRootPath.R index 91d8d57..284b332 100644 --- a/R/setupCacheRootPath.R +++ b/R/setupCacheRootPath.R @@ -54,14 +54,11 @@ setMethodS3("setupCacheRootPath", "default", function(defaultPath=NULL, ...) { # unless the default directory exists, ... osDefaultPath <- getDefaultCacheRootPath(NULL) defaultPath <- getDefaultCacheRootPath(defaultPath) - if (isDirectory(defaultPath)) { + if (isDirectory(defaultPath) || identical(defaultPath, osDefaultPath)) { rootPath <- defaultPath } else if (interactive()) { # or we cn ask the user to confirm the default path... - prompt <- "The R.cache package needs to create a directory that will hold cache files." - if (identical(defaultPath, osDefaultPath)) { - prompt <- c(prompt, "It is convenient to use ", sQuote(osDefaultPath), "because it follows the standard on your operating system and it remains also after restarting R.") - } + prompt <- "The R.cache package needs to create a non-standard directory that will hold cache files." prompt <- c(prompt, sprintf("Do you wish to create the '%s' directory? If not, a temporary directory (%s) that is specific to this R session will be used.", defaultPath, rootPath)) prompt <- paste(prompt, collapse=" ") tryCatch({ diff --git a/R/utils.R b/R/utils.R deleted file mode 100644 index f283aae..0000000 --- a/R/utils.R +++ /dev/null @@ -1,41 +0,0 @@ -## From R.utils 2.7.0 (2018-08-26) -queryRCmdCheck <- function(...) { - evidences <- list() - - # Command line arguments - args <- commandArgs() - evidences[["vanilla"]] <- is.element("--vanilla", args) - - # Check the working directory - pwd <- getwd() - dirname <- basename(pwd) - parent <- basename(dirname(pwd)) - pattern <- ".+[.]Rcheck$" - - # Is 'R CMD check' checking tests? - evidences[["tests"]] <- ( - (regexpr(pattern, parent) != -1) && - (regexpr("^tests(|_.*)$", dirname) != -1) - ) - - # Is the current working directory as expected? - evidences[["pwd"]] <- (evidences[["tests"]] || (regexpr(pattern, dirname) != -1)) - - # Is 'R CMD check' checking examples? - evidences[["examples"]] <- is.element("CheckExEnv", search()) - - - if (!evidences$vanilla || !evidences$pwd) { - res <- "notRunning" - } else if (evidences$tests) { - res <- "checkingTests" - } else if (evidences$examples) { - res <- "checkingExamples" - } else { - res <- "notRunning" - } - - res -} - -inRCmdCheck <- function() { queryRCmdCheck() != "notRunning" } diff --git a/README.md b/README.md index 3c07764..1579295 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,15 @@ -# R.cache: Fast and Light-Weight Caching (Memoization) of Objects and Results to Speed Up Computations + + +
+CRAN check status +Build status +Build status +Build status +Coverage Status + +
+ +# R.cache: Fast and Light-Weight Caching (Memoization) of Objects and Results to Speed Up Computations ## Installation @@ -7,27 +18,18 @@ R package R.cache is available on [CRAN](https://cran.r-project.org/package=R.ca install.packages("R.cache") ``` + ### Pre-release version To install the pre-release version that is available in Git branch `develop` on GitHub, use: ```r -remotes::install_github("HenrikBengtsson/R.cache@develop") +remotes::install_github("HenrikBengtsson/R.cache", ref="develop") ``` This will install the package from source. + -## Contributions - -This Git repository uses the [Git Flow](http://nvie.com/posts/a-successful-git-branching-model/) branching model (the [`git flow`](https://github.com/petervanderdoes/gitflow-avh) extension is useful for this). The [`develop`](https://github.com/HenrikBengtsson/R.cache/tree/develop) branch contains the latest contributions and other code that will appear in the next release, and the [`master`](https://github.com/HenrikBengtsson/R.cache) branch contains the code of the latest release, which is exactly what is currently on [CRAN](https://cran.r-project.org/package=R.cache). - -Contributing to this package is easy. Just send a [pull request](https://help.github.com/articles/using-pull-requests/). When you send your PR, make sure `develop` is the destination branch on the [R.cache repository](https://github.com/HenrikBengtsson/R.cache). Your PR should pass `R CMD check --as-cran`, which will also be checked by Travis CI and AppVeyor CI when the PR is submitted. - - -## Software status +## Contributing -| Resource: | CRAN | Travis CI | AppVeyor | -| ------------- | ------------------- | --------------- | ---------------- | -| _Platforms:_ | _Multiple_ | _Linux & macOS_ | _Windows_ | -| R CMD check | CRAN version | Build status | Build status | -| Test coverage | | Coverage Status | | +To contribute to this package, please see [CONTRIBUTING.md](CONTRIBUTING.md). diff --git a/cran-comments.md b/cran-comments.md index e47b3bc..476915c 100644 --- a/cran-comments.md +++ b/cran-comments.md @@ -1,56 +1,23 @@ -# CRAN submission R.cache 0.14.0 +# CRAN submission R.cache 0.15.0 -on 2019-12-05 +on 2021-04-29 -I've verified that this submission causes no issues for any of the 16 reverse package dependencies available on CRAN and Bioconductor. +I've verified this submission has no negative impact on any of the 22 reverse dependencies (19 from CRAN + 3 from Bioconductor). -Thanks in advance +Thank you ## Notes not sent to CRAN -### R CMD check --as-cran validation +### R CMD check validation The package has been verified using `R CMD check --as-cran` on: -* Platform x86_64-apple-darwin15.6.0 (64-bit) [Travis CI]: - - R version 3.5.3 (2019-03-11) - - R version 3.6.1 (2019-07-05) +| R version | GitHub Actions | Travis | AppVeyor | R-hub | Win-builder | +| --------- | -------------- | ------ | -------- | ------- | ----------- | +| 3.6.x | | L | | | | +| 4.0.x | L M W | L | W | M S | W | +| 4.1.x | | | | | W | +| devel | L M W | L | W 32&64 | W | | -* Platform x86_64-unknown-linux-gnu (64-bit) [Travis CI]: - - R version 3.5.3 (2017-01-27) [sic!] - - R version 3.6.1 (2017-01-27) [sic!] - - R Under development (unstable) (2019-12-03 r77509) - -* Platform x86_64-pc-linux-gnu (64-bit): - - R version 2.14.0 (2011-10-31) - - R version 3.0.0 (2013-04-03) - - R version 3.2.0 (2015-04-16) - - R version 3.4.0 (2017-04-21) - - R version 3.6.0 (2019-04-26) - - R version 3.6.1 (2019-07-05) - -* Platform x86_64-pc-linux-gnu (64-bit) [r-hub]: - - R version 3.6.1 (2019-07-05) - - R Under development (unstable) (2019-12-01 r77489) - -* Platform i686-pc-linux-gnu (32-bit): - - R version 3.4.4 (2018-03-15) - - R version 3.6.1 (2019-07-05) - -* Platform i386-pc-solaris2.10 (32-bit) [r-hub]: - - R version 3.6.0 (2019-04-26) - -* Platform x86_64-w64-mingw32 (64-bit) [r-hub]: - - R Under development (unstable) (2019-11-08 r77393) - -* Platform i386-w64-mingw32 (32-bit) [Appveyor CI]: - - R Under development (unstable) (2019-12-02 r77499) - -* Platform x86_64-w64-mingw32/x64 (64-bit) [Appveyor CI]: - - R version 3.6.1 (2019-07-05) - - R Under development (unstable) (2019-12-02 r77499) - -* Platform x86_64-w64-mingw32/x64 (64-bit) [win-builder]: - - R version 3.6.1 (2019-07-05) - - R Under development (unstable) (2019-12-02 r77499) +*Legend: OS: L = Linux, S = Solaris, M = macOS, W = Windows* diff --git a/revdep/README.md b/revdep/README.md index 21b1a48..ccc3bd3 100644 --- a/revdep/README.md +++ b/revdep/README.md @@ -2,46 +2,52 @@ |field |value | |:--------|:----------------------------| -|version |R version 3.6.1 (2019-07-05) | -|os |Ubuntu 18.04.3 LTS | +|version |R version 4.0.5 (2021-03-31) | +|os |CentOS Linux 7 (Core) | |system |x86_64, linux-gnu | |ui |X11 | |language |en | |collate |en_US.UTF-8 | |ctype |en_US.UTF-8 | |tz |America/Los_Angeles | -|date |2019-12-05 | +|date |2021-04-27 | # Dependencies |package |old |new |Δ | |:-----------|:------|:-----------|:--| -|R.cache |0.13.0 |0.13.0-9000 |* | -|digest |0.6.23 |0.6.23 | | -|R.methodsS3 |1.7.1 |1.7.1 | | -|R.oo |1.23.0 |1.23.0 | | -|R.utils |2.9.1 |2.9.1 | | +|R.cache |0.14.0 |0.14.0-9000 |* | +|digest |0.6.27 |0.6.27 | | +|R.methodsS3 |1.8.1 |1.8.1 | | +|R.oo |1.24.0 |1.24.0 | | +|R.utils |2.10.1 |2.10.1 | | # Revdeps -## All (16) +## All (22) -|package |version |error |warning |note | -|:-----------------------------------------------|:-------|:-----|:-------|:----| -|[aroma.affymetrix](problems.md#aromaaffymetrix) |3.2.0 | | |2 | -|aroma.cn |1.6.1 | | | | -|[aroma.core](problems.md#aromacore) |3.2.0 | | |2 | -|clampSeg |1.0-5 | | | | -|CoRegFlux |1.2.0 | | | | -|jointseg |1.0.2 | | | | -|[MSnID](problems.md#msnid) |1.20.0 | |1 |1 | -|PSCBS |0.65.0 | | | | -|[QDNAseq](problems.md#qdnaseq) |1.22.0 | | |1 | -|R.filesets |2.13.0 | | | | -|R.rsp |0.43.2 | | | | -|ragtop |1.1.0 | | | | -|repmis |0.5 | | | | -|scholar |0.1.7 | | | | -|[stepR](problems.md#stepr) |2.0-4 | | |1 | -|TreeSearch |0.3.2 | | | | +|package |version |error |warning |note | +|:-----------------------------------|:-------|:-----|:-------|:----| +|aroma.affymetrix |3.2.0 | | | | +|aroma.cn |1.6.1 | | | | +|[aroma.core](problems.md#aromacore) |3.2.2 | | |1 | +|clampSeg |1.1-0 | | | | +|[CoRegFlux](problems.md#coregflux) |1.6.0 |2 | |1 | +|csodata |1.1.1 | | | | +|[DiceView](problems.md#diceview) |2.0-1 | | |1 | +|jointseg |1.0.2 | | | | +|[MSnID](problems.md#msnid) |1.24.0 | | |2 | +|[precommit](problems.md#precommit) |0.1.3 | | |1 | +|PSCBS |0.65.0 | | | | +|[QDNAseq](problems.md#qdnaseq) |1.26.0 | | |1 | +|R.filesets |2.14.0 | | | | +|R.rsp |0.44.0 | | | | +|ragtop |1.1.1 | | | | +|[repmis](problems.md#repmis) |0.5 | | |1 | +|RKorAPClient |0.6.1 | | | | +|scholar |0.2.0 | | | | +|[stepR](problems.md#stepr) |2.1-1 | | |1 | +|styler |1.4.1 | | | | +|TreeSearch |0.4.3 | | | | +|TreeTools |1.4.4 | | | | diff --git a/revdep/cran.md b/revdep/cran.md new file mode 100644 index 0000000..160ceae --- /dev/null +++ b/revdep/cran.md @@ -0,0 +1,7 @@ +## revdepcheck results + +We checked 22 reverse dependencies (19 from CRAN + 3 from Bioconductor), comparing R CMD check results across CRAN and dev versions of this package. + + * We saw 0 new problems + * We failed to check 0 packages + diff --git a/revdep/problems.md b/revdep/problems.md index 3f92a16..3bad2a2 100644 --- a/revdep/problems.md +++ b/revdep/problems.md @@ -1,125 +1,182 @@ -# aroma.affymetrix +# aroma.core
-* Version: 3.2.0 -* Source code: https://github.com/cran/aroma.affymetrix -* URL: https://www.aroma-project.org/, https://github.com/HenrikBengtsson/aroma.affymetrix -* BugReports: https://github.com/HenrikBengtsson/aroma.affymetrix/issues -* Date/Publication: 2019-06-23 06:00:14 UTC -* Number of recursive dependencies: 80 +* Version: 3.2.2 +* GitHub: https://github.com/HenrikBengtsson/aroma.core +* Source code: https://github.com/cran/aroma.core +* Date/Publication: 2021-01-05 05:10:12 UTC +* Number of recursive dependencies: 51 -Run `revdep_details(,"aroma.affymetrix")` for more info +Run `revdep_details(, "aroma.core")` for more info
## In both -* checking installed package size ... NOTE - ``` - installed size is 5.8Mb - sub-directories of 1Mb or more: - R 2.3Mb - help 1.1Mb - testScripts 1.3Mb - ``` - -* checking dependencies in R code ... NOTE +* checking package dependencies ... NOTE ``` - Error in setGeneric("getX", function(object, type) standardGeneric("getX")) : - could not find function "setGeneric" + Packages suggested but not available for checking: + 'sfit', 'expectile', 'HaarSeg', 'mpcbs' ``` -# aroma.core +# CoRegFlux
-* Version: 3.2.0 -* Source code: https://github.com/cran/aroma.core -* URL: https://github.com/HenrikBengtsson/aroma.core, https://www.aroma-project.org/ -* BugReports: https://github.com/HenrikBengtsson/aroma.core/issues -* Date/Publication: 2019-06-17 18:20:03 UTC -* Number of recursive dependencies: 46 +* Version: 1.6.0 +* GitHub: NA +* Source code: https://github.com/cran/CoRegFlux +* Date/Publication: 2020-10-27 +* Number of recursive dependencies: 91 -Run `revdep_details(,"aroma.core")` for more info +Run `revdep_details(, "CoRegFlux")` for more info
## In both +* checking examples ... ERROR + ``` + Running examples in ‘CoRegFlux-Ex.R’ failed + The error most likely occurred in: + + > ### Name: ODCurveToFluxCurves + > ### Title: ODCurveToFluxCurves + > ### Aliases: ODCurveToFluxCurves + > + > ### ** Examples + > + > data(iMM904) + ... + > ODtoflux<-ODCurveToFluxCurves(model = iMM904, + + ODs = ODs,times = times, metabolites_rates = metabolites_rates) + Joining by: metabolites_id + Loading required package: glpkAPI + Warning in library(package, lib.loc = lib.loc, character.only = TRUE, logical.return = TRUE, : + there is no package called ‘glpkAPI’ + Error in checkDefaultMethod(solver, method, pType) : + package ‘glpkAPI’ not found + Calls: ODCurveToFluxCurves ... get_fba_fluxes_from_observations -> -> -> .local -> sysBiolAlg + Execution halted + ``` + +* checking tests ... + ``` + ERROR + Running the tests in ‘tests/Test.R’ failed. + Last 50 lines of output: + + Error (test_DFBAsimulationFunctions.R:19:5): Simulation without CoRegNet finishes + Error: package 'glpkAPI' not found + Backtrace: + 1. testthat::expect_type(...) test_DFBAsimulationFunctions.R:19:4 + 4. CoRegFlux::Simulation(...) + 5. CoRegFlux:::Simulation_Step(...) + ... + 1. testthat::expect_true(...) test_MetabolicModelFunctions.R:13:5 + 4. base::is.data.frame(...) + ──────────────────────────────────────────────────────────────────────────────── + + ══ Results ═════════════════════════════════════════════════════════════════════ + Duration: 134.9 s + + [ FAIL 6 | WARN 2 | SKIP 0 | PASS 25 ] + Error: Test failures + Execution halted + ``` + * checking package dependencies ... NOTE ``` - Packages suggested but not available for checking: - 'sfit', 'expectile', 'HaarSeg', 'mpcbs' + Package suggested but not available for checking: ‘glpkAPI’ ``` -* checking dependencies in R code ... NOTE +# DiceView + +
+ +* Version: 2.0-1 +* GitHub: https://github.com/IRSN/DiceView +* Source code: https://github.com/cran/DiceView +* Date/Publication: 2020-11-27 16:30:02 UTC +* Number of recursive dependencies: 16 + +Run `revdep_details(, "DiceView")` for more info + +
+ +## In both + +* checking package dependencies ... NOTE ``` - Error in setGeneric("image", function(x, ...) standardGeneric("image")) : - could not find function "setGeneric" + Package which this enhances but not available for checking: ‘rgl’ ``` # MSnID
-* Version: 1.20.0 +* Version: 1.24.0 +* GitHub: NA * Source code: https://github.com/cran/MSnID -* Date/Publication: 2019-10-29 -* Number of recursive dependencies: 106 +* Date/Publication: 2020-10-27 +* Number of recursive dependencies: 141 -Run `revdep_details(,"MSnID")` for more info +Run `revdep_details(, "MSnID")` for more info
## In both -* checking Rd cross-references ... WARNING +* checking dependencies in R code ... NOTE ``` - Missing link or links in documentation object 'read_mzIDs.Rd': - ‘[mzR]{mzR-package}’ - - See section 'Cross-references' in the 'Writing R Extensions' manual. + Namespaces in Imports field not imported from: + ‘BiocGenerics’ ‘BiocStyle’ ‘RUnit’ ‘ggplot2’ ‘msmsTests’ ‘xtable’ + All declared Imports should be used. ``` * checking R code for possible problems ... NOTE ``` - ... - .read_mzIDs.mzR.engine.single.file: no visible binding for global - variable ‘DatabaseAccess’ .read_mzIDs.mzR.engine.single.file: no visible binding for global - variable ‘DatabaseDescription’ - .read_mzIDs.mzR.engine.single.file: no visible binding for global - variable ‘DBseqLength’ - infer_parsimonious_accessions,MSnID : infer_acc: no visible binding for - global variable ‘accession’ - infer_parsimonious_accessions,MSnID : infer_acc: no visible binding for - global variable ‘N’ - infer_parsimonious_accessions,MSnID : infer_acc: no visible binding for - global variable ‘pepSeq’ - recalibrate,MSnID: no visible global function definition for ‘median’ - recalibrate,MSnID: no visible global function definition for ‘density’ + variable ‘peptideRef’ Undefined global functions or variables: - DBseqLength DatabaseAccess DatabaseDescription N accession density i - location mass median modification name optim pepSeq quantile rnorm - spectrumID - Consider adding - importFrom("stats", "density", "median", "optim", "quantile", "rnorm") - to your NAMESPACE file. + peptideRef + ``` + +# precommit + +
+ +* Version: 0.1.3 +* GitHub: https://github.com/lorenzwalthert/precommit +* Source code: https://github.com/cran/precommit +* Date/Publication: 2020-10-10 19:40:02 UTC +* Number of recursive dependencies: 88 + +Run `revdep_details(, "precommit")` for more info + +
+ +## In both + +* checking dependencies in R code ... NOTE + ``` + Namespaces in Imports field not imported from: + ‘R.cache’ ‘docopt’ ‘here’ + All declared Imports should be used. ``` # QDNAseq
-* Version: 1.22.0 +* Version: 1.26.0 +* GitHub: https://github.com/ccagc/QDNAseq * Source code: https://github.com/cran/QDNAseq -* URL: https://github.com/ccagc/QDNAseq -* BugReports: https://github.com/ccagc/QDNAseq/issues -* Date/Publication: 2019-10-29 -* Number of recursive dependencies: 70 +* Date/Publication: 2020-10-27 +* Number of recursive dependencies: 72 -Run `revdep_details(,"QDNAseq")` for more info +Run `revdep_details(, "QDNAseq")` for more info
@@ -131,16 +188,38 @@ Run `revdep_details(,"QDNAseq")` for more info All declared Imports should be used. ``` +# repmis + +
+ +* Version: 0.5 +* GitHub: https://github.com/christophergandrud/repmis +* Source code: https://github.com/cran/repmis +* Date/Publication: 2016-02-07 09:16:30 +* Number of recursive dependencies: 19 + +Run `revdep_details(, "repmis")` for more info + +
+ +## In both + +* checking package dependencies ... NOTE + ``` + Package suggested but not available for checking: ‘xlsx’ + ``` + # stepR
-* Version: 2.0-4 +* Version: 2.1-1 +* GitHub: NA * Source code: https://github.com/cran/stepR -* Date/Publication: 2019-11-03 21:10:02 UTC -* Number of recursive dependencies: 36 +* Date/Publication: 2020-08-26 16:10:06 UTC +* Number of recursive dependencies: 45 -Run `revdep_details(,"stepR")` for more info +Run `revdep_details(, "stepR")` for more info
@@ -148,8 +227,8 @@ Run `revdep_details(,"stepR")` for more info * checking installed package size ... NOTE ``` - installed size is 6.9Mb + installed size is 11.1Mb sub-directories of 1Mb or more: - libs 5.8Mb + libs 10.1Mb ``` diff --git a/revdep/run.R b/revdep/run.R index f1f9b1b..2128b55 100755 --- a/revdep/run.R +++ b/revdep/run.R @@ -1,21 +1,4 @@ #!/usr/bin/env Rscript -library("revdepcheck") -options(warn = 1L) - -available_cores <- function() { - getenv <- function(name) { - as.integer(Sys.getenv(name, NA_character_)) - } - getopt <- function(name) { - as.integer(getOption(name, NA_integer_)) - } - if (is.finite(n <- getopt("mc.cores") + 1L)) return(n) - if (is.finite(n <- getopt("Ncpus") + 1L)) return(n) - if (is.finite(n <- getenv("PBS_NUM_PPN"))) return(n) - if (is.finite(n <- getenv("SLURM_CPUS_PER_TASK"))) return(n) - if (is.finite(n <- getenv("NSLOTS"))) return(n) - 1L -} precheck <- function() { ## WORKAROUND: Remove checked pkgs that use file links, which otherwise @@ -23,196 +6,4 @@ precheck <- function() { unlink("revdep/checks/aroma.affymetrix", recursive = TRUE) } -check <- function() { - if (file_test("-f", p <- Sys.getenv("R_CHECK_ENVIRON", "~/.R/check.Renviron"))) { - cat(sprintf("R CMD check will use env vars from %s\n", sQuote(p))) - cat(sprintf("To disable, set 'R_CHECK_ENVIRON=false' (a fake pathname)\n")) - } - - envs <- Sys.getenv() - envs <- envs[grep("^_?R_CHECK_", names(envs))] - if (length(envs) > 0L) { - envs <- sprintf(" %02d. %s=%s", seq_along(envs), names(envs), envs) - envs <- paste(envs, collapse="\n") - cat(sprintf("Detected R-specific env vars that may affect R CMD check:\n%s\n", envs)) - } - - precheck() - revdep_check(bioc = TRUE, num_workers = available_cores(), - timeout = as.difftime(30, units = "mins"), quiet = FALSE) -} - - -todo <- function() { - pkgs <- tryCatch(revdep_todo(), error = function(ex) NA) - if (identical(pkgs, NA)) { - cat("Revdepcheck has not been initiated\n") - return() - } - pkgs <- subset(pkgs, status == "todo") - if (nrow(pkgs) == 0) { - cat("There are no packages on the revdepcheck todo list\n") - } else { - cat(sprintf("%d. %s\n", seq_len(nrow(pkgs)), pkgs$package)) - } -} - -parse_pkgs <- function(pkgs) { - pkgs <- unlist(strsplit(pkgs, split = ",", fixed = TRUE)) - pkgs <- gsub("[ \t'\"‘’]", "", pkgs) - sort(unique(pkgs)) -} - -revdep_init <- function() { - if (!revdepcheck:::db_exists(".")) revdepcheck:::db_setup(".") -} - -revdep_todo_reset <- function() { - revdep_init() - db <- revdepcheck:::db(".") - df <- data.frame(package = character(0L), stringsAsFactors = FALSE) - DBI::dbWriteTable(db, "todo", df, overwrite = TRUE, append = FALSE) -} - -revdep_this_package <- local({ - pkg <- NULL - function() { - if (is.null(pkg)) pkg <<- desc::desc(file = "DESCRIPTION")$get("Package") - pkg - } -}) - -revdep_children <- local({ - cache <- list() - function(pkg = NULL) { - if (is.null(pkg)) pkg <- revdep_this_package() - pkgs <- cache[[pkg]] - if (is.null(pkgs)) { - pkgs <- revdepcheck:::cran_revdeps(pkg) - pkgs <- setdiff(pkgs, pkg) ## WORKAROUND - cache[[pkg]] <- pkgs - } - pkgs - } -}) - -revdep_pkgs_with_status <- function(status = "error") { - status <- match.arg(status) - res <- revdepcheck::revdep_summary() - field <- switch(status, error = "errors") - has_status <- vapply(res, FUN = function(x) { - z <- x[["new"]][[field]] - is.character(z) && any(nchar(z) > 0) - }, FUN.VALUE = NA, USE.NAMES = TRUE) - has_status <- !is.na(has_status) & has_status - names(has_status)[has_status] -} - -revdep_preinstall <- function(pkgs) { - pkgs <- unique(pkgs) - lib_paths_org <- lib_paths <- .libPaths() - on.exit(.libPaths(lib_paths_org)) - lib_paths[1] <- sprintf("%s-revdepcheck", lib_paths[1]) - dir.create(lib_paths[1], recursive = TRUE, showWarnings = FALSE) - .libPaths(lib_paths) - message(sprintf("Triggering crancache builds by pre-installing %d packages: %s", length(pkgs), paste(sQuote(pkgs), collapse = ", "))) - message(".libPaths():") - message(paste(paste0(" - ", .libPaths()), collapse = "\n")) - ## Install one-by-one to update cache sooner - for (kk in seq_along(pkgs)) { - pkg <- pkgs[kk] - message(sprintf("Pre-installing package %d of %d: %s", - kk, length(pkgs), pkg)) - crancache::install_packages(pkg) - } -} - -args <- base::commandArgs(trailingOnly = TRUE) -if ("--reset" %in% args) { - revdep_reset() -} else if ("--todo-reset" %in% args) { - revdep_todo_reset() - todo() -} else if ("--todo" %in% args) { - todo() -} else if ("--add" %in% args) { - pos <- which("--add" == args) - pkgs <- parse_pkgs(args[seq(from = pos + 1L, to = length(args))]) - revdep_add(packages = pkgs) - todo() -} else if ("--rm" %in% args) { - pos <- which("--rm" == args) - pkgs <- parse_pkgs(args[seq(from = pos + 1L, to = length(args))]) - revdep_rm(packages = pkgs) - todo() -} else if ("--add-broken" %in% args) { - revdep_add_broken() - todo() -} else if ("--add-error" %in% args) { -# res <- revepcheck::revdep_summary() - pkgs <- revdep_pkgs_with_status("error") - str(pkgs) - revdep_add(packages = pkgs) - todo() -} else if ("--add-all" %in% args) { - revdep_init() - pkgs <- revdep_children() - for (pkg in pkgs) { - pkgs <- c(pkgs, revdepcheck:::cran_revdeps(pkg)) - } - pkgs <- unique(pkgs) - revdep_add(packages = pkgs) - todo() -} else if ("--add-grandchildren" %in% args) { - revdep_init() - pkgs <- NULL - for (pkg in revdep_children()) { - pkgs <- c(pkgs, revdepcheck:::cran_revdeps(pkg)) - } - pkgs <- unique(pkgs) - revdep_add(packages = pkgs) - todo() -} else if ("--show-check" %in% args) { - pos <- which("--show-check" == args) - pkgs <- parse_pkgs(args[seq(from = pos + 1L, to = length(args))]) - for (pkg in pkgs) { - for (dir in c("old", "new")) { - path <- file.path("revdep", "checks", pkg, dir, sprintf("%s.Rcheck", pkg)) - if (!utils::file_test("-d", path)) next - pathname <- file.path(path, "00check.log") - cat("-----------------------------------------------\n") - cat(sprintf("%s (%s):\n", pkg, dir)) - cat("-----------------------------------------------\n") - bfr <- readLines(pathname, warn = FALSE) - tail <- tail(bfr, n = 20L) - writeLines(tail) - } - } -} else if ("--list-children" %in% args) { - pkg <- revdep_this_package() - pkgs <- revdepcheck:::cran_revdeps(pkg) - cat(sprintf("[n=%d] %s\n", length(pkgs), paste(pkgs, collapse = " "))) -} else if ("--list-error" %in% args) { - cat(paste(revdep_pkgs_with_status("error"), collapse = " "), "\n", sep="") -} else if ("--add-error" %in% args) { - revdepcheck::revdep_add(packages = revdep_pkgs_with_status("error")) -} else if ("--preinstall-children" %in% args) { - pkg <- revdep_this_package() - pkgs <- revdepcheck:::cran_revdeps(pkg) - revdep_preinstall(pkgs) -} else if ("--preinstall-error" %in% args) { - res <- revdepcheck::revdep_summary() - revdep_preinstall(revdep_pkgs_with_status("error")) -} else if ("--preinstall-todo" %in% args) { - todo <- revdep_todo() - revdep_preinstall(todo$package) -} else if ("--preinstall" %in% args) { - pos <- which("--preinstall" == args) - pkgs <- parse_pkgs(args[seq(from = pos + 1L, to = length(args))]) - revdep_preinstall(pkgs) -} else { - stopifnot(length(args) == 0L) - check() - revdep_report(all = TRUE) -} - +revdepcheck.extras::run() diff --git a/revdep/run.sge b/revdep/run.sge new file mode 100755 index 0000000..2f9bb7d --- /dev/null +++ b/revdep/run.sge @@ -0,0 +1,54 @@ +#!/bin/bash +## Example: qsub -pe smp 24 -l h_rt=08:00:00 revdep/run.sge +#$ -S /bin/bash +#$ -R yes # SGE host reservation, highly recommended +#$ -cwd # Current working directory +#$ -j y # Join STDERR and STDOUT +#$ -l mem_free=3G # On average 4 GiB of RAM per core (=a package check) +#$ -m bea # email when job (b)egins, (e)nds, or (a)borts +# +# Pass on R-specific environment variables, iff set: +##$ -v _R_CHECK_LENGTH_1_CONDITION_ +##$ -v _R_CHECK_LENGTH_1_LOGIC2_ +##$ -v R_STARTUP_DEBUG + +## SPECIAL: On Wynton HPC +if [[ $SGE_CLUSTER_NAME == *wynton* ]]; then + module load CBI + module load r +# module load r/4.0.0-alpha + + ## Some packages need a more modern version of gcc, e.g. 'balvaan' + module load CBI-testing + module load scl-devtoolset/4 + + ## Some packages require non-default system libraries + module load gdal geos gsl hdf5 jags + + ## Report on what modules are in use + module list + + ## Install all packages to toward $TMPDIR, if revdep/library doesn't already exist. + ## This will avoid some of the slowness on the global file system + #if [[ ! -d revdep/library ]]; then + # tmpdir=$(mktemp -d) + # ln -fs "$tmpdir" revdep/library + # [[ -d revdep/library ]] || { >&2 echo "ERROR: Failed to link revdep/library/ to $tmpdir"; exit 1; } + #fi + + ## To check in on revdep/library/ on the running host (see below), submit a job like: + ## echo "ls -lR revdep/library/" | qsub -cwd -j yes -l hostname= + + ## Assert that revdep/library is on $TMPDIR + #if [[ ! "$(readlink revdep/library)" = $TMPDIR* ]]; then + # >&2 echo "ERROR: revdep/library/ already exists but is not on $TMPDIR" + # exit 1 + #fi +fi + +echo "HOSTNAME: $HOSTNAME" +ls -l revdep/ + +Rscript --version +Rscript -e ".libPaths()" +Rscript revdep/run.R diff --git a/tests/findOSCachePath.R b/tests/findOSCachePath.R new file mode 100644 index 0000000..de907cd --- /dev/null +++ b/tests/findOSCachePath.R @@ -0,0 +1,54 @@ +library(R.cache) + +findOSCachePath <- R.cache:::findOSCachePath +getOS <- R.cache:::getOS +message("findOSCachePath() ...") + +oses <- getOS() +if (isTRUE(as.logical(Sys.getenv("R_CHECK_FULL", "FALSE")))) { + oses <- c("unix", "windows", "macos") +} + +for (os in oses) { + message("Operating system: ", sQuote(os)) + message("- getOS(): ", sQuote(getOS())) + + ## Fake the OS? + fake_os <- (os != getOS()) + if (fake_os) { + if (os == "windows") { + Sys.setenv(LOCALAPPDATA = normalizePath("~/AppData/Local", mustWork = FALSE)) + } + } + + path <- findOSCachePath(os) + message("- findOSCachePath(): ", sQuote(path)) + + if (getRversion() >= "4.0.0") { + R_user_dir <- tools::R_user_dir + path_R <- local({ + if (fake_os) { + if (os == "macos") { + tracer <- quote(Sys.info <- function() c(sysname = "Darwin")) + } else { + tracer <- quote(.Platform <- list(OS.type = os)) + } + trace(R_user_dir, tracer = tracer) + on.exit(untrace(R_user_dir)) + } + R_user_dir("R.cache", which = "cache") + }) + + message("- R_user_dir('R.cache', which = 'cache'): ", sQuote(path_R)) + path_R <- normalizePath(path_R, mustWork = FALSE) + message("- Normalized version: ", sQuote(path_R)) + res <- identical(path, path_R) + message("- Identical to findOSCachePath(): ", res) + if (!res) { + message("- findOSCachePath() differ from R_user_dir(): ", + sQuote(path), " != ", sQuote(path_R)) + } + } +} ## for (os ...) + +message("findOSCachePath() ... done")