Skip to content

usage of system.file() #1271

Closed
Closed
@topepo

Description

@topepo

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, so system.file() (which uses find.package(), and tries to look up the package's DESCRIPTION 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions