From 53bcf30fa7b70a948f22438fb1ab2b53fa133bac Mon Sep 17 00:00:00 2001 From: Yuriy Ostapenko <2004891+yuriyostapenko@users.noreply.github.com> Date: Sun, 17 Sep 2023 15:20:08 +0200 Subject: [PATCH 1/2] Fix poetry installer with homebrew python --- install-poetry.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/install-poetry.py b/install-poetry.py index 4a96007..b854e6f 100644 --- a/install-poetry.py +++ b/install-poetry.py @@ -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 ( From 5a16f53f06a68aaffe2bb783e1f5b17a7594b9df Mon Sep 17 00:00:00 2001 From: Yuriy Ostapenko <2004891+yuriyostapenko@users.noreply.github.com> Date: Sun, 17 Sep 2023 21:06:23 +0200 Subject: [PATCH 2/2] Remove python 3.7 from matrix build, as it is no longer supported by latest version of poetry (1.6.1), and install will always fail --- .github/workflows/installer.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/installer.yml b/.github/workflows/installer.yml index faee561..724721d 100644 --- a/.github/workflows/installer.yml +++ b/.github/workflows/installer.yml @@ -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"