Branching and Release Model
pizzarr uses three branch types tied to its two distribution tiers (CRAN and r-universe).
-
develop— active development. All pull requests should targetdevelop, notmain. DESCRIPTION carries a.9000suffix (e.g.,0.2.0.9000) and Cargo.toml uses a-devpre-release tag (0.2.0-dev). -
release/X.Y.Z— release candidate. Cut fromdevelopwhen ready to ship. The.9000/-devsuffixes are dropped,NEWS.mdis finalized, and the CRAN tarball is built withbash tools/cran-build.sh. This branch is PR’d tomain. -
main— release-only and the GitHub default branch. Always matches the latest version accepted by CRAN. r-universe auto-builds frommain, so the r-universe binary (which includes the compiled zarrs Rust backend) tracks the same release version as CRAN. pkgdown deploys frommain.
The release sequence:
- Development proceeds on
develop(versionX.Y.Z.9000). -
Pre-release (r-universe only): merge
developtomainand tagX.Y.Z-pre. r-universe builds binaries frommainfor testing before CRAN submission. The DESCRIPTION version isX.Y.Z(R does not support pre-release suffixes). NEWS.md carries the-prelabel. - Cut a
release/X.Y.Zbranch fromdevelop. Drop the.9000/-devsuffixes, finalizeNEWS.md, and submit to CRAN viabash tools/cran-build.sh. - Open a PR from
release/X.Y.Ztomain. Do not merge until CRAN has accepted the package. - After CRAN acceptance, merge the PR to
main. r-universe picks up the new commit and builds binaries with the zarrs backend. pkgdown rebuilds. - Merge
mainback intodevelopand bump the version to the nextX.Y.Z.9000.
Both CRAN and r-universe serve the same version number. The difference is the build: CRAN gets pure R (no Rust), r-universe gets the zarrs backend. Users can check which tier they have with pizzarr_compiled_features().
Development Setup
# make sure you are on the develop branch
setwd("path/to/pizzarr")
install.packages("devtools")
devtools::install()
devtools::load_all()Build and Test Cycles
pizzarr has two build tiers that affect how you develop and test locally.
CRAN tier (pure R)
If you are working on R-side logic (indexers, stores, codecs, R6 classes) and do not need the zarrs backend, this is the faster cycle:
devtools::load_all()
devtools::test()
devtools::check()Tests run single-threaded (Config/testthat/parallel: false in DESCRIPTION). All zarrs-specific tests skip automatically when the Rust library is absent — they guard on .pizzarr_env$zarrs_available.
To produce a CRAN-ready source tarball that strips src/, configure, and SystemRequirements:
The resulting .tar.gz passes R CMD check without a Rust toolchain.
r-universe tier (zarrs backend)
The r-universe build compiles the zarrs Rust crate via extendr. You need rustc >= 1.91 with the GNU target on Windows:
After modifying any #[extendr] function in src/rust/src/lib.rs, regenerate the R wrappers:
rextendr::document()This rebuilds the Rust library and regenerates R/extendr-wrappers.R. Never edit that file by hand. Then run the standard cycle:
devtools::load_all()
devtools::test()
devtools::check()devtools::check() will emit a NOTE about downloading Rust crates — that is expected and is not a problem for r-universe builds. See RUST-STYLE.md for Rust conventions, module layout, and build pipeline details.
Building Documentation
devtools::document()
pkgdown::build_site()Coding Conventions
- Style: snake_case everywhere (functions, methods, variables). 2-space indent.
-
Errors:
stop("ErrorName(details)")— mimics Python Zarr error names. No rlang. -
Warnings/info:
warning()andmessage()from base R. -
Assertions: direct
if (...) stop()— no assertion library. -
R6 docs: roxygen2 with
@title,@docType class,@format [R6::R6Class]. Seer6-roxygen-convention.mdfor the full style guide. -
Tests: testthat 3e with
test_that("description", { ... }).
Resources
- Discussion of Zarr in R
-
blosc
- Note:
pizzarrhas an optional dependency onbloscfor Blosc (de)compression.
- Note:
- R package development
- Zarr implementation
