Skip to content

Commit

Permalink
update SystemRequirements to match CRAN requirements (#329)
Browse files Browse the repository at this point in the history
* update SystemRequirements to match CRAN requirements

* update snaps with new sysreqs field
  • Loading branch information
JosiahParry authored Jan 31, 2024
1 parent dca0ada commit 0d3fad6
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 4 deletions.
1 change: 1 addition & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# rextendr (development version)

* `use_extendr()` sets the `DESCRIPTION`'s `SystemRequirements` field according to CRAN policy to `Cargo (Rust's package manager), rustc` (#329)
* Introduces new functions `use_cran_defaults()` and `vendor_pkgs()` to ease the publication of extendr-powered packages on CRAN. See the new article _CRAN compliant extendr packages_ on how to use these (#320).
* `rust_sitrep()` now better communicates the status of the Rust toolchain and available targets. It also guides the user through necessary installation steps to fix Rust setup (#318).
* `use_extendr()` and `document()` now set the `SystemRequirements` field of the `DESCRIPTION` file to
Expand Down
2 changes: 1 addition & 1 deletion R/setup.R
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ update_rextendr_version <- function(desc_path, cur_version = NULL) {
}

update_sys_reqs <- function(desc_path) {
cur <- "Cargo (rustc package manager)"
cur <- "Cargo (Rust's package manager), rustc"
prev <- stringi::stri_trim_both(desc::desc_get("SystemRequirements", file = desc_path)[[1]])

if (is.na(prev)) {
Expand Down
2 changes: 1 addition & 1 deletion tests/testthat/_snaps/use_cran_defaults.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
Message
i First time using rextendr. Upgrading automatically...
i Setting `Config/rextendr/version` to "0.3.1.9000" in the 'DESCRIPTION' file.
i Setting `SystemRequirements` to "Cargo (rustc package manager)" in the 'DESCRIPTION' file.
i Setting `SystemRequirements` to "Cargo (Rust's package manager), rustc" in the 'DESCRIPTION' file.
v Creating 'src/rust/src'.
v Writing 'src/entrypoint.c'
v Writing 'src/Makevars'
Expand Down
2 changes: 1 addition & 1 deletion tests/testthat/_snaps/use_extendr.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
Message
i First time using rextendr. Upgrading automatically...
i Setting `Config/rextendr/version` to "0.3.1.9000" in the 'DESCRIPTION' file.
i Setting `SystemRequirements` to "Cargo (rustc package manager)" in the 'DESCRIPTION' file.
i Setting `SystemRequirements` to "Cargo (Rust's package manager), rustc" in the 'DESCRIPTION' file.
v Creating 'src/rust/src'.
v Writing 'src/entrypoint.c'
v Writing 'src/Makevars'
Expand Down
2 changes: 1 addition & 1 deletion tests/testthat/test-use_extendr.R
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ test_that("use_extendr() sets up extendr files correctly", {
version_in_desc <- stringi::stri_trim_both(desc::desc_get("Config/rextendr/version", path)[[1]])
sysreq_in_desc <- stringi::stri_trim_both(desc::desc_get("SystemRequirements", path)[[1]])
expect_equal(version_in_desc, as.character(packageVersion("rextendr")))
expect_equal(sysreq_in_desc, "Cargo (rustc package manager)")
expect_equal(sysreq_in_desc, "Cargo (Rust's package manager), rustc")

# directory structure
expect_true(dir.exists("src"))
Expand Down

0 comments on commit 0d3fad6

Please sign in to comment.