Skip to content

Use Poetry's main branch in test matrix #398

Use Poetry's main branch in test matrix

Use Poetry's main branch in test matrix #398

Workflow file for this run

on:
- push
- pull_request
name: Main
jobs:
pre-commit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.7'
- run: |
pip install poetry==1.2.2
poetry install
poetry run pre-commit run --all-files --show-diff-on-failure
test:
runs-on: ubuntu-latest
continue-on-error: ${{ matrix.experimental }}
strategy:
fail-fast: false
matrix:
python-version:
# As of 2024-06-26, Poetry has started failing to install on 3.7:
# `TypeError: Expected maxsize to be an integer or None`
- '3.8'
- '3.9'
- '3.10'
- '3.11'
poetry-version:
- '1.2.2'
- '1.3.2'
- '1.4.2'
- '1.5.1'
- '1.6.1'
- '1.7.1'
- '1.8.4'
experimental: [false]
unlocked: [false]
include:
- python-version: '3.11'
poetry-version: 'git+https://github.com/python-poetry/poetry.git@main'
experimental: true
- python-version: '3.12'
poetry-version: '1.8.4'
experimental: false
unlocked: true
- python-version: '3.13'
poetry-version: '1.8.4'
experimental: false
unlocked: true
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- if: ${{ startsWith(matrix.poetry-version, 'git') }}
run: |
echo "USE_PEP621=1" >> $GITHUB_ENV
- if: ${{ matrix.unlocked }}
run: |
rm poetry.lock
- run: |
pip install pipx
pipx install ${{ startsWith(matrix.poetry-version, 'git') && matrix.poetry-version || format('poetry=={0}', matrix.poetry-version) }}
pipx install invoke
# We could use `poetry install --extras plugin`,
# but Poetry may decide to install a different version than `matrix.poetry-version`.
poetry install
poetry run pip install ${{ startsWith(matrix.poetry-version, 'git') && matrix.poetry-version || format('poetry=={0}', matrix.poetry-version) }}
invoke test --pipx