Skip to contents

Execute R CMD CHECK on a local package with all dependencies pre-installed using various strategies.

Usage

max_deps_check(
  path,
  extra_deps = character(),
  config = list(),
  build_args = character(),
  check_args = character(),
  ...
)

release_deps_check(
  path,
  extra_deps = character(),
  config = list(),
  build_args = character(),
  check_args = character(),
  ...
)

min_cohort_deps_check(
  path,
  extra_deps = character(),
  config = list(),
  build_args = character(),
  check_args = character(),
  ...
)

min_isolated_deps_check(
  path,
  extra_deps = character(),
  config = list(),
  build_args = character(),
  check_args = character(),
  ...
)

Arguments

path

(string) path to the package sources

extra_deps

(character(1)) Extra dependencies specified similarly as in the DESCRIPTION file, i.e. "<package name> (<operator> <version>)" where both <operator> and <version> are optional. Multiple entries are possible separated by ";".

config

(list) configuration options. See pkgdepends::pkg_config for details. "dependencies" and "library" elements are overwritten by package level defaults.

build_args

(string) value passed as build_args argument into rcmdcheck::rcmdcheck()

check_args

(string) value passed as args argument into rcmdcheck::rcmdcheck()

...

other arguments passed to rcmdcheck::rcmdcheck()

Value

a named list with two elements:

strategies

Currently implemented strategies:

  • max - use the greatest version of dependent packages. Please note that using development version is not guaranteed to be stable. See get_ref_max for details.

  • release - use the released version of dependent packages. It will try use CRAN if possible else if GitHub release is available then use it else fail. See get_ref_release for details.

  • min_cohort - find maximum date of directly dependent packages release dates and use that as PPM snapshot date for dependency resolve.

  • min_isolated - for each direct dependency: find its release date and use it as PPM snapshot for resolving itself. Next, combine all the individual resolutions and resolve it altogether again.

Both "min" strategies relies on PPM snapshot in order to limit the versions of indirect dependencies so that dependency resolution ends with a package released no earlier than any of its dependency. However, that's not always true for min_isolated strategy - done on purpose.

Please note that only min_cohort and min_isolated strategies are "stable". The rest are basing on dynamic references therefore it results might be different without changes in tested package. The most straightforward example is max strategy in which the environment will be different after any push of any of the dependencies.

Examples

if (FALSE) { # Sys.getenv("R_USER_CACHE_DIR", "") != ""
x <- max_deps_check(".")
x$ip
x$check
}
if (FALSE) { # Sys.getenv("R_USER_CACHE_DIR", "") != ""
x <- release_deps_check(".")
x$ip
x$check
}
if (FALSE) { # Sys.getenv("R_USER_CACHE_DIR", "") != ""
x <- min_cohort_deps_check(".")
x$ip
x$check
}
if (FALSE) { # Sys.getenv("R_USER_CACHE_DIR", "") != ""
x <- min_isolated_deps_check(".")
x$ip
x$check
}