Skip to content

Commit a3b5843

Browse files
authored
Update create_virtualenv.R
Signed-off-by: Jessica Ikechukwu <Jessica.Ikechukwu@uwe.ac.uk>
1 parent 4405b92 commit a3b5843

1 file changed

Lines changed: 9 additions & 9 deletions

File tree

R/create_virtualenv.R

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -14,21 +14,21 @@ install_acro <- function(envname = "r-acro", python = NULL, ...) {
1414
if (is.null(python)) {
1515
python <- Sys.which("python3")
1616
if (python == "") {
17-
python <- Sys.which("python")
18-
if (python == "") {
19-
stop("Python not found in PATH. Please ensure Python is installed and accessible.")
20-
}
17+
python <- Sys.which("python") # nocov
18+
if (python == "") { # nocov
19+
stop("Python not found in PATH. Please ensure Python is installed and accessible.") # nocov
20+
} # nocov
2121
}
2222
}
23-
23+
2424
# create Python virtual environment
2525
reticulate::virtualenv_create(
2626
envname = envname,
2727
python = python,
2828
force = TRUE,
2929
packages = NULL
3030
)
31-
31+
3232
# install Python acro
3333
reticulate::py_install(acro_package, envname = envname)
3434
}
@@ -42,14 +42,14 @@ create_virtualenv <- function(...) {
4242
# Get Python executable path
4343
python_path <- Sys.which("python3")
4444
if (python_path == "") {
45-
python_path <- Sys.which("python")
45+
python_path <- Sys.which("python") # nocov
4646
}
47-
47+
4848
# ensure a virtual environment exists
4949
if (!reticulate::virtualenv_exists(acro_venv)) {
5050
install_acro(envname = acro_venv, python = python_path)
5151
}
52-
52+
5353
# activate virtual environment
5454
reticulate::use_virtualenv(acro_venv, required = TRUE)
5555
}

0 commit comments

Comments
 (0)