From 9e5df6b1fc8bf45bb93ce61e59cdf3b17e18f96a Mon Sep 17 00:00:00 2001 From: Arun Babu Neelicattu Date: Fri, 22 Nov 2024 14:50:39 +0100 Subject: [PATCH 01/12] chore(ci): add homebrew python integration test --- .github/workflows/installer.yml | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/.github/workflows/installer.yml b/.github/workflows/installer.yml index e581cf0..b820537 100644 --- a/.github/workflows/installer.yml +++ b/.github/workflows/installer.yml @@ -139,3 +139,29 @@ jobs: run: | python3 install-poetry.py -y --uninstall { type poetry 2>/dev/null >&2 && exit 1; } || exit 0 + + integration-macos-homebrew: + name: Integration Test / MacOS / Homebrew Python + runs-on: macos-latest + defaults: + run: + shell: bash + steps: + - uses: actions/checkout@v4 + + - name: Install Homebrew + run: | + bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" + + - name: Install Python + run: brew install python + + - name: Install Poetry + run: curl -sSL https://install.python-poetry.org | python3 - + + - name: Test Poetry + run: | + poetry new foo + cd foo + poetry add pycowsay + poetry run pycowsay From d4848b518c6d86823ca07b2f53e27a0eaaae2e42 Mon Sep 17 00:00:00 2001 From: Arun Babu Neelicattu Date: Fri, 22 Nov 2024 14:58:14 +0100 Subject: [PATCH 02/12] comment out other jobs --- .github/workflows/installer.yml | 244 ++++++++++++++++---------------- 1 file changed, 123 insertions(+), 121 deletions(-) diff --git a/.github/workflows/installer.yml b/.github/workflows/installer.yml index b820537..89aae0e 100644 --- a/.github/workflows/installer.yml +++ b/.github/workflows/installer.yml @@ -19,126 +19,126 @@ concurrency: cancel-in-progress: ${{ github.event_name == 'pull_request' }} jobs: - default: - name: ${{ matrix.os }} / ${{ matrix.python-version }} / install-poetry.py ${{ matrix.args }} - runs-on: ${{ matrix.image }} - strategy: - matrix: - os: [Ubuntu, macOS, Windows] - python-version: - - "3.9" - - "3.10" - - "3.11" - - "3.12" - - "3.13" - args: - - "" - - "--preview" - - "--git https://github.com/python-poetry/poetry.git" - include: - - os: Ubuntu - image: ubuntu-22.04 - - os: Windows - image: windows-2022 - - os: macOS - image: macos-12 - fail-fast: false - defaults: - run: - shell: bash - steps: - - uses: actions/checkout@v4 - - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v5 - with: - python-version: ${{ matrix.python-version }} - - - name: Update PATH - if: ${{ matrix.os != 'Windows' }} - run: echo "$HOME/.local/bin" >> $GITHUB_PATH - - - name: Update PATH for Windows - if: ${{ matrix.os == 'Windows' }} - run: echo "$APPDATA\Python\Scripts" >> $GITHUB_PATH - - - name: Install Poetry - run: python install-poetry.py -y ${{ matrix.args }} - - - name: Upload Failure Log - uses: actions/upload-artifact@v4 - if: failure() - with: - name: poetry-installer-error.log - path: poetry-installer-error-*.log - - - name: Verify Installation - run: | - set -e - poetry new foobar - cd foobar - poetry config virtualenvs.in-project true - poetry env use python - [ "$(poetry run python --version)" == "$(python --version)" ] \ - || { echo >&2 "ERROR: Virtual environment Python version do not match system version." && exit 1; } - - - name: Uninstall Poetry - run: | - python install-poetry.py -y --uninstall - { type poetry 2>/dev/null >&2 && exit 1; } || exit 0 - - # debian/ubuntu needs special testing due to various issues around python packaging - # and configuration - integration-ubuntu: - name: Integration Test / Ubuntu / ${{ matrix.tag }} - runs-on: ubuntu-latest - container: docker.io/ubuntu:${{ matrix.tag }} - strategy: - matrix: - tag: - - focal - - jammy - defaults: - run: - shell: bash - steps: - - uses: actions/checkout@v4 - - - name: Install Packages - run: | - apt-get -y update - apt-get -y install python3 ca-certificates - apt-get -y install --reinstall python3-distutils - - - name: Update PATH - run: echo "$HOME/.local/bin" >> $GITHUB_PATH - - - name: Install Poetry - env: - DEB_PYTHON_INSTALL_LAYOUT: "deb" - run: python3 install-poetry.py -y - - - name: Upload Failure Log - uses: actions/upload-artifact@v4 - if: failure() - with: - name: poetry-installer-error.log - path: poetry-installer-error-*.log - - - name: Verify Installation - run: | - set -e - poetry new foobar - cd foobar - poetry config virtualenvs.in-project true - poetry env use python3 - [ "$(poetry run python --version)" == "$(python3 --version)" ] \ - || { echo >&2 "ERROR: Virtual environment Python version do not match system version." && exit 1; } - - - name: Uninstall Poetry - run: | - python3 install-poetry.py -y --uninstall - { type poetry 2>/dev/null >&2 && exit 1; } || exit 0 +# default: +# name: ${{ matrix.os }} / ${{ matrix.python-version }} / install-poetry.py ${{ matrix.args }} +# runs-on: ${{ matrix.image }} +# strategy: +# matrix: +# os: [Ubuntu, macOS, Windows] +# python-version: +# - "3.9" +# - "3.10" +# - "3.11" +# - "3.12" +# - "3.13" +# args: +# - "" +# - "--preview" +# - "--git https://github.com/python-poetry/poetry.git" +# include: +# - os: Ubuntu +# image: ubuntu-22.04 +# - os: Windows +# image: windows-2022 +# - os: macOS +# image: macos-12 +# fail-fast: false +# defaults: +# run: +# shell: bash +# steps: +# - uses: actions/checkout@v4 +# +# - name: Set up Python ${{ matrix.python-version }} +# uses: actions/setup-python@v5 +# with: +# python-version: ${{ matrix.python-version }} +# +# - name: Update PATH +# if: ${{ matrix.os != 'Windows' }} +# run: echo "$HOME/.local/bin" >> $GITHUB_PATH +# +# - name: Update PATH for Windows +# if: ${{ matrix.os == 'Windows' }} +# run: echo "$APPDATA\Python\Scripts" >> $GITHUB_PATH +# +# - name: Install Poetry +# run: python install-poetry.py -y ${{ matrix.args }} +# +# - name: Upload Failure Log +# uses: actions/upload-artifact@v4 +# if: failure() +# with: +# name: poetry-installer-error.log +# path: poetry-installer-error-*.log +# +# - name: Verify Installation +# run: | +# set -e +# poetry new foobar +# cd foobar +# poetry config virtualenvs.in-project true +# poetry env use python +# [ "$(poetry run python --version)" == "$(python --version)" ] \ +# || { echo >&2 "ERROR: Virtual environment Python version do not match system version." && exit 1; } +# +# - name: Uninstall Poetry +# run: | +# python install-poetry.py -y --uninstall +# { type poetry 2>/dev/null >&2 && exit 1; } || exit 0 +# +# # debian/ubuntu needs special testing due to various issues around python packaging +# # and configuration +# integration-ubuntu: +# name: Integration Test / Ubuntu / ${{ matrix.tag }} +# runs-on: ubuntu-latest +# container: docker.io/ubuntu:${{ matrix.tag }} +# strategy: +# matrix: +# tag: +# - focal +# - jammy +# defaults: +# run: +# shell: bash +# steps: +# - uses: actions/checkout@v4 +# +# - name: Install Packages +# run: | +# apt-get -y update +# apt-get -y install python3 ca-certificates +# apt-get -y install --reinstall python3-distutils +# +# - name: Update PATH +# run: echo "$HOME/.local/bin" >> $GITHUB_PATH +# +# - name: Install Poetry +# env: +# DEB_PYTHON_INSTALL_LAYOUT: "deb" +# run: python3 install-poetry.py -y +# +# - name: Upload Failure Log +# uses: actions/upload-artifact@v4 +# if: failure() +# with: +# name: poetry-installer-error.log +# path: poetry-installer-error-*.log +# +# - name: Verify Installation +# run: | +# set -e +# poetry new foobar +# cd foobar +# poetry config virtualenvs.in-project true +# poetry env use python3 +# [ "$(poetry run python --version)" == "$(python3 --version)" ] \ +# || { echo >&2 "ERROR: Virtual environment Python version do not match system version." && exit 1; } +# +# - name: Uninstall Poetry +# run: | +# python3 install-poetry.py -y --uninstall +# { type poetry 2>/dev/null >&2 && exit 1; } || exit 0 integration-macos-homebrew: name: Integration Test / MacOS / Homebrew Python @@ -157,7 +157,9 @@ jobs: run: brew install python - name: Install Poetry - run: curl -sSL https://install.python-poetry.org | python3 - + run: | + eval "$(/opt/homebrew/bin/brew shellenv)" + curl -sSL https://install.python-poetry.org | python - - name: Test Poetry run: | From d248a0ae89d69527f76dfa4e3c765930f1d68332 Mon Sep 17 00:00:00 2001 From: Arun Babu Neelicattu Date: Fri, 22 Nov 2024 15:01:38 +0100 Subject: [PATCH 03/12] display python site --- .github/workflows/installer.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/installer.yml b/.github/workflows/installer.yml index 89aae0e..f288117 100644 --- a/.github/workflows/installer.yml +++ b/.github/workflows/installer.yml @@ -159,6 +159,8 @@ jobs: - name: Install Poetry run: | eval "$(/opt/homebrew/bin/brew shellenv)" + python -m site + ls -all python curl -sSL https://install.python-poetry.org | python - - name: Test Poetry From c323de2976d71d06354107cabcd6fe55e7644391 Mon Sep 17 00:00:00 2001 From: Arun Babu Neelicattu Date: Fri, 22 Nov 2024 15:03:52 +0100 Subject: [PATCH 04/12] fix ls --- .github/workflows/installer.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/installer.yml b/.github/workflows/installer.yml index f288117..db32f8a 100644 --- a/.github/workflows/installer.yml +++ b/.github/workflows/installer.yml @@ -152,6 +152,8 @@ jobs: - name: Install Homebrew run: | bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" + echo >> /Users/runner/.bash_profile + echo 'eval "$(/opt/homebrew/bin/brew shellenv)"' >> /Users/runner/.bash_profile - name: Install Python run: brew install python @@ -160,7 +162,7 @@ jobs: run: | eval "$(/opt/homebrew/bin/brew shellenv)" python -m site - ls -all python + ls -all $(which python) curl -sSL https://install.python-poetry.org | python - - name: Test Poetry From e4c5ce7ab94930e49e9bea017bb041ca125bbe05 Mon Sep 17 00:00:00 2001 From: Arun Babu Neelicattu Date: Fri, 22 Nov 2024 15:10:56 +0100 Subject: [PATCH 05/12] unlink and relink --- .github/workflows/installer.yml | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/.github/workflows/installer.yml b/.github/workflows/installer.yml index db32f8a..bb1890a 100644 --- a/.github/workflows/installer.yml +++ b/.github/workflows/installer.yml @@ -155,18 +155,25 @@ jobs: echo >> /Users/runner/.bash_profile echo 'eval "$(/opt/homebrew/bin/brew shellenv)"' >> /Users/runner/.bash_profile - - name: Install Python - run: brew install python + - name: Install Python 3.13 + run: | + brew install python@3.13 - name: Install Poetry run: | - eval "$(/opt/homebrew/bin/brew shellenv)" python -m site ls -all $(which python) curl -sSL https://install.python-poetry.org | python - + - name: Install Python 3.12 + run: | + brew install python@3.12 + brew unlink python@3.13 + brew link --force python@3.12 + - name: Test Poetry run: | + python -m site poetry new foo cd foo poetry add pycowsay From c7085094ffde4577d0fb6b6a16c000950d097bf6 Mon Sep 17 00:00:00 2001 From: Arun Babu Neelicattu Date: Fri, 22 Nov 2024 15:14:12 +0100 Subject: [PATCH 06/12] force unlink --- .github/workflows/installer.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/installer.yml b/.github/workflows/installer.yml index bb1890a..47a911a 100644 --- a/.github/workflows/installer.yml +++ b/.github/workflows/installer.yml @@ -169,7 +169,11 @@ jobs: run: | brew install python@3.12 brew unlink python@3.13 + brew unlink python@3.12 brew link --force python@3.12 + hash -r + python -m site + ls -all $(which python) - name: Test Poetry run: | From 3da25c524c9c0641efecda07c560af921565d84f Mon Sep 17 00:00:00 2001 From: Arun Babu Neelicattu Date: Fri, 22 Nov 2024 15:22:29 +0100 Subject: [PATCH 07/12] switch using PATH --- .github/workflows/installer.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/installer.yml b/.github/workflows/installer.yml index 47a911a..1ed29d6 100644 --- a/.github/workflows/installer.yml +++ b/.github/workflows/installer.yml @@ -168,9 +168,7 @@ jobs: - name: Install Python 3.12 run: | brew install python@3.12 - brew unlink python@3.13 - brew unlink python@3.12 - brew link --force python@3.12 + echo "$(brew --prefix python@3.12)/libexec/bin" >> $GITHUB_PATH hash -r python -m site ls -all $(which python) From 045415f79a656d3223ec5f0feb508704d61186c0 Mon Sep 17 00:00:00 2001 From: Arun Babu Neelicattu Date: Fri, 22 Nov 2024 15:26:44 +0100 Subject: [PATCH 08/12] fix output --- .github/workflows/installer.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/installer.yml b/.github/workflows/installer.yml index 1ed29d6..d86af6a 100644 --- a/.github/workflows/installer.yml +++ b/.github/workflows/installer.yml @@ -169,13 +169,11 @@ jobs: run: | brew install python@3.12 echo "$(brew --prefix python@3.12)/libexec/bin" >> $GITHUB_PATH - hash -r - python -m site - ls -all $(which python) - name: Test Poetry run: | python -m site + ls -all $(which python) poetry new foo cd foo poetry add pycowsay From 271963d65798ab29516db86868807c1c1d33b370 Mon Sep 17 00:00:00 2001 From: Arun Babu Neelicattu Date: Fri, 22 Nov 2024 15:31:58 +0100 Subject: [PATCH 09/12] force failure? --- .github/workflows/installer.yml | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/.github/workflows/installer.yml b/.github/workflows/installer.yml index d86af6a..fbaf5c6 100644 --- a/.github/workflows/installer.yml +++ b/.github/workflows/installer.yml @@ -178,3 +178,14 @@ jobs: cd foo poetry add pycowsay poetry run pycowsay + + - name: Uninstall Python 3.13 + run: | + brew uninstall python@3.13 + + - name: Test Poetry + run: | + python -m site + ls -all $(which python) + cd foo + poetry run pycowsay From adc49c136dd706df676403f36259de419275be69 Mon Sep 17 00:00:00 2001 From: Arun Babu Neelicattu Date: Fri, 22 Nov 2024 15:36:49 +0100 Subject: [PATCH 10/12] brew uninstall ignore deps --- .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 fbaf5c6..936799f 100644 --- a/.github/workflows/installer.yml +++ b/.github/workflows/installer.yml @@ -181,7 +181,7 @@ jobs: - name: Uninstall Python 3.13 run: | - brew uninstall python@3.13 + brew uninstall --ignore-dependencies python@3.13 - name: Test Poetry run: | From 415c77dedc91115d746cf2b37cdddea12a351f86 Mon Sep 17 00:00:00 2001 From: Arun Babu Neelicattu Date: Fri, 22 Nov 2024 15:45:16 +0100 Subject: [PATCH 11/12] ls on current python --- .github/workflows/installer.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/installer.yml b/.github/workflows/installer.yml index 936799f..c8cef2b 100644 --- a/.github/workflows/installer.yml +++ b/.github/workflows/installer.yml @@ -185,6 +185,7 @@ jobs: - name: Test Poetry run: | + ls -all /Library/Frameworks/Python.framework/Versions/Current/bin/python | : python -m site ls -all $(which python) cd foo From fc215126600150a64dffe19638689b980d8dde02 Mon Sep 17 00:00:00 2001 From: Arun Babu Neelicattu Date: Fri, 22 Nov 2024 15:48:10 +0100 Subject: [PATCH 12/12] fix typo --- .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 c8cef2b..1fcda61 100644 --- a/.github/workflows/installer.yml +++ b/.github/workflows/installer.yml @@ -185,7 +185,7 @@ jobs: - name: Test Poetry run: | - ls -all /Library/Frameworks/Python.framework/Versions/Current/bin/python | : + ls -all /Library/Frameworks/Python.framework/Versions/Current/bin/python || : python -m site ls -all $(which python) cd foo