Title: | Systematically Run R CMD Checks |
---|---|
Description: | Systematically Run R checks against multiple packages. Checks are run in parallel with strategies to minimize dependency installation. Provides out of the box interface for running reverse dependency check. |
Authors: | Szymon Maksymiuk [cre, aut] , Doug Kelkhoff [aut] , F. Hoffmann-La Roche AG [cph, fnd] |
Maintainer: | Szymon Maksymiuk <[email protected]> |
License: | MIT + file LICENSE |
Version: | 0.2.4 |
Built: | 2024-10-26 06:16:29 UTC |
Source: | CRAN |
R6
Checks CoordinatorA stateful object that orchestrates all separate processes required to
manage installation, library setup and run R CMD check
s in sequence.
graph
(igraph::igraph()
)
A dependency graph, storing information about which dependencies
are required prior to execution of each check task.
Created with task_graph_create()
input
(data.frame()
)
Checks task data.frame
which is the source of all the checks.
output
(character(1)
)
Output directory where raw results and temporary library will
be created and stored.
new()
Initialize a new check design
Use checks data.frame to generate task graph in which all dependencies and installation order are embedded.
check_design$new( df, n = 2L, output = tempfile(paste(packageName(), Sys.Date(), sep = "-")), lib.loc = .libPaths(), repos = getOption("repos"), restore = options::opt("restore"), ... )
df
check_design
data.frame.
n
integer
value indicating maximum number of subprocesses that
can be simultaneously spawned when executing tasks.
output
character
value specifying path where the output should
be stored.
lib.loc
character
vector with libraries allowed to be used when
checking packages, defaults to entire .libPaths().
repos
character
vector of repositories which will be used when
generating task graph and later pulling dependencies.
restore
logical
value, whether output directory should be
unlinked before running checks. If FALSE
, an attempt will me made to
restore previous progress from the same output
.
...
Additional arguments unused
active_processes()
Get Active Processes list
check_design$active_processes()
failed_tasks()
Get Failed Tasks list
check_design$failed_tasks()
terminate()
Kill All Active Design Processes
Immediately terminates all the active processes.
check_design$terminate()
step()
Fill Available Processes with Tasks
check_design$step()
A logical value, indicating whether processes are actively running.
start_next_task()
Start Next Task
check_design$start_next_task()
A integer value, coercible to logical to indicate whether a new
process was spawned, or -1
if all tasks have finished.
is_done()
Check if checks are done
Checks whether all the scheduled tasks were successfully executed.
check_design$is_done()
clone()
The objects of this class are cloneable with this method.
check_design$clone(deep = FALSE)
deep
Whether to make a deep clone.
Other checks:
check_dev_rev_deps()
,
check_dir()
,
check_pkgs()
,
check_rev_deps()
,
new_check_design()
## Not run: library(checked) df <- source_check_tasks_df(c( system.file("example_packages", "exampleBad", package = "checked"), system.file("example_packages", "exampleGood", package = "checked") )) plan <- check_design$new(df, n = 10, repos = "https://cran.r-project.org/") while (!plan$is_done()) { plan$start_next_task() } ## End(Not run)
## Not run: library(checked) df <- source_check_tasks_df(c( system.file("example_packages", "exampleBad", package = "checked"), system.file("example_packages", "exampleGood", package = "checked") )) plan <- check_design$new(df, n = 10, repos = "https://cran.r-project.org/") while (!plan$is_done()) { plan$start_next_task() } ## End(Not run)
check_dev_rev_deps()
works similarly to check_rev_deps()
but it runs
R CMD check only once for each package, with the development version of the
package installed. It is advantageous to check whether adding a new package
into a repository breaks existing packages that possibly take said package
as a Suggests
dependency.
check_dev_rev_deps( path, n = 2L, output = tempfile(paste(utils::packageName(), Sys.Date(), sep = "-")), lib.loc = .libPaths(), repos = getOption("repos"), restore = options::opt("restore"), reporter = reporter_default(), ... )
check_dev_rev_deps( path, n = 2L, output = tempfile(paste(utils::packageName(), Sys.Date(), sep = "-")), lib.loc = .libPaths(), repos = getOption("repos"), restore = options::opt("restore"), reporter = reporter_default(), ... )
path |
file path to the package source directory |
n |
|
output |
|
lib.loc |
|
repos |
|
restore |
|
reporter |
A reporter to provide progress updates. Will default to the most expressive command-line reporter given your terminal capabilities. |
... |
Additional arguments passed to |
check_design()
R6 class storing all the details
regarding checks that run. Can be combined with
results
and summary()
methods to generate results.
Other checks:
check_design
,
check_dir()
,
check_pkgs()
,
check_rev_deps()
,
new_check_design()
check_dir()
Identifies all R packages in the given directory
(non-recursively) and passes them to the check_pkgs()
check_dir( path, n = 2L, output = tempfile(paste(utils::packageName(), Sys.Date(), sep = "-")), lib.loc = .libPaths(), repos = getOption("repos"), restore = options::opt("restore"), reporter = reporter_default(), ... )
check_dir( path, n = 2L, output = tempfile(paste(utils::packageName(), Sys.Date(), sep = "-")), lib.loc = .libPaths(), repos = getOption("repos"), restore = options::opt("restore"), reporter = reporter_default(), ... )
path |
file path to the package source directory |
n |
|
output |
|
lib.loc |
|
repos |
|
restore |
|
reporter |
A reporter to provide progress updates. Will default to the most expressive command-line reporter given your terminal capabilities. |
... |
Additional arguments passed to |
check_design()
R6 class storing all the details
regarding checks that run. Can be combined with
results
and summary()
methods to generate results.
Other checks:
check_design
,
check_dev_rev_deps()
,
check_pkgs()
,
check_rev_deps()
,
new_check_design()
check_pkgs()
Installs all dependencies and runs R CMD check
s
in parallel for all source packages whose source code is found in the
path
directory
check_pkgs( path, n = 2L, output = tempfile(paste(utils::packageName(), Sys.Date(), sep = "-")), lib.loc = .libPaths(), repos = getOption("repos"), restore = options::opt("restore"), reporter = reporter_default(), ... )
check_pkgs( path, n = 2L, output = tempfile(paste(utils::packageName(), Sys.Date(), sep = "-")), lib.loc = .libPaths(), repos = getOption("repos"), restore = options::opt("restore"), reporter = reporter_default(), ... )
path |
file path to the package source directory |
n |
|
output |
|
lib.loc |
|
repos |
|
restore |
|
reporter |
A reporter to provide progress updates. Will default to the most expressive command-line reporter given your terminal capabilities. |
... |
Additional arguments passed to |
check_design()
R6 class storing all the details
regarding checks that run. Can be combined with
results
and summary()
methods to generate results.
Other checks:
check_design
,
check_dev_rev_deps()
,
check_dir()
,
check_rev_deps()
,
new_check_design()
Check a package's reverse dependencies in order to identify differences in reverse dependency check results when run alongside your package's development and release versions.
check_rev_deps( path, n = 2L, output = tempfile(paste(utils::packageName(), Sys.Date(), sep = "-")), lib.loc = .libPaths(), repos = getOption("repos"), reverse_repos = repos, restore = options::opt("restore"), reporter = reporter_default(), ... )
check_rev_deps( path, n = 2L, output = tempfile(paste(utils::packageName(), Sys.Date(), sep = "-")), lib.loc = .libPaths(), repos = getOption("repos"), reverse_repos = repos, restore = options::opt("restore"), reporter = reporter_default(), ... )
path |
file path to the package source directory |
n |
|
output |
|
lib.loc |
|
repos |
|
reverse_repos |
|
restore |
|
reporter |
A reporter to provide progress updates. Will default to the most expressive command-line reporter given your terminal capabilities. |
... |
Additional arguments passed to |
Runs classical reverse dependency checks for the given source package. It
first identifies reverse dependencies available in repos
. Then, after
installing all required dependencies, runs R CMD check
twice for each
package, one time with the release version of the given source package
installed from repos
and a second time with the development version
installed from local source. Both R CMD checks
are later compared to
identify changes in reverse dependency behaviors.
check_design()
R6 class storing all the details
regarding checks that run. Can be combined with
results
and summary()
methods to generate results.
Other checks:
check_design
,
check_dev_rev_deps()
,
check_dir()
,
check_pkgs()
,
new_check_design()
R CMD check
Create a task to run R CMD check
check_task_spec( args = options::opt("check_args"), build_args = options::opt("check_build_args"), ... )
check_task_spec( args = options::opt("check_args"), build_args = options::opt("check_build_args"), ... )
args |
Character vector of arguments to pass to |
build_args |
Character vector of arguments to pass to |
... |
Arguments passed on to
|
Other tasks:
checked-task-df
,
custom_install_task_spec()
,
install_task_spec()
,
rev_dep_check_tasks_df()
,
revdep_check_task_spec()
,
source_check_tasks_df()
,
task_spec()
Create data.frame which each row defines a package for which R CMD check
should be run. Such data.frame is a prerequisite for generating
check_design()
which orchestrates all the processes
including dependencies installation.
path |
path to the package source. Can be either a single source code directory or a directory containing multiple package source code directories. |
... |
parameters passed to the task specs allowing to customize subprocesses. |
_tasks_df()
functions generate check task data.frame
for
all source packages specified by the path
. Therefore it accepts it to be
a vector of an arbitrary length.
The check schedule data.frame
with the following columns:
alias
: The alias of the check to run. It also serves the purpose of
providing a unique identifier and node name in the task graph.
version
: Version of the package to be checked.
package
: Object that inherits from check_task_spec()
.
Defines how package to be checked can be acquired.
custom
: Object that inherits from custom_install_task_spec()
.
Defines custom package, for instance only available from local source, that
should be installed before checking the package.
Other tasks:
check_task_spec()
,
custom_install_task_spec()
,
install_task_spec()
,
rev_dep_check_tasks_df()
,
revdep_check_task_spec()
,
source_check_tasks_df()
,
task_spec()
Create a custom install task
custom_install_task_spec(...)
custom_install_task_spec(...)
... |
Arguments passed on to
|
Other tasks:
check_task_spec()
,
checked-task-df
,
install_task_spec()
,
rev_dep_check_tasks_df()
,
revdep_check_task_spec()
,
source_check_tasks_df()
,
task_spec()
Create a task to install a package and dependencies
install_task_spec(type = getOption("pkgType"), INSTALL_opts = NULL, ...)
install_task_spec(type = getOption("pkgType"), INSTALL_opts = NULL, ...)
type |
character, indicating the type of package to download and
install. Will be |
INSTALL_opts |
an optional character vector of additional option(s) to be passed to
Can also be a named list of character vectors to be used as additional options, with names the respective package names. |
... |
Additional parameters passed to |
Other tasks:
check_task_spec()
,
checked-task-df
,
custom_install_task_spec()
,
rev_dep_check_tasks_df()
,
revdep_check_task_spec()
,
source_check_tasks_df()
,
task_spec()
Instantiate a check design from a path or directory.
new_check_design(...) new_rev_dep_check_design(x, ...)
new_check_design(...) new_rev_dep_check_design(x, ...)
... |
Additional arguments passed to |
x |
A file path, passed to |
Other checks:
check_design
,
check_dev_rev_deps()
,
check_dir()
,
check_pkgs()
,
check_rev_deps()
Other checks:
check_design
,
check_dev_rev_deps()
,
check_dir()
,
check_pkgs()
,
check_rev_deps()
Internally used, package-specific options. All options will prioritize R options() values, and fall back to environment variables if undefined. If neither the option nor the environment variable is set, a default value is used.
Option values specific to checked
can be
accessed by passing the package name to env
.
options::opts(env = "checked") options::opt(x, default, env = "checked")
tty refresh interval when reporting results in milliseconds
0.1
checked.tty_tick_interval
R_CHECKED_TTY_TICK_INTERVAL (evaluated if possible, raw string otherwise)
character vector indicating whether R error should be thrown when issues are discovered when generating results. "never" means that no errors are thrown. If "issues" then errors are emitted only on issues, whereas "potential issues" stands for error on both issues and potential issues.
"never"
checked.results_error_on
R_CHECKED_RESULTS_ERROR_ON (evaluated if possible, raw string otherwise)
character vector indicating which packages should be included in the results. "all" means that all packages are kept. If "issues" then only packages with issues identified, whereas "potential_issues" stands for keeping packages with both "issues" and "potential_issues".
"all"
checked.results_keep
R_CHECKED_RESULTS_KEEP (evaluated if possible, raw string otherwise)
logical
indicating whether output directory should be unlinked before
running checks. If FALSE
, an attempt will me made to restore previous
progress from the same output
NA
checked.restore
R_CHECKED_RESTORE (evaluated if possible, raw string otherwise)
named character
vector of environment variables to use during R CMD check.
c(`_R_CHECK_FORCE_SUGGESTS_` = FALSE, `_R_CHECK_RD_XREFS_` = FALSE, `_R_CHECK_SYSTEM_CLOCK_` = FALSE, `_R_CHECK_SUGGESTS_ONLY_` = TRUE)
checked.check_envvars
R_CHECKED_CHECK_ENVVARS (evaluated if possible, raw string otherwise)
character
vector of args passed to the R CMD build.
c("--no-build-vignettes", "--no-manual")
checked.check_build_args
R_CHECKED_CHECK_BUILD_ARGS (space-separated R CMD build flags)
character
vector of args passed to the R CMD check.
c("--timings", "--ignore-vignettes", "--no-manual")
checked.check_args
R_CHECKED_CHECK_ARGS (space-separated R CMD check flags)
options getOption Sys.setenv Sys.getenv
Other documentation:
options_params
Checked Options
results_error_on |
character vector indicating whether R error should be thrown when issues
are discovered when generating results. "never" means that no errors
are thrown. If "issues" then errors are emitted only on issues, whereas
"potential issues" stands for error on both issues and potential issues. (Defaults to |
check_args |
|
results_keep |
character vector indicating which packages should be included in the results.
"all" means that all packages are kept. If "issues" then only packages
with issues identified, whereas "potential_issues" stands for keeping
packages with both "issues" and "potential_issues". (Defaults to |
check_envvars |
named |
tty_tick_interval |
tty refresh interval when reporting results in milliseconds (Defaults to |
check_build_args |
|
restore |
|
Other documentation:
options()
Create package specification list which consists of all the details required to identify and acquire source of the package.
package_spec(name = NULL, repos = NULL) package_spec_source(path = NULL, ...) package_spec_archive_source(path = NULL, ...)
package_spec(name = NULL, repos = NULL) package_spec_source(path = NULL, ...) package_spec_archive_source(path = NULL, ...)
name |
name of the package. |
repos |
repository where package with given name should identified. |
path |
path to the source of the package (either bundled or not). URLs are acceptable. |
... |
parameters passed to downstream constructors |
Print checked results
## S3 method for class 'checked_results' print(x, ...) ## S3 method for class 'checked_results_check_task_spec' print(x, keep = options::opt("results_keep"), ...) ## S3 method for class 'checked_results_revdep_check_task_spec' print(x, ...)
## S3 method for class 'checked_results' print(x, ...) ## S3 method for class 'checked_results_check_task_spec' print(x, keep = options::opt("results_keep"), ...) ## S3 method for class 'checked_results_revdep_check_task_spec' print(x, ...)
x |
an object to be printed. |
... |
other parameters. |
keep |
character vector indicating which packages should be included in the results.
"all" means that all packages are kept. If "issues" then only packages
with issues identified, whereas "potential_issues" stands for keeping
packages with both "issues" and "potential_issues". (Defaults to |
Other results:
results()
,
results_to_file()
Reporters are used to configure how output is communicated while running
a check_design
. They range from glossy command-line tools intended for
displaying progress in an interactive R session, to line-feed logs which
may be better suited for automated execution, such as in continuous
itegration.
reporter_ansi_tty() reporter_basic_tty() reporter_default()
reporter_ansi_tty() reporter_basic_tty() reporter_default()
reporter_default()
Automatically chooses an appropriate reporter based on the calling context.
reporter_ansi_tty()
Highly dynamic output for fully capable terminals. Requires multi-line dynamic output, which may not be available in editors that that present a terminal as a web component.
reporter_basic_tty()
A line-feed reporter presenting output one line at a time, providing a reporter with minimal assumptions about terminal capabilities.
Get R CMD check results
results(x, ...) ## S3 method for class 'check_design' results(x, error_on = options::opt("results_error_on"), ...)
results(x, ...) ## S3 method for class 'check_design' results(x, error_on = options::opt("results_error_on"), ...)
x |
|
... |
other parameters. |
error_on |
character vector indicating whether R error should be thrown when issues
are discovered when generating results. "never" means that no errors
are thrown. If "issues" then errors are emitted only on issues, whereas
"potential issues" stands for error on both issues and potential issues. (Defaults to |
Other results:
print.checked_results()
,
results_to_file()
Write checked_results
object to the text file. When converting results
to text, print.checked_results
method is used.
results_to_file(results, file, keep = "all", ...)
results_to_file(results, file, keep = "all", ...)
results |
|
file |
A connection or character path. |
keep |
character vector indicating which packages should be included in the results.
"all" means that all packages are kept. If "issues" then only packages
with issues identified, whereas "potential_issues" stands for keeping
packages with both "issues" and "potential_issues". (Defaults to |
... |
other parameters. |
Other results:
print.checked_results()
,
results()
path
parameter
should point to the source of the development version of the package and
repos
should be a repository for which reverse dependencies should be
identified.Create data.frame which each row defines a package for which R CMD check
should be run. Such data.frame is a prerequisite for generating
check_design()
which orchestrates all the processes
including dependencies installation.
rev_dep_check_tasks_df( path, repos = getOption("repos"), versions = c("dev", "release"), ... )
rev_dep_check_tasks_df( path, repos = getOption("repos"), versions = c("dev", "release"), ... )
path |
path to the package source. Can be either a single source code directory or a directory containing multiple package source code directories. |
repos |
repository used to identify reverse dependencies. |
versions |
character vector indicating against which versions of the
package reverse dependency should be checked. |
... |
parameters passed to the task specs allowing to customize subprocesses. |
_tasks_df()
functions generate check task data.frame
for
all source packages specified by the path
. Therefore it accepts it to be
a vector of an arbitrary length.
The check schedule data.frame
with the following columns:
alias
: The alias of the check to run. It also serves the purpose of
providing a unique identifier and node name in the task graph.
version
: Version of the package to be checked.
package
: Object that inherits from check_task_spec()
.
Defines how package to be checked can be acquired.
custom
: Object that inherits from custom_install_task_spec()
.
Defines custom package, for instance only available from local source, that
should be installed before checking the package.
Other tasks:
check_task_spec()
,
checked-task-df
,
custom_install_task_spec()
,
install_task_spec()
,
revdep_check_task_spec()
,
source_check_tasks_df()
,
task_spec()
Create a task to run reverse dependency checks
revdep_check_task_spec(revdep, ...)
revdep_check_task_spec(revdep, ...)
revdep |
character indicating whether the task specification describes check associated with the development (new) or release (old) version of the for which reverse dependency check is run. |
... |
Additional parameters passed to |
Other tasks:
check_task_spec()
,
checked-task-df
,
custom_install_task_spec()
,
install_task_spec()
,
rev_dep_check_tasks_df()
,
source_check_tasks_df()
,
task_spec()
R CMD check
srun()
provides a generic, and is the central interface for executing
check_design
s. If a path is provided, a new reverse dependency check
plan is generated from the source code path. Otherwise a plan can be
built separately and executed using run()
.
run(design, ..., reporter = reporter_default())
run(design, ..., reporter = reporter_default())
design |
|
... |
Additional arguments passed to |
reporter |
A reporter to provide progress updates. Will default to the most expressive command-line reporter given your terminal capabilities. |
Create data.frame which each row defines a package for which R CMD check
should be run. Such data.frame is a prerequisite for generating
check_design()
which orchestrates all the processes
including dependencies installation.
source_check_tasks_df(path, ...)
source_check_tasks_df(path, ...)
path |
path to the package source. Can be either a single source code directory or a directory containing multiple package source code directories. |
... |
parameters passed to the task specs allowing to customize subprocesses. |
_tasks_df()
functions generate check task data.frame
for
all source packages specified by the path
. Therefore it accepts it to be
a vector of an arbitrary length.
The check schedule data.frame
with the following columns:
alias
: The alias of the check to run. It also serves the purpose of
providing a unique identifier and node name in the task graph.
version
: Version of the package to be checked.
package
: Object that inherits from check_task_spec()
.
Defines how package to be checked can be acquired.
custom
: Object that inherits from custom_install_task_spec()
.
Defines custom package, for instance only available from local source, that
should be installed before checking the package.
Other tasks:
check_task_spec()
,
checked-task-df
,
custom_install_task_spec()
,
install_task_spec()
,
rev_dep_check_tasks_df()
,
revdep_check_task_spec()
,
task_spec()
Create task specification list which consists of all the details required to run specific task.
task_spec( alias = NULL, package_spec = NULL, env = options::opt("check_envvars") )
task_spec( alias = NULL, package_spec = NULL, env = options::opt("check_envvars") )
alias |
task alias which also serves as unique identifier of the task. |
package_spec |
|
env |
environmental variables to be set in separate process running specific task. |
Other tasks:
check_task_spec()
,
checked-task-df
,
custom_install_task_spec()
,
install_task_spec()
,
rev_dep_check_tasks_df()
,
revdep_check_task_spec()
,
source_check_tasks_df()