ropensci / rix

Reproducible Data Science environments for R with Nix
https://docs.ropensci.org/rix/
GNU General Public License v3.0
181 stars 15 forks source link

helper functions to bootstrap from renv.lock #349

Closed RichardJActon closed 2 weeks ago

RichardJActon commented 1 month ago

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 in renv.lock it simply lists all dependencies.

This PR adds four functions:

TODO

b-rodrigues commented 4 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

b-rodrigues commented 3 weeks ago

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" :)

RichardJActon commented 3 weeks ago

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

b-rodrigues commented 3 weeks ago

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

b-rodrigues commented 2 weeks ago

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: )

b-rodrigues commented 2 weeks ago

Also, we should not include renv in the resulting default.nix as it wouldn't be needed, no?

b-rodrigues commented 2 weeks ago

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

b-rodrigues commented 2 weeks ago

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: