From 32ffdce33b4c25031136c674f6baeb19869f77f3 Mon Sep 17 00:00:00 2001 From: "Brian M. Schilder" <34280215+bschilder@users.noreply.github.com> Date: Mon, 27 Jun 2022 11:12:59 -0400 Subject: [PATCH] Add `requireNamespace` for `semver` package This lets users know exactly what they need to do. --- R/is_python_package_with_version_installed.R | 3 +++ 1 file changed, 3 insertions(+) diff --git a/R/is_python_package_with_version_installed.R b/R/is_python_package_with_version_installed.R index 8b06cb2..36daa26 100644 --- a/R/is_python_package_with_version_installed.R +++ b/R/is_python_package_with_version_installed.R @@ -45,6 +45,9 @@ is_python_package_with_version_installed <- function( # nolint indeed a long fun python_version = get_default_python_version(), verbose = FALSE ) { + if(!requireNamespace("semver")){ + stop("'semver' must be installed to use this function: install.packages('semver')") + } # 'get_installed_python_packages' will use 'python3' # or call create_and_activate_conda_env' t <- ormr::get_installed_python_packages(