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

Opt users into using PPM when using default repos on Positron #1963

Open
juliasilge opened this issue Aug 6, 2024 · 3 comments
Open

Opt users into using PPM when using default repos on Positron #1963

juliasilge opened this issue Aug 6, 2024 · 3 comments

Comments

@juliasilge
Copy link
Member

We've gotten reports where this code opting users into PPM is not quite working on Positron:

renv/R/lockfile.R

Lines 52 to 58 in 8573b0d

isdefault <-
identical(repos, list(CRAN = "@CRAN@")) ||
identical(repos, rstudio)
if (isdefault) {
repos[["CRAN"]] <- config$ppm.url()
}

What we see in Positron for repos is this:

getOption("repos")
#>                        CRAN 
#> "https://cran.rstudio.com/"

Created on 2024-08-06 with reprex v2.1.1

I think it doesn't have the attribute that RStudio adds on? We could add a "Positron" attribute to repos if that helps here.

I do want to note that on running renv::diagnostics(), the user in Positron saw this instead:

 $ repos                               : Named chr "https://cloud.r-project.org"
  ..- attr(*, "names")= chr "CRAN"

As a workaround for now, folks can manually set their repos:

options(repos = c(P3M = "https://packagemanager.posit.co/cran/latest"))
@kevinushey
Copy link
Collaborator

Having an attribute on the repos option set by Positron would definitely help. The idea here being, renv only wants to override the repositories to use P3M if it appears the repositories are the "default" value for the session; if the user has explicitly set their own custom repositories, then renv tries to leave it alone.

@DavisVaughan
Copy link

Random thought that maybe it would be best to choose an agnostic name for the attribute like IDE <- TRUE, or IDE <- "RStudio" / "Positron". Or even default <- TRUE

@juliasilge
Copy link
Member Author

As of Positron 2024.09.0 build 27, this is new IDE attribute is now available:

getOption("repos")
#>                        CRAN 
#> "https://cran.rstudio.com/" 
#> attr(,"IDE")
#> [1] TRUE

Created on 2024-09-11 with reprex v2.1.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants