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

chore(ci): add homebrew python integration test #150

Draft
wants to merge 12 commits into
base: main
Choose a base branch
from
Draft
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
257 changes: 154 additions & 103 deletions .github/workflows/installer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,123 +19,174 @@ 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
# 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
runs-on: macos-latest
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: 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: Update PATH for Windows
if: ${{ matrix.os == 'Windows' }}
run: echo "$APPDATA\Python\Scripts" >> $GITHUB_PATH
- name: Install Python 3.13
run: |
brew install [email protected]

- 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; }
python -m site
ls -all $(which python)
curl -sSL https://install.python-poetry.org | python -

- name: Uninstall Poetry
- name: Install Python 3.12
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
brew install [email protected]
echo "$(brew --prefix [email protected])/libexec/bin" >> $GITHUB_PATH

- name: Install Packages
- name: Test Poetry
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
python -m site
ls -all $(which python)
poetry new foo
cd foo
poetry add pycowsay
poetry run pycowsay

- name: Uninstall Python 3.13
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; }
brew uninstall --ignore-dependencies [email protected]

- name: Uninstall Poetry
- name: Test Poetry
run: |
python3 install-poetry.py -y --uninstall
{ type poetry 2>/dev/null >&2 && exit 1; } || exit 0
ls -all /Library/Frameworks/Python.framework/Versions/Current/bin/python || :
python -m site
ls -all $(which python)
cd foo
poetry run pycowsay
Loading