Skip to content
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

Fix poetry installer with homebrew python on MacOS #133

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/installer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
strategy:
matrix:
os: [Ubuntu, macOS, Windows]
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11"]
python-version: ["3.8", "3.9", "3.10", "3.11"]
args:
- ""
- "--preview"
Expand Down
9 changes: 8 additions & 1 deletion install-poetry.py
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,14 @@ def make(cls, target: Path) -> "VirtualEnvironment":
import ensurepip # noqa: F401
import venv

builder = venv.EnvBuilder(clear=True, with_pip=True, symlinks=False)
use_symlinks = False
if os.path.islink(sys.executable):
link_target = os.readlink(sys.executable)
# if sys.executable is a relative symlink, such as python, installed
# from homebrew on MacOS, it will not work once copied
use_symlinks = not os.path.isabs(link_target)

builder = venv.EnvBuilder(clear=True, with_pip=True, symlinks=use_symlinks)
context = builder.ensure_directories(target)

if (
Expand Down