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
Vignette for Sharing and Version Control #74
Comments
The answer to that question specifically: after the collaborator launches R,
|
@kevinushey doesn't that require the user to commit the .Rprofile and renv/activate.R files in their Git repo? I was under the impression that user's were only expected to commit the lock file, in which case the bootstrapping wouldn't occur. |
There's two possible workflows we could advertise here:
Right now (1) is what we're doing (and it's what Packrat has done and has encouraged in the past), but I'm open to whether we should consider changing that. |
I'm in favor of 2. In general I think having a single config file and encouraging explicit calls instead of side-effects is preferable in the long term. I think this also translates more easily when a user tries to reason about how I think that's a bit closer to python use of |
Having a single file that then requires a command to activate sounds like the right thing to do from my perspective. This can be made 'automagic' in different contexts in different ways explicitly - for example, repo2docker can automatically run the appropriate calls if it finds this file (jupyterhub/repo2docker#660). This is what we currently do for DESCRIPTION or install.R files, for example. Other IDEs / Environments might offer to do the same in a way that's useful for them. Separating 'these are my dependencies, see them' from 'activate all my dependencies now, so I can use them' as distinct user actions will make it much easier for other tools to integrate with it. |
One thing I hate about Packrat is that it modifies .gitignore in root folder. Renv does this in a bit nicer way since it has "it's own" .gitignore in renv folder, but I still believe that handling git is out of scope of this package, since git is a separate system and should be in control of a user. So what I want to say here is that please do not overwrite user's .gitignore no matter what way you choose to advertise. :) |
If we were to go the
The main thing I'm worried about is that users might expect that an R session launched in an |
I am in favor of 1 or 2. I think it is best to not do everything automagically for the user. It seems like a very few step to just The other solution to commit all is still possible to have an activation of the project renv automatically. The two way to advertise seems the good one, with a default mode of only commiting |
One big downside to these approaches is that we'd have to start modifying the I would rather optimize for the general user experience rather than ease-of-use with tools, since in general tool-builders are motivated and able to work around some of these sorts of things. In this case, one could just invoke R as On the balance, I still lean towards including |
Here's my thoughts: if we're going to automatically activate projects by using a project So, on the balance, I think the right approach is this:
I think the automatic It's also worth saying that users are already familiar with this workflow through Packrat as well, so it will not feel that foreign. Ultimately, it's just two files in the top level of the project directory: the |
I completely understand this. However, I wanted to share some last thoughts on automatic activation with One drawback / edge case that I can think of (but could be pretty common) is if a user already manage some profile stuff in it
I find it to be an important drawback of Another edge case is if What I mean here is that the automatic activation based on .Rprofile needs at least some detailed explanation so that users know what it implies and how to configure there R environment. There is obviously some solution like load the user's profile in the project's profile if it exists but still you need to master all this to have the correct configuration. However, I think there may be some way of doing automatic activation differently. Something that you would but in you .Rprofile, like the user one as any other global option, that would say : I want automatic activation for my renv projects. It would know if a To illustrate the type of custom mechanism, it makes me think of the Just thoughts and ideas I add already with packrat way of doing. This is now or never to share them 😉 |
Thanks @cderv -- I appreciate your insight! The activation script used by renv/inst/resources/activate.R Lines 25 to 31 in 9734e57
It's worth noting: if you're using your user In theory, this could be alleviated as long as you're only setting R options and not explicitly loading the packages, but there's no guarantee that all users are doing this. One workaround would be to ensure that There are also issues with multi-library configurations -- e.g. if you load a package from the user library that depends on My biggest worry is that users could get confused in collaborative workflows. Suppose you're working with an |
One other challenge: different projects might use different versions of
I believe this is possible, but could get messy. |
It'd be good to elaborate what needs to be tracked in Git, and how cloning a renv project should work for a collaborator. For example:
What would happen if I'm using the renv packages using git and a coworker of me clones that repo opens the project and installs a brand ne packages. Is it automatically installed in the renv() folder despite the fact he hasn't installed the renv packages and hasn't run the init() function?
The text was updated successfully, but these errors were encountered: