-
Notifications
You must be signed in to change notification settings - Fork 153
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Create a renv environment from a crated function #554
Comments
I've made some changes on master that should make this kind of workflow possible -- let me know if this captures what you need.
|
Thanks @kevinushey. It looks like now, with any object that inherits from function (so crate), we can do the following: fun <- carrier::crate(~styler::style_text(.x))
deps <- renv::dependencies(fun)
renv::snapshot(packages = unique(deps$Package)) Hence, I can achieve what I was after. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The R package https://github.com/r-lib/carrier can be used to create standalone functions. However, it does not manage package dependencies. For this reason, deployment of R functions in arbitrary environments (e.g. deployment of crate functions in mlflow) is not that straight-forward because the user has to manage dependencies manually. I think it would be a great addition to connect renv and carrier, creating a
renv.lockfile
from a crated function:(The API change is just a suggestion, maybe there are better ways to implement this)
Then, to execute the function anywhere, one could just
I assume most of the functionality to do this already exists in renv, but I could not find them in the exposed API.
This is similar to two existing renv issues that aim at using renv for low(er) level dependency management than an average user:
files
option torenv::snaphsot()
to indicate which files to scan for dependencies. #443I also filed an issue in r-lib/carrier at some point: r-lib/carrier#5
The text was updated successfully, but these errors were encountered: