From cf57a26f8892b5c65f3d9477d8a03bebff82e675 Mon Sep 17 00:00:00 2001 From: Josiah Parry Date: Sat, 30 Dec 2023 09:12:37 -0500 Subject: [PATCH 1/2] update SystemRequirements to match CRAN requirements --- NEWS.md | 1 + R/setup.R | 2 +- tests/testthat/_snaps/use_extendr.md | 2 +- tests/testthat/test-use_extendr.R | 2 +- 4 files changed, 4 insertions(+), 3 deletions(-) diff --git a/NEWS.md b/NEWS.md index f0c904a9..3af2f9c6 100644 --- a/NEWS.md +++ b/NEWS.md @@ -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 diff --git a/R/setup.R b/R/setup.R index 31d77fc5..bb22f953 100644 --- a/R/setup.R +++ b/R/setup.R @@ -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)) { diff --git a/tests/testthat/_snaps/use_extendr.md b/tests/testthat/_snaps/use_extendr.md index 843f532c..f97a5be2 100644 --- a/tests/testthat/_snaps/use_extendr.md +++ b/tests/testthat/_snaps/use_extendr.md @@ -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' diff --git a/tests/testthat/test-use_extendr.R b/tests/testthat/test-use_extendr.R index 9dbbe16f..f64c5221 100644 --- a/tests/testthat/test-use_extendr.R +++ b/tests/testthat/test-use_extendr.R @@ -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")) From 7c601fac2e9463c2f58b63c4717280a70b1b956c Mon Sep 17 00:00:00 2001 From: Josiah Parry Date: Wed, 31 Jan 2024 16:29:27 -0500 Subject: [PATCH 2/2] update snaps with new sysreqs field --- tests/testthat/_snaps/use_cran_defaults.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/testthat/_snaps/use_cran_defaults.md b/tests/testthat/_snaps/use_cran_defaults.md index 84e5994e..0a4c9b0f 100644 --- a/tests/testthat/_snaps/use_cran_defaults.md +++ b/tests/testthat/_snaps/use_cran_defaults.md @@ -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'