ThinkR-open / dockerfiler

Easy Dockerfile Creation from R
https://thinkr-open.github.io/dockerfiler/
Other
169 stars 25 forks source link

dock_from_renv cant deal with github packages #24

Closed VincentGuyader closed 2 years ago

VincentGuyader commented 2 years ago

Error: Could not locate package 'checkhelper'

we need to make a tryCatch around

  pkg_sysreqs <- lapply(pkg_os, function(x) do.call(pak::pkg_system_requirements, 
    x))
VincentGuyader commented 2 years ago

this is the reprex :

from dock_from_renv


pkg_os <- list(list(package = "BH", os = "ubuntu", os_release = "20.04"), 
     list(package = "golem", os = "ubuntu", os_release = "20.04"),
     list(package = "checkhelper", os = "ubuntu", os_release = "20.04"),
     list(package = "zip", os = "ubuntu", os_release = "20.04"))

pkg_sysreqs <- lapply(pkg_os, function(x) do.call(pak::pkg_system_requirements, x))

@ColinFay I tried to use {attempt} (map_try_catch ) without any succes to avoid to depend to {purrr::possibly}

but this IS the PR I will make

psr <- purrr::possibly(pak::pkg_system_requirements,otherwise = character(0))
pkg_sysreqs <- lapply(pkg_os, function(x) do.call(psr, x))

feel free to adapt ( TryCatch, attempt::xxx ?)