Skip to content

Commit

Permalink
use development extendr-api for tests update snapshots
Browse files Browse the repository at this point in the history
  • Loading branch information
JosiahParry committed Sep 5, 2024
1 parent c6d35e1 commit 74e4484
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 9 deletions.
3 changes: 2 additions & 1 deletion R/use_extendr.R
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,8 @@ use_extendr <- function(path = ".",
cargo_toml_content <- to_toml(
package = list(name = crate_name, publish = FALSE, version = "0.1.0", edition = edition),
lib = list(`crate-type` = array("staticlib", 1), name = lib_name),
dependencies = list(`extendr-api` = "*")
dependencies = list(`extendr-api` = list(git = "https://github.com/extendr/extendr"))
# dependencies = list(`extendr-api` = "*")
)

use_rextendr_template(
Expand Down
3 changes: 2 additions & 1 deletion R/zzz.R
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@

# Version of 'extendr_api' to be used
rextendr.extendr_deps = list(
`extendr-api` = "*"
# `extendr-api` = "*"
`extendr-api` = list(git = "https://github.com/extendr/extendr")
),
rextendr.extendr_dev_deps = list(
`extendr-api` = list(git = "https://github.com/extendr/extendr")
Expand Down
10 changes: 7 additions & 3 deletions tests/testthat/_snaps/use_cran_defaults.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
v Writing 'src/Makevars.win'
v Writing 'src/Makevars.ucrt'
v Writing 'src/.gitignore'
v Adding "^src/\\.cargo$" to '.Rbuildignore'.
v Adding '^src/\\.cargo$' to '.Rbuildignore'
v Writing 'src/rust/Cargo.toml'
v Writing 'src/rust/src/lib.rs'
v Writing 'src/testpkg-win.def'
Expand All @@ -29,8 +29,8 @@
v Writing 'configure.win'
> File 'src/Makevars' already exists. Skip writing the file.
> File 'src/Makevars.win' already exists. Skip writing the file.
v Adding "^src/rust/vendor$" to '.Rbuildignore'.
v Adding "src/rust/vendor" to '.gitignore'.
v Adding '^src/rust/vendor$' to '.Rbuildignore'
v Adding 'src/rust/vendor' to '.gitignore'

---

Expand Down Expand Up @@ -175,6 +175,10 @@
[source.crates-io]
replace-with = "vendored-sources"
[source."git+https://github.com/extendr/extendr"]
git = "https://github.com/extendr/extendr"
replace-with = "vendored-sources"
[source.vendored-sources]
directory = "vendor"

Expand Down
6 changes: 3 additions & 3 deletions tests/testthat/_snaps/use_extendr.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
v Writing 'src/Makevars.win'
v Writing 'src/Makevars.ucrt'
v Writing 'src/.gitignore'
v Adding "^src/\\.cargo$" to '.Rbuildignore'.
v Adding '^src/\\.cargo$' to '.Rbuildignore'
v Writing 'src/rust/Cargo.toml'
v Writing 'src/rust/src/lib.rs'
v Writing 'src/testpkg-win.def'
Expand Down Expand Up @@ -169,7 +169,7 @@
name = 'testpkg'
[dependencies]
extendr-api = '*'
extendr-api = { git = 'https://github.com/extendr/extendr' }

---

Expand Down Expand Up @@ -248,7 +248,7 @@
name = 'bar'
[dependencies]
extendr-api = '*'
extendr-api = { git = 'https://github.com/extendr/extendr' }

# use_rextendr_template() can overwrite existing files

Expand Down
2 changes: 1 addition & 1 deletion tests/testthat/test-optional-features.R
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ test_that("Feature 'ndarray' is enabled when 'extendr-api' has features enabled"
rust_source(
file = input,
features = "ndarray",
extendr_deps = list(`extendr-api` = list(version = "*", features = array("serde")))
extendr_deps = list(`extendr-api` = list(git = "https://github.com/extendr/extendr", features = array("serde")))
)

data <- matrix(runif(100L), 25)
Expand Down

0 comments on commit 74e4484

Please sign in to comment.