Closed RichardJActon closed 2 weeks ago
@philipp-baumann when you'll be have some spare time could you take a look at the PR? It's looking good for me
This is really looking good, many thanks @RichardJActon !!
I will be testing more extensively this weekend to give a more in-depth review, let me know if you need more time to add other stuff or if this is "reviewable" :)
Thanks @b-rodrigues I think it is reviewable as is.
In playing with it a little myself I wonder if it might be a good idea to duplicate the arguments from rix
explicitly rather than passing them with ...
as I find myself missing the auto-completion that you get with explicit arguments this doesn't seem to work with dots even when using inherit dot params in the documentation (at least in Rstudio).
It may be worth taking a look at {renv}'s tests to see what they do, but maybe I should include some more 'real world' renv.lock
files to check for any unanticipated edge cases my artificial examples haven't covered.
Should have some time this weekend to make tweaks, will likely be busier next weekend and week of the 4th
maybe I should include some more 'real world'
renv.lock
files to check for any unanticipated edge cases my artificial examples haven't covered.
Yes, this would be great
In playing with it a little myself I wonder if it might be a good idea to duplicate the arguments from
rix
explicitly rather than passing them with...
I think that we should at least provide the project_path
as being the same folder containing the renv.lock
file by default, but I would prefer to keep the ...
otherwise (sorry about autocompletion :smile_cat: )
Also, we should not include renv
in the resulting default.nix
as it wouldn't be needed, no?
fuuuuuuu
I messed up, sorry! Didn't want to close this, just wanted to add a change...
@RichardJActon sorry, can you re-open the PR
All your changes are in this branch by the way:
https://github.com/ropensci/rix/tree/add_renv2nix
because I think that I somehow overwrote the history of your main branch :fearful: :exploding_head:
Partially addresses #5, this implements a "fast" inexact conversion from renv to nix environment description. It does NOT capture the exact package versions, just the R version and the list of packages in
renv.lock
, nor does it differentiate primary from transitive dependencies inrenv.lock
it simply lists all dependencies.This PR adds four functions:
renv2nix()
the main addition, given the path to anrenv.lock
file this function extracts the list of packages used, including handling packages from github/gitlab remotes, and makes a call torix()
with this information.renv_lock_r_ver()
a utility function for getting the R version recorded in arenv.lock
read_renv_lock()
reads anrenv.lock
file with jsonliterenv_remote_pkg()
extracts remote information needed forgit_pkgs
fromrenv.lock
package entriesTODO