Skip to content

Commit

Permalink
RC 0.2.3
Browse files Browse the repository at this point in the history
  • Loading branch information
juliasilge committed Aug 14, 2023
1 parent 4891a5f commit d0e49bd
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 17 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: vetiver
Title: Version, Share, Deploy, and Monitor Models
Version: 0.2.2.9000
Version: 0.2.3
Authors@R: c(
person("Julia", "Silge", , "[email protected]", role = c("cre", "aut"),
comment = c(ORCID = "0000-0002-3671-836X")),
Expand Down
2 changes: 1 addition & 1 deletion NEWS.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# vetiver (development version)
# vetiver 0.2.3

* Updated test involving renv and rsconnect (#230).

Expand Down
4 changes: 2 additions & 2 deletions cran-comments.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
## Release Summary

This is the 12th CRAN release of vetiver. This release removes a usage of `getRversion()` as instructed by CRAN, as well as fixing a Docker-related bug and adding a new endpoint for vetiver model APIs.
This is the 13th CRAN release of vetiver. This release fixes a test that uses renv and rsconnect and updates the test setup for when Python is not available.

## revdepcheck results

We checked 1 reverse dependencies, comparing R CMD check results across CRAN and dev versions of this package.
We checked 1 reverse dependency, comparing R CMD check results across CRAN and dev versions of this package.

* We saw 0 new problems
* We failed to check 0 packages
33 changes: 22 additions & 11 deletions tests/testthat/setup.R
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,28 @@ options(pins.quiet = TRUE)
options(renv.verbose = FALSE)

clean_python_tmp_dir <- function() {
if (rlang::is_installed("reticulate")) {
python_temp_dir <- dirname(reticulate::py_run_string(
"import tempfile; x=tempfile.NamedTemporaryFile().name",
local = TRUE
)$x)
detritus <- fs::dir_ls(
python_temp_dir,
regexp = "__autograph_generated_file|__pycache__"
)
fs::file_delete(detritus)
}
if (!rlang::is_installed("reticulate"))
return()

if(!reticulate::py_available())
return()

tryCatch(
error = function(cnd) {
cli::cli_inform("Cannot clean Python temp directory: {cnd}")
},
{
python_temp_dir <- dirname(reticulate::py_run_string(
"import tempfile; x=tempfile.NamedTemporaryFile().name",
local = TRUE
)$x)
detritus <- fs::dir_ls(
python_temp_dir,
regexp = "__autograph_generated_file|__pycache__"
)
fs::file_delete(detritus)
}
)
}

withr::defer(clean_python_tmp_dir(), teardown_env())
6 changes: 4 additions & 2 deletions tests/testthat/test-xgboost.R
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,11 @@ test_that("can print xgboost model", {
})

test_that("can predict xgboost model", {
preds <- predict(v, as.matrix(mtcars[,-1]))
cars_matrix <- as.matrix(mtcars[,-1])
preds <- predict(v, cars_matrix)
expect_equal(length(preds), 32)
expect_equal(mean(preds), 12.7, tolerance = 0.1)
preds2 <- predict(cars_xgb, cars_matrix)
expect_equal(preds, preds2)
})


Expand Down

0 comments on commit d0e49bd

Please sign in to comment.