Skip to content

Commit 2f19f8b

Browse files
topepo‘topepo’simonpcouch
authored
Engine and extension installs (#1157)
* changes for #1156 * small text update * Update R/install_packages.R Co-authored-by: Simon P. Couch <simonpatrickcouch@gmail.com> * update from reviewer feedback --------- Co-authored-by: ‘topepo’ <‘mxkuhn@gmail.com’> Co-authored-by: Simon P. Couch <simonpatrickcouch@gmail.com>
1 parent dc9e188 commit 2f19f8b

File tree

4 files changed

+19
-9
lines changed

4 files changed

+19
-9
lines changed

NEWS.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@
1212

1313
* New `extract_fit_time()` method has been added that returns the time it took to train the model (#853).
1414

15+
* Ensure that `knit_engine_docs()` has the required packages installed (#1156).
16+
1517

1618
# parsnip 1.2.1
1719

R/engine_docs.R

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,16 @@
44
#' @return A tibble with column `file` for the file name and `result` (a
55
#' character vector that echos the output file name or, when there is
66
#' a failure, the error message).
7+
#' @details
8+
#' This function will check whether the known parsnip extension packages,
9+
#' engine specific packages, and a few other ancillary packages are installed.
10+
#' Users will be prompted to install anything required to create the engine
11+
#' documentation.
12+
#'
713
#' @keywords internal
814
#' @export
915
knit_engine_docs <- function(pattern = NULL) {
16+
install_engine_packages()
1017
old_cli_opt <- options()$cli.unicode
1118
on.exit(options(cli.unicode = old_cli_opt))
1219
options(cli.unicode = FALSE)

R/install_packages.R

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,12 @@
1+
# Installs packages needed to run `knit_engine_docs()`.
12
install_engine_packages <- function(extension = TRUE, extras = TRUE,
23
ignore_pkgs = c("stats", "liquidSVM",
34
"parsnip")) {
45
bio_pkgs <- c()
56

67
if (extension) {
78
extensions_packages <- extensions()
8-
repositories <- glue::glue("tidymodels/{extensions_packages}")
9-
10-
remotes::install_github(repositories)
11-
12-
extensions_packages <- extensions()
13-
purrr::walk(extensions_packages, library, character.only = TRUE)
9+
rlang::check_installed(extensions_packages)
1410
bio_pkgs <- c(bio_pkgs, "mixOmics")
1511
}
1612

@@ -35,7 +31,6 @@ install_engine_packages <- function(extension = TRUE, extras = TRUE,
3531
engine_packages <- unique(c(engine_packages, rmd_pkgs))
3632
}
3733

38-
remotes::install_cran(engine_packages)
39-
40-
remotes::install_bioc(bio_pkgs)
34+
rlang::check_installed(engine_packages)
35+
rlang::check_installed(bio_pkgs)
4136
}

man/knit_engine_docs.Rd

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)