ThinkR-open / dockerfiler

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

renv:::lockfile is going to be removed in a future version #56

Closed kevinushey closed 8 months ago

kevinushey commented 1 year ago

Right now, dockerfiler is using this unexported function:

https://github.com/ThinkR-open/dockerfiler/blob/e40f804e9728afb9bb5a8c52d965c9ac4a8fd58a/R/dock_from_renv.R#L59

However, we're planning to remove this in a future renv release, and instead provide some helper functions of the form lockfile_* to interact with a lockfile. We'll plan to keep this function available for dockerfiler, but would dockerfiler be able to adapt to this change as well?

Note that if you want to depend on renv internals, you can also explicitly vendor renv in your project -- see https://rstudio.github.io/renv/reference/vendor.html?q=vendor#null for more details.

JosiahParry commented 1 year ago

@kevinushey am I correct in thinking that, if using a vendored version of {renv}, non-exported functions can be made available without calling from namespace?

Are there other exported ways to get a lockfile as an R object?

kevinushey commented 1 year ago

@kevinushey am I correct in thinking that, if using a vendored version of {renv}, non-exported functions can be made available without calling from namespace?

Yep, that's right.

Are there other exported ways to get a lockfile as an R object?

If you want to create a lockfile, you can use renv::snapshot(lockfile = NULL) to get the generated lockfile as an R list; alternatively, if you're using renv 1.0.0, you can use functions like lockfile_read() and lockfile_modify() to read and edit a lockfile.

JosiahParry commented 1 year ago

Great! And is there a way to generate a lockfile without 1) vendoring {renv} and 2) creating a project level package store. My understanding is no, vendor it like how its done in vetiver.

kevinushey commented 1 year ago

Do you mean, create an empty lockfile? You could do something similar with e.g.

lockfile_create(project = tempdir(), libpaths = character())

That is, create a lockfile without actually providing any library paths to use.

VincentGuyader commented 8 months ago

the use of vendor could be a good way to deal with : https://github.com/ThinkR-open/dockerfiler/issues/64 too ..

VincentGuyader commented 8 months ago

done.

I opted for the in-house version of renv. It wasn't straightforward, but it's great