Skip to content

cran: Improve listing of R packages

Previously, the lister was relying on the use of the CRANtools R module but it has the drawback to only list the latest version of each registered package in the CRAN registry.

In order to get all possible versions for each CRAN package, prefer to exploit the content of the weekly dump of the CRAN database in RDS format (swh/meta#1709 (comment 117670)).

To read the content of the RDS file from Python, the rpy2 package is used as it has the advantage to be packaged in debian.

Related to swh/meta#1709 (closed).

My first take on this was to rely on the use of the pyreadr Python package (see anlambert/swh-lister@94eb8e1e) as it is faster and does not depend on the R runtime. But as it is not packaged in debian and we are still building debian packages for swh-lister, I fall back using the rpy2 package.

I checked the lister works in docker (requires swh-environment!277 (merged)) and swh-lister debian packages for unstable and buster can still be built, all good !

Edited by Antoine Lambert

Merge request reports