Skip to content
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

Project Wizard: create renv::init command #3127

Closed
Tracked by #2819
sharon-wang opened this issue May 13, 2024 · 7 comments
Closed
Tracked by #2819

Project Wizard: create renv::init command #3127

sharon-wang opened this issue May 13, 2024 · 7 comments
Assignees
Labels
area: project wizard Issues related to New Project Wizard category. lang: r

Comments

@sharon-wang
Copy link
Member

sharon-wang commented May 13, 2024

Background

A user can opt to use renv for their new R Project to create a reproducible environment.

Image

Implementation

We'll need to add a command to the r extension which will run renv::init for the new project directory.

Questions

  • do we need to install/bundle renv with the extension?
  • how to best indicate who/why you should use renv and appropriately recommend or dissuade the user from using the option? What's some good verbiage here?
  • rename "Additional" to "Advanced"

PR

@sharon-wang sharon-wang added this to the Public Beta 2024 Q2 milestone May 13, 2024
@sharon-wang sharon-wang added area: project wizard Issues related to New Project Wizard category. lang: r labels May 13, 2024
@juliasilge
Copy link
Contributor

I would look at how we use checkInstalled() in the R extension for renv, rather than install it or bundle it.

@jennybc
Copy link
Member

jennybc commented Jun 3, 2024

From working on #2070, I predict that renv is going to gain a few changes that are favorable for Positron (rstudio/renv#1915). So I think we should either recommend or require that the renv version be greater than or equal to this not-yet-released version I'm referring to.

I.e. I don't think we should just roll with a local renv version without assessing how up-to-date it is. Luckily the checkInstalled() function that @juliasilge mentions above supports a minimum version, although the message it gives for insufficient version isn't great (which is #1957).

@timtmok
Copy link
Contributor

timtmok commented Jun 4, 2024

@juliasilge Sharon's latest change is going to hide this checkbox based on a WIP flag in the preferences. The usage of checkInstalled() makes sense to ensure we have renv at the correct version.

@jennybc Is the change to renv expected to be merged and released soon?

I think this is what would occur when a user enables renv usage:

  1. When the new project is initializing, add a the renv::init task to the task queue
  2. During renv::init, ensure the interpreter is started and run checkInstalled() with a package version
  3. If renv is not installed (or incorrect version is installed), prompt to install
  4. Run renv::init

For now, the section can be renamed from Additional Configuration to something like Advanced Configuration.

@jennybc
Copy link
Member

jennybc commented Jun 4, 2024

Is the change to renv expected to be merged and released soon?

For reasons independent of this issue, yes, we want it merged and released before public beta. That effort is ongoing, so I can't guarantee it, but that is certainly the intent and I think it's doable.

@timtmok
Copy link
Contributor

timtmok commented Jun 7, 2024

I'll open another issue for changing the required renv version that can be worked on once it has released a new version.

@timtmok
Copy link
Contributor

timtmok commented Jun 7, 2024

#3439

@jonvanausdeln
Copy link
Contributor

Verified Fixed

Positron Version(s) : 2024.06.0-795
OS Version(s) : Windows 11

Test scenario(s)

Created new project with renv and initialized as expected. Also tested with no renv installed, and it asked to install and intialized as expected.

Link(s) to TestRail test cases run or created:

Test Rail Case 633084

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 11, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area: project wizard Issues related to New Project Wizard category. lang: r
Projects
None yet
Development

No branches or pull requests

5 participants