Skip to content

Engine and extension installs #1157

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Aug 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@

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

* Ensure that `knit_engine_docs()` has the required packages installed (#1156).


# parsnip 1.2.1

Expand Down
7 changes: 7 additions & 0 deletions R/engine_docs.R
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,16 @@
#' @return A tibble with column `file` for the file name and `result` (a
#' character vector that echos the output file name or, when there is
#' a failure, the error message).
#' @details
#' This function will check whether the known parsnip extension packages,
#' engine specific packages, and a few other ancillary packages are installed.
#' Users will be prompted to install anything required to create the engine
#' documentation.
#'
#' @keywords internal
#' @export
knit_engine_docs <- function(pattern = NULL) {
install_engine_packages()
old_cli_opt <- options()$cli.unicode
on.exit(options(cli.unicode = old_cli_opt))
options(cli.unicode = FALSE)
Expand Down
13 changes: 4 additions & 9 deletions R/install_packages.R
Original file line number Diff line number Diff line change
@@ -1,16 +1,12 @@
# Installs packages needed to run `knit_engine_docs()`.
install_engine_packages <- function(extension = TRUE, extras = TRUE,
ignore_pkgs = c("stats", "liquidSVM",
"parsnip")) {
bio_pkgs <- c()

if (extension) {
extensions_packages <- extensions()
repositories <- glue::glue("tidymodels/{extensions_packages}")

remotes::install_github(repositories)

extensions_packages <- extensions()
purrr::walk(extensions_packages, library, character.only = TRUE)
rlang::check_installed(extensions_packages)
bio_pkgs <- c(bio_pkgs, "mixOmics")
}

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

remotes::install_cran(engine_packages)

remotes::install_bioc(bio_pkgs)
rlang::check_installed(engine_packages)
rlang::check_installed(bio_pkgs)
}
6 changes: 6 additions & 0 deletions man/knit_engine_docs.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading