rstudio / bundle

Prepare objects for serialization with a consistent interface
https://rstudio.github.io/bundle/
Other
27 stars 4 forks source link

Consider storing package version in bundle #23

Closed juliasilge closed 2 years ago

juliasilge commented 2 years ago

As of today, using bundle() stores the package version via utils::packageVersion(). This does get us some versioning information but is not up to the level of renv.

juliasilge commented 2 years ago

I am currently thinking that we should encourage users to manage package versions with renv or to use vetiver (which will handle this for users). I think that utils::packageVersion() is not really good enough but putting renv handling here seems out of scope to me.

What do you think @simonpcouch?

simonpcouch commented 2 years ago

I agree with your thinking!

What are your thoughts on whether including utils::packageVersion() checking is still worth it, given that it's not good enough? I'm 50/50β€”it's additional complexity/scope to maintain, but also seems like it may indeed help troubleshooting more obvious environment issues.

juliasilge commented 2 years ago

I currently lean toward taking it out, because I think it's not thorough enough for most use cases. For example, for a tidymodels workflow, we don't only need to keep track of the version of workflows: https://github.com/rstudio/bundle/blob/56c49e493c3604246cade523782f7237133c0847/R/bundle_workflows.R#L67 But we also need to keep track of all the packages wrapped up in the workflow.

This functionality is already in vetiver and my inclination is that it would be unwise to duplicate that functionality.

I do think we should mention this in documentation somewhere and say basically: "sometimes software changes -- to check you are using the same versions when predicting as when you trained, use vetiver or renv".

Is that convincing to you? πŸ˜„ Do you have an opinion on where best to put that documentation?

simonpcouch commented 2 years ago

I hear you! I think getting rid of the package versioning is a solid move, and a short bit of documentation on how to ensure one is using the right versions is a good idea! This could maybe live near the end of the return_bundle template?

https://github.com/rstudio/bundle/blob/5d3c021/man-roxygen/return_bundle.R#L28

juliasilge commented 2 years ago

Yeah, that sounds great to me. πŸ‘