Skip to content

Commit

Permalink
use brew to install some python build deps if brew is available (#1253)
Browse files Browse the repository at this point in the history
  • Loading branch information
t-kalinowski committed Aug 8, 2022
1 parent 6c5eb7c commit 7d37192
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
4 changes: 4 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# reticulate (development version)

- `install_python()` now leverages brew for python build dependencies like
openssl@1.1 if brew is already installed and on the PATH, substantially speeding up
`install_python()` on macOS systems with brew configured.

- Fixed an issue where reticulate would fail to bind to a conda environment on macOS or linux
if conda installed a non-POSIX compliant activation script into the conda environment. (#1234)

Expand Down
6 changes: 6 additions & 0 deletions R/pyenv.R
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,12 @@ pyenv_bootstrap_unix <- function() {
owd <- setwd(tempdir())
on.exit(setwd(owd), add = TRUE)

# pyenv python builds are substantially faster on macOS if we pre-install
# some dependencies (especially openssl@1.1) as pre-built but "untapped kegs"
# (i.e., unlinked to somewhere on the PATH but tucked away under $BREW_ROOT/Cellar).
if(nzchar(Sys.which("brew")))
system("brew install --only-dependencies pyenv python@3.9")

# download the installer
url <- "https://github.com/pyenv/pyenv-installer/raw/master/bin/pyenv-installer"
name <- basename(url)
Expand Down

0 comments on commit 7d37192

Please sign in to comment.