GH-381: [R] Use RETICULATE_PYTHON="managed" in test.R (#386)
I'm somewhat confident this will fix the CI issue on the stable branch
we're seeing in https://github.com/apache/arrow-cookbook/issues/381.
I did some testing on draft PRs.
diff --git a/r/scripts/test.R b/r/scripts/test.R
index a0f4725..e6e0ddf 100644
--- a/r/scripts/test.R
+++ b/r/scripts/test.R
@@ -55,5 +55,9 @@
# Extract R code from files
purrr::walk(files, extract_r_code, dir = td)
+# Fixes CI for newer reticulate by forcing reticulate to manage itself even if
+# it finds other Python installations on the host
+Sys.setenv(RETICULATE_PYTHON="managed")
+
# Run tests
testthat::test_dir(path = td)