Closed kbvernon closed 8 months ago
Found an issue, and I will fix it in a separate PR.
I believe I have this working, but I'm not sure what the M.O. is for doing tests.
@Ilia-Kosenkov, do you have a recommendation for how to handle missing usethis
before use_extendr()
gets called? should it just error?
use_extendr()
uses rlang::check_installed("usethis")
. However, that opens an interactive context I don't think is available for project directory creation through the RStudio GUI. Maybe I should use a combination of rlang::is_installed("usethis")
and cli::abort()
instead?
You can also use this in your function, call it before you access anything {usethis}
- related.
https://github.com/extendr/rextendr/blob/09bfebae90e679cbb3a21e9ce983c032c82e1828/R/use_extendr.R#L38
Per our Discord discussion, I added commits so that create_extendr_package()
no longer adds a temporary INDEX file to the project folder. This made the single {testthat}
test irrelevant, so I also reverted that commit.
Because we remove the INDEX file, it was suggested that we add its content to the package documentation, probably "Using Rust code in packages". Would be happy to do this, but should it be done in another PR?
You should do it in this PR, and also update NEWS.md
Package is created and opened interactively with RStudio. The infrastructure works as well. This should not be exported until the arguments are changed and handled differently.
This is because you're capturing all arguments via ...
and expecting there to be a valid value passed in. This is true when using the wizard. But it is not true when doing interactively. The highlighted lines are where the problem comes from.
Since this is not an exported function I am comfortable merging.
If you approved it and the author has no permissions to merge to this repo, it is your duty to merge once all the changes are in place (in case there are any not yet pushed) @JosiahParry
Trying to add required content to support RStudio project templates. Currently getting the following error: