Conversation
| - Every exported function in rextendr must include the following roxygen | ||
| variables: |
There was a problem hiding this comment.
| - Every exported function in rextendr must include the following roxygen | |
| variables: | |
| roclets: |
| - the default value, if one exists | ||
| - `@return` — what the function returns, including the R type. | ||
| - The `@details` and `@examples` sections are optional, but should in general be | ||
| included. |
There was a problem hiding this comment.
examples are required by CRAN. this is not optional
| The extendr project has three main areas where you can contribute: | ||
|
|
||
| **extendr crates** — The core Rust library. This is where the `#[extendr]` | ||
| macro, R type bindings, and the bulk of the Rust API live. |
There was a problem hiding this comment.
| macro, R type bindings, and the bulk of the Rust API live. | |
| macro, R type bindings, and the Rust API live. |
| **rextendr package** — The R package that scaffolds new extendr projects | ||
| and generates R wrapper functions. Contributions here require R |
There was a problem hiding this comment.
| **rextendr package** — The R package that scaffolds new extendr projects | |
| and generates R wrapper functions. Contributions here require R | |
| **rextendr package** — The R package that scaffolds new extendr projects. | |
| Contributions here require R |
There was a problem hiding this comment.
Technically devtools::document() does the wrapper generation now
| ```{.rust filename="inst/templates/document.rs"} | ||
| // Generated by extendr: Do not edit by hand | ||
| fn main() -> Result<(), Box<dyn std::error::Error>> { | ||
| let wrapper_path = "../R/extendr-wrappers.R"; | ||
| let header = "\ | ||
| # Generated by extendr: Do not edit by hand\n\ | ||
| # nolint start\n\ | ||
| \n\ | ||
| #' @usage NULL\n\ | ||
| #' @useDynLib {{{pkg_name}}}, .registration = TRUE\n\ | ||
| NULL\n\ | ||
| \n\ | ||
| "; | ||
| let footer = "# nolint end\n"; | ||
| let wrappers = {{{lib_name}}}::get_{{{mod_name}}}_metadata() | ||
| .make_r_wrappers(true, "{{{pkg_name}}}") | ||
| .map_err(|e| format!("failed to generate wrappers: {e}"))?; | ||
| std::fs::write(wrapper_path, format!("{header}{wrappers}{footer}")) | ||
| .map_err(|e| format!("failed to write {wrapper_path}: {e}"))?; | ||
| Ok(()) | ||
| } | ||
| ``` |
There was a problem hiding this comment.
| ```{.rust filename="inst/templates/document.rs"} | |
| // Generated by extendr: Do not edit by hand | |
| fn main() -> Result<(), Box<dyn std::error::Error>> { | |
| let wrapper_path = "../R/extendr-wrappers.R"; | |
| let header = "\ | |
| # Generated by extendr: Do not edit by hand\n\ | |
| # nolint start\n\ | |
| \n\ | |
| #' @usage NULL\n\ | |
| #' @useDynLib {{{pkg_name}}}, .registration = TRUE\n\ | |
| NULL\n\ | |
| \n\ | |
| "; | |
| let footer = "# nolint end\n"; | |
| let wrappers = {{{lib_name}}}::get_{{{mod_name}}}_metadata() | |
| .make_r_wrappers(true, "{{{pkg_name}}}") | |
| .map_err(|e| format!("failed to generate wrappers: {e}"))?; | |
| std::fs::write(wrapper_path, format!("{header}{wrappers}{footer}")) | |
| .map_err(|e| format!("failed to write {wrapper_path}: {e}"))?; | |
| Ok(()) | |
| } | |
| ``` |
this isn't necessary and may change.
| Shell scripts run by R when the package is uninstalled. They remove the | ||
| generated `src/Makevars` and `src/Makevars.win` files respectively. No newline at end of file |
There was a problem hiding this comment.
This is not correct. These are run at the end of package installation
| version: | ||
| r: "4.2" | ||
| rust: "1.65.0" | ||
| extendr: "0.8.1" | ||
| rextendr: "0.4.2.9000" |
There was a problem hiding this comment.
I'm anti yaml.
Think we can change this to?
[versions]
r = "4.5"
rust = "1.71"
rextendr = "0.4"Can read it with tomledit::read_toml(".variables.toml")
| ## Codebase | ||
|
|
||
| **extendr** | ||
| version: 0.8.1 |
There was a problem hiding this comment.
Version is gonna trip claude up. This is the type of false flag that claude LOVES to get hung up on!
| version: 0.8.1 |
| need to understand extendr's API, types, macros, or implementation details. | ||
|
|
||
| **rextendr** | ||
| version: 0.4.2.9000 (dev) |
There was a problem hiding this comment.
| version: 0.4.2.9000 (dev) |
Addresses #76
Changes:
cargo run --quiet)