Repository navigation
Add option for r.packageInstall that does not use pak - #11431
Conversation
|
E2E Tests 🚀 |
| envVars: { ... await prepCliEnvVars() } | ||
| }, | ||
| { | ||
| useBaseR ? { |
There was a problem hiding this comment.
If we add a lot of conditional logic here for the tasks in the future, we might want to re-organize how these are set up. I think probably better to keep it as is now?
| await app.workbench.console.waitForConsoleContents('"testfun"'); | ||
| }); | ||
|
|
||
| await test.step('Install R Package with base R and Restart R', async () => { |
There was a problem hiding this comment.
This test does not actually test that the R CMD check approach is used because the text in the terminal flashes too quickly as noted above in the previous test. I think it's still worth testing that this runs without error.
|
I know this is still a draft, but I caught wind of it in my notifications and thought I'd throw this out there: this might be a good place for a more enum-like approach than a TRUE/FALSE. Basically for the reasons outlined in the link, but also that it allows the specification to be "base" or "pak" instead of "base" and "not base". |
|
@jennybc What do you think about my questions about whether to plan for this setting to only apply to |
|
I think it's fine to start with |
|
Unfortunately, changing an enum would be quite difficult in terms of not breaking how folks' have configured their settings, so we're likely to need to make a new second setting in that case. Which of these do you think is better in the long term?
I am thinking that a true boolean is probably a better move here, given the constraints. |
|
I think I was implicitly assuming the config point would be |
|
As discussed in Slack, I've pushed some ideas to discuss and will now make a few comments on what I did. |
| ); | ||
| } | ||
|
|
||
| type InstallMethod = 'pak' | 'base'; |
There was a problem hiding this comment.
We can't easily make this a true enum, i.e. read from the values declared in package.json.
But I like the idea of leaning harder into this being a enum.
|
|
||
| type InstallMethod = 'pak' | 'base'; | ||
|
|
||
| function getPackageInstallTask(installMethod: InstallMethod) { |
There was a problem hiding this comment.
Just moved the "make the task data conditionally" dance into its own little helper.
| ? data.shellArgs | ||
| : ['--quiet', '--no-restore', '--no-save', '-e', { value: data.rcode, quoting: vscode.ShellQuoting.Strong }]; |
There was a problem hiding this comment.
(Re-)unified package install task with its buddies, so that the rmarkdown render task on Windows remains the only special case.
| "r.configuration.symbols.includeAssignmentsInBlocks.description": "Controls whether assigned objects inside `{}` blocks are included as document symbols, in addition to top-level assignments. Reopen files or restart the server for the setting to take effect.", | ||
| "r.configuration.workspaceSymbols.includeCommentSections.description": "Controls whether comment sections like `# My section ---` are included as workspace symbols.", | ||
| "r.configuration.autoConvertFilePaths.description": "Automatically convert file paths when pasting files from file manager into R scripts. Converts backslashes (\\) to forward slashes (/), adds quotes, and formats multiple files as R vectors.", | ||
| "r.configuration.localPackageInstallMethod.description": "How to install the local R package project. When set to `pak`, uses `pak::local_install()`. When set to `base`, uses `R CMD INSTALL`.", |
There was a problem hiding this comment.
This name feels more like an enum (vs. a boolean). Also tweaked the description.
Signed-off-by: Jennifer (Jenny) Bryan <[email protected]>
|
Thanks so much! |

Addresses #2955.
This PR adds a new setting
positron.r.localPackageInstallMethodthat allows users to opt out of using pak for local package installation. When switched from the default, the command usesR CMD INSTALL --preclean --no-multiarch --with-keep.source .instead ofpak::local_install(upgrade = FALSE).The setting defaults to using pak, but users who have experienced issues with pak can now switch to the base R approach.
Release Notes
New Features
positron.r.localPackageInstallMethodsetting to use base R commands for package development tasks. When changed from the default, usesR CMD INSTALLinstead of pak for installing a local R package project (Switch 'r.packageInstall' command/task in R extension to not use pak #2955)Bug Fixes
QA Notes
@:r-pkg-development
@:ark
positron.r.localPackageInstallMethodto"base"in settingsR CMD INSTALLoutput in terminal