← Back to all sparks
P

pkglite

ANALYTICS
Velocity0.0

Compact Package Representations. Contribute to Merck/pkglite development by creating an account on GitHub.

pkglite's whole job is knowing which files in an R package are text — and it keeps getting better at guessing.

r-packagespharma-submissionspackagingfile-handlingreproducibility
Current state
pkglite packs an R package into a single plain-text file and unpacks it again, the mechanism pharmaceutical submissions use to move source through systems that accept text but not archives. The API settled at 0.2.0 with file specification templates, `merge()` and `prune()`. Every release since has improved the same thing: the dictionary that decides whether a file is text or binary, most recently rebuilt from the file extensions found across 21,369 CRAN packages.
Where it's heading
The failure mode this package cares about is silent — misclassify a binary file as text and the round trip corrupts it, misclassify text as binary and it bloats or drops. So the work is empirical rather than architectural: mine real packages for what extensions actually appear, then widen coverage where specific ecosystems break the pattern. Stan interfaces via rstan brought `src/Makevars` and `src/Makefile` handling; machine learning frameworks brought their own binary formats. Dependencies have gone the other way, with cli removed and replaced by internal equivalents.
Prediction
Expect the next substantive release to widen file specification coverage again for whatever package family the maintainers find breaking the default discovery, since that has been the content of every non-maintenance release for four years.

Recent moves

  1. 5mo ago

    Maintainer email and CI workflow updates

    Housekeeping only — maintainer email and GitHub Actions workflow versions. The first release in over a year, and it contains no functional change.

    View source ↗
  2. 1y ago

    Handles Stan-interfacing packages and ML binary formats

    Widens `file_src()` coverage so packages with `src/Makevars` or `src/Makefile` — the rstan-interfacing pattern — get the right file collection, and expands the binary extension dictionary for formats common in machine learning frameworks. Targeted fixes for two package families whose layouts defeated the defaults.

    View source ↗
  3. 1y ago

    Extension dictionary rebuilt from 21,369 CRAN packages

    Rebuilds the text and binary extension dictionary from a survey of the entire CRAN corpus rather than from accumulated bug reports. The right way to solve a classification problem whose failures are silent — measure what actually exists instead of waiting for each miss to surface.

    View source ↗
  4. 2y ago

    Test helpers moved to helper.R

    Relocates test-file-scoped logic into `tests/testthat/helper.R` to follow testthat conventions. Internal tidying with no user-facing effect.

    View source ↗
  5. 3y ago

    More file types recognised; cli dependency dropped

    Adds `.stan`, `.brew` and other extensions to the dictionary, and removes the cli dependency in favour of internally tested replacements. For a package that has to run inside locked-down validated environments, shedding a dependency is worth more than the convenience it provided.

    View source ↗
  6. 5y ago

    File collections gain merge, prune, and a tests template

    The release that established the working API: a `file_tests()` specification template, `merge()` and `prune()` methods for composing and trimming file collections, and a vignette on curating them. Everything since has refined discovery rather than changed this interface.

    View source ↗