Description
When using devtools::build()
, we started to get a lot of warning such as
Warning in read.dcf(file.path(p, "DESCRIPTION"), c("Package", "Version")) :
cannot open compressed file '/private/var/folders/jv/240yf6_94xbcxw2vg7v060pw0000gn/T/RtmpkLpPFx/Rinsta3b438f97f39/parsnip/DESCRIPTION', probable reason 'No such file or directory'
One of our colleagues helped us figure it out.
Looks like it's possibly coming from
parsnip:::make_engine_list()
, which gets called while building documentation?
https://github.com/tidymodels/parsnip/blob/main/R/engine_docs.R#L211 -- I think the problem comes from here; it's getting called at a time when the package isn't completely built yet, sosystem.file()
(which usesfind.package()
, and tries to look up the package'sDESCRIPTION
file) isn't actually ready yet.
There are two places that cause the issue. We read the model list from a delimited file in inst
via
utils::read.delim(system.file("models.tsv", package = "parsnip"))
Second, to get the engine list, we use
meta_loc <- system.file("Meta/Rd.rds", package = pkg)
For the first issue, we can substitute with an internal tibble. The "models.tsv" file can be removed, but we will wait to do that in a future version (but you should avoid using it immediately).
For the Rd.rds
file, we can try to read it (silently) and return character(0)
if it is unavailable.