-
Notifications
You must be signed in to change notification settings - Fork 152
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
Feature Request: renv::remove_python
#1850
Comments
It looks like exposing |
Something like: #'
#' @export
remove_python <- function(
project = NULL,
python_dir = TRUE,
requirements_file = TRUE,
prompt = interactive()
)
{
flag <- !prompt || askYesNo("Stop renv from tracking Python version and packages?")
if(is.na(flag))
return()
else if (isTRUE(flag))
{
renv_python_deactivate(project)
}
if(python_dir)
{
python_path <- renv_paths_renv('python') |> renv_path_canonicalize()
flag <- !prompt || askYesNo(paste0("Remove '", python_path, "' and its contents?"))
if(is.na(flag))
return()
else if (isTRUE(flag))
unlink(python_path, recursive = TRUE)
}
if(requirements_file)
{
req_path <- renv_paths_renv('../requirements.txt') |> renv_path_canonicalize()
flag <- !prompt || askYesNo(paste0("Remove '", req_path, "'?"))
if(is.na(flag))
return()
else if (isTRUE(flag))
unlink(python_path, recursive = TRUE)
}
} |
I think |
Thanks. It does look like |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I have a project where I used
renv::use_python()
to start tracking python dependencies. Later, I no longer need to use python, but there doesn't seem to be a clean way to remove the python virtual environment and dependency tracking.It looks like the steps to remove python are:
renv.lock
.renv/python
and its contents.requirements.txt
The text was updated successfully, but these errors were encountered: