For package developers: run the tests or R CMD check in several of the
project's environments, e.g. one for each version of R, and see the results
side by side.
pixi_check_matrix()runs them. Each environment needs the package's dependencies, and testthat and pkgload for the tests, or rcmdcheck forR CMD check.use_pixi_check_matrix()adds an environment for each version of R, with those packages, named after the version:r44for R 4.4. Withminimum = TRUE, it also adds aminimumenvironment, with the oldest versions the package'sDESCRIPTIONallows.
Usage
pixi_check_matrix(
environments = NULL,
what = c("test", "check"),
task = NULL,
parallel = FALSE,
path = NULL
)
use_pixi_check_matrix(r_versions = NULL, minimum = FALSE, path = NULL)Arguments
- environments
Optional. The environments. Defaults to all of them.
- what
"test"to run the tests withtestthat::test_local(), or"check"to runR CMD checkwithrcmdcheck::rcmdcheck().- task
Optional. A Pixi task to run instead, such as
"check". It passes if it succeeds.- parallel
If
TRUE, run in all environments at once.- path
The project. Defaults to the project of the running Pixi environment, or the working directory.
- r_versions
Versions of R, such as
"4.4". Optional withminimum = TRUE.- minimum
If
TRUE, also add aminimumenvironment; see below.
Value
pixi_check_matrix(): a data frame with a row per environment, and the columnsenvironment,r_version,ok, the counts (passed,failed,skippedandwarningsfor tests;errors,warningsandnotesforR CMD check),seconds, andoutput: what it printed.use_pixi_check_matrix(): the names of the environments, invisibly.
The minimum environment
Checks that the minimum versions in DESCRIPTION really work: R at the
version Depends asks for, and each package in Depends, Imports,
LinkingTo and Suggests at the lowest version its constraint allows
(Pixi's solve-strategy = "lowest-direct"; their own dependencies are the
newest that fit).
A package in
Depends,ImportsorLinkingTowithout a minimum gets the oldest version on conda-forge for that R, which may be much older than you meant; rpix lists them.A
Suggestswithout a minimum isn't what's tested, so it gets at least the version the project has, in itstestenvironment or else the default one. rpix lists those the project doesn't have, which get the oldest version, as do the others if those versions don't solve for that R.testthat, pkgload and rcmdcheck, which run the checks, get recent minimums, or a higher one from
DESCRIPTION.Without a minimum R in
Depends, it uses the oldest ofr_versions, or the project's R.Only versions on conda-forge (and bioconda) count, for the project's platforms. An old build's own dependencies are as conda-forge recorded them, which for old builds is sometimes looser than its
DESCRIPTION: then R refuses to load it, although Pixi installed it.
Examples
if (FALSE) { # \dontrun{
use_pixi_check_matrix(c("4.3", "4.4", "4.5"))
use_pixi_check_matrix(minimum = TRUE)
pixi_check_matrix()
pixi_check_matrix(what = "check", parallel = TRUE)
} # }