Skip to content

Commit

Permalink
tweak to compile-python.R
Browse files Browse the repository at this point in the history
`find.package()` instead of `path.package()`
  • Loading branch information
t-kalinowski committed Nov 14, 2024
1 parent 354a7bb commit c0773f6
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions tools/compile-python.R
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,14 @@

package_dir <- Sys.getenv("R_PACKAGE_DIR", NA)
if (is.na(package_dir))
package_dir <- path.package("reticulate")
package_dir <- find.package("reticulate")

tryCatch({
owd <- setwd(package_dir)
for (stale_pycache in grep("__pycache__$", list.dirs(recursive = TRUE), value = TRUE))
for (stale_pycache in grep("__pycache__$", list.dirs(recursive = TRUE), value = TRUE)) {
message("deleting: ", stale_pycache)
unlink(stale_pycache, recursive = TRUE)
}

df <- reticulate::virtualenv_starter(all = TRUE)
df <- df[order(df$version, decreasing = TRUE), ]
Expand Down

0 comments on commit c0773f6

Please sign in to comment.