Commit a991e89
authored
Use devtools::install() instead of pak (#13643)
Closes #11875
Closes #1733
@:r-pkg-development
When working in an R package, the *R: Install R Package and Restart R*
gesture now defaults to [`devtools::install(build =
FALSE)`](https://devtools.r-lib.org/reference/install.html), instead of
`pak::local_install(upgrade = FALSE)`. The rationale for this switch is
laid out in the issue.
This also affects the `positron.r.localPackageInstallMethod`
configuration point, where `devtools` replaces `pak`.
### Release Notes
<!--
Optionally, replace `N/A` with text to be included in the next release
notes.
The `N/A` bullets are ignored. If you refer to one or more Positron
issues,
these issues are used to collect information about the feature or
bugfix, such
as the relevant language pack as determined by Github labels of type
`lang: `.
The note will automatically be tagged with the language.
These notes are typically filled by the Positron team. If you are an
external
contributor, you may ignore this section.
-->
#### New Features
- *R: Install R Package and Restart R* now defaults to
`devtools::install(build = FALSE)`, instead of
`pak::local_install(upgrade = FALSE)`. The values of the
`positron.r.localPackageInstallMethod` setting can now be `"devtools"`
or `"base"`.
#### Bug Fixes
- N/A
### Validation Steps
* Open a workspace in Positron that is also an R package.
* Make sure you've got devtools >= 2.5.2.
* Make sure you don't have `positron.r.localPackageInstallMethod`
configured in `settings.json`.
* Do *R: Install R Package and Restart R*. In the terminal that fulfills
this, you should see invocation of `devtools::install(build = FALSE)`:
```
Executing task: '/Library/Frameworks/R.framework/Versions/4.5-arm64/Resources/bin/R' --quiet --no-restore --no-save -e 'devtools::install(build = FALSE)'
```
### For discussion:
Should we put a minimum version on devtools, in order to get new,
desirable behaviour of `devtools::install()`? It seems too strong a
requirement and yet people will not have the experience we really want
for them if they have older devtools.
It feels like the "devtools vs. base" question is bigger than just how
to wire up *R: Install R Package and Restart R*. Are we going to deal
with this more holistically? Recall that RStudio has a project-level
setting for "Use devtools package functions if available".
Here are all the package dev commands:
| Command | Display name | Backed by |
|---|---|---|
| `r.packageLoad` | Load R Package | `devtools::load_all()` — hardcoded
|
| `r.packageBuild` | Build R Package | `devtools::build()` — hardcoded |
| `r.packageInstall` | Install R Package and Restart R |
`devtools::install(build = FALSE)` or `R CMD INSTALL` — configurable
(this PR) |
| `r.packageTest` | Test R Package in Terminal | `devtools::test()` —
hardcoded (task) |
| `r.packageTestExplorer` | Test R Package in Test Explorer | runs
testthat via test explorer, which also uses devtools/testthat |
| `r.packageCheck` | Check R Package | `devtools::check()` — hardcoded
(task) |
| `r.packageDocument` | Document R Package | `devtools::document()` —
hardcoded |
Are we going to offer devtools vs base for others? In the abstract, it
feels like we should. But here in reality it doesn't really make sense.
Making this sort of thing clearcut and easier is precisely why devtools
& friends exist! Only a couple of these even have a clearcut definition
for a base implementation.
Related: the idea of making it possible for an advanced and opinionated
user to take full control of these gestures: #3242.1 parent 3ffd594 commit a991e89
4 files changed
Lines changed: 8 additions & 8 deletions
File tree
- extensions/positron-r
- src
- test/e2e/tests/r-pkg-development
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
244 | 244 | | |
245 | 245 | | |
246 | 246 | | |
247 | | - | |
248 | | - | |
| 247 | + | |
| 248 | + | |
249 | 249 | | |
250 | 250 | | |
251 | 251 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
82 | 82 | | |
83 | 83 | | |
84 | 84 | | |
85 | | - | |
| 85 | + | |
86 | 86 | | |
87 | 87 | | |
88 | 88 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
31 | | - | |
| 31 | + | |
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
| |||
43 | 43 | | |
44 | 44 | | |
45 | 45 | | |
46 | | - | |
47 | | - | |
| 46 | + | |
| 47 | + | |
48 | 48 | | |
49 | 49 | | |
50 | 50 | | |
| |||
56 | 56 | | |
57 | 57 | | |
58 | 58 | | |
59 | | - | |
| 59 | + | |
60 | 60 | | |
61 | 61 | | |
62 | 62 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
83 | 83 | | |
84 | 84 | | |
85 | 85 | | |
86 | | - | |
| 86 | + | |
87 | 87 | | |
88 | 88 | | |
89 | 89 | | |
0 commit comments