Skip to content

bump pytest and other deps to hopefully support 3.12 #1417

bump pytest and other deps to hopefully support 3.12

bump pytest and other deps to hopefully support 3.12 #1417

Workflow file for this run

name: CI
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
release:
types: [ published ]
jobs:
Merge-Dependabot:
if: github.event_name == 'pull_request'
timeout-minutes: 1
runs-on: ubuntu-latest
permissions:
pull-requests: write
contents: write
steps:
- uses: fastify/github-action-merge-dependabot@v3.9.0
with:
merge-method: merge
use-github-auto-merge: true
Verify:
name: 'Verify requirement pinning'
timeout-minutes: 2
runs-on: 'ubuntu-latest'
steps:
- name: Checkout
uses: actions/checkout@v3.5.3
- name: Setup python
uses: actions/setup-python@v4.6.1
with:
python-version: "3.11"
- name: Install requirements
run: |
python -m pip install -U pip
# Optimistically assume SHA checks won't change much
python -m pip install pip-compile-multi
- name: Verify requirements
run: pip-compile-multi verify
Blacken:
name: 'Formatting and linting'
timeout-minutes: 2
runs-on: 'ubuntu-latest'
steps:
- name: Checkout
uses: actions/checkout@v3.5.3
- name: Setup python
uses: actions/setup-python@v4.6.1
with:
cache: pip
cache-dependency-path: requirements/lint.txt
python-version: "3.11"
- name: Install requirements
run: |
python -m pip install -U pip
python -m pip install -r requirements/lint.txt
- name: Run Black
id: black
run: black --check --diff trio_parallel _trio_parallel_workers
continue-on-error: true
- name: Run flake8
id: flake8
run: |
flake8 --extend-ignore=D,E,W,F401,F403,F405,F821,F822,TRIO114 \
--extend-select=TRIO900,TRIO910,TRIO911
continue-on-error: true
- name: Fail on error
if: steps.black.outcome != 'success' || steps.flake8.outcome != 'success'
run: exit 1
Build:
name: Build
timeout-minutes: 5
runs-on: ubuntu-latest
outputs:
wheelname: ${{ steps.outputs.outputs.wheelname }}
settings: ${{ steps.outputs.outputs.settings }}
steps:
- name: Checkout
uses: actions/checkout@v3.5.3
with:
fetch-depth: 0
- name: Setup python
uses: actions/setup-python@v4.6.1
with:
cache: pip
cache-dependency-path: requirements/build.txt
python-version: "3.11"
- name: Install requirements
run: |
python -m pip install -U pip
python -m pip install -r requirements/build.txt
- name: Build sdist wheel
run: |
SOURCE_DATE_EPOCH=$(git log -1 --pretty=%ct) \
python -m build --no-isolation # already isolated & build deps pinned
- name: Check distribution
run: |
python -m pip install twine
twine check --strict dist/*
- name: Set outputs
id: outputs
run: |
echo "wheelname=$( echo ./dist/*.whl )" >> $GITHUB_OUTPUT
echo "settings=$(
tar cz \
pyproject.toml \
requirements/install.txt \
requirements/test.txt \
| base64 -w 0
)" >> $GITHUB_OUTPUT
cd dist && sha256sum * >> $GITHUB_STEP_SUMMARY
- name: Upload build artifact
uses: actions/upload-artifact@v3.1.2
with:
name: Build
# by default build puts sdist and wheel here
path: dist/
if-no-files-found: error
Test:
name: 'Test ${{ matrix.os }} (${{ matrix.python }} ${{ matrix.arch }})'
needs: Build
timeout-minutes: 10
runs-on: ${{ matrix.os }}
continue-on-error: ${{ matrix.experimental }}
strategy:
fail-fast: false
matrix:
experimental: [ false ]
test-timeout: [ 10 ]
os:
- windows-latest
- ubuntu-latest
- macos-latest
python:
- '3.7'
- '3.8'
- '3.9'
- '3.10'
- '3.11'
- 'pypy-3.7'
- 'pypy-3.8'
- 'pypy-3.9'
arch: [ x64 ]
include:
- os: ubuntu-latest
python: 'pypy-3.9-nightly'
arch: x64
experimental: true
test-timeout: 10
- os: ubuntu-latest
python: '3.12-dev'
arch: x64
experimental: true
test-timeout: 3
- os: windows-latest
python: '3.7'
arch: x86
experimental: false
test-timeout: 10
exclude:
- os: macos-latest
python: 'pypy-3.7'
- os: macos-latest
python: 'pypy-3.9'
steps:
- name: Input settings
run: echo "${{ needs.Build.outputs.settings }}" | base64 -d | tar xz
shell: bash
- name: Setup python
uses: actions/setup-python@v4.6.1
with:
cache: pip
cache-dependency-path: requirements/test.txt
python-version: '${{ matrix.python }}'
architecture: '${{ matrix.arch }}'
- name: Download build artifact
uses: actions/download-artifact@v3.0.2
with:
name: Build
path: dist
- name: Install requirements
run: |
python -m pip install -U pip
python -m pip install -r requirements/test.txt
- name: Install wheel
run: |
python -m pip install ${{ needs.Build.outputs.wheelname }} --no-deps
- name: Run tests
timeout-minutes: ${{ matrix.test-timeout }}
run: |
pytest trio_parallel --cov-report xml:coverage-${{ matrix.os }}-${{ matrix.arch }}-${{ matrix.python }}.xml
coverage report
mv .coverage .coverage.${{ matrix.os }}-${{ matrix.arch }}-${{ matrix.python }}
shell: bash
- name: Upload coverage
if: always()
uses: actions/upload-artifact@v3.1.2
with:
name: Coverage
path: "*coverage*${{ matrix.os }}-${{ matrix.arch }}-${{ matrix.python }}*"
if-no-files-found: error
Examples:
name: 'Test examples ${{ matrix.os }} (${{ matrix.python }} ${{ matrix.arch }})'
timeout-minutes: 10
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os:
- windows-latest
- ubuntu-latest
- macos-latest
python:
- '3.11'
arch:
- x64
steps:
- name: Checkout
uses: actions/checkout@v3.5.3
- name: Setup python
uses: actions/setup-python@v4.6.1
with:
cache: pip
cache-dependency-path: requirements/test.txt
python-version: '${{ matrix.python }}'
architecture: '${{ matrix.arch }}'
- name: Install requirements
run: |
python -m pip install -U pip
python -m pip install -r requirements/test.txt
- name: Install editable source
run: |
python -m pip install -e . --no-deps
- name: Run tests
run: |
python -m pytest --no-cov docs/source
Extras:
name: 'Test [test] extra'
timeout-minutes: 5
runs-on: ubuntu-latest
needs: Build
steps:
- name: Setup python
uses: actions/setup-python@v4.6.1
with:
python-version: '3.11'
- name: Download build artifact
uses: actions/download-artifact@v3.0.2
with:
name: Build
path: dist
- name: Run tests
run: |
python -m pip install ${{ needs.Build.outputs.wheelname }}[test]
pytest --pyargs trio_parallel
Codecov: # Codecov is naughty and will be forever isolated
name: Codecov
if: always()
needs: Test
timeout-minutes: 1
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3.5.3
- name: Download coverage artifact
uses: actions/download-artifact@v3.0.2
with:
name: Coverage
- name: Upload to Codecov
uses: codecov/codecov-action@v3.1.4
with:
fail_ci_if_error: true
Coverage:
name: Coverage
if: always()
needs: Test
timeout-minutes: 1
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3.5.3
- name: Download coverage artifact
uses: actions/download-artifact@v3.0.2
with:
name: Coverage
- name: Setup python
uses: actions/setup-python@v4.6.1
with:
cache: pip
cache-dependency-path: requirements/coverage.txt
python-version: "3.11"
- name: Install coverage
run: |
pip install -U pip
pip install -r requirements/coverage.txt
- name: Run coverage
run: |
coverage combine
coverage html
coverage report --fail-under=100 --show-missing --format markdown \
>> $GITHUB_STEP_SUMMARY
- name: Upload report
if: always()
uses: actions/upload-artifact@v3.1.2
with:
name: Report
path: htmlcov/
if-no-files-found: error
All:
name: All checks and tests
if: always()
timeout-minutes: 1
needs: [ Verify, Blacken, Build, Examples, Test, Extras, Codecov, Coverage ]
runs-on: ubuntu-latest
steps:
- name: Check all needs have passed
uses: re-actors/alls-green@v1.2.2
with:
jobs: ${{ toJSON(needs) }}
Publish:
name: Publish
if: github.event_name == 'release'
needs: All
timeout-minutes: 1
runs-on: ubuntu-latest
steps:
- name: Download build artifact
uses: actions/download-artifact@v3.0.2
with:
name: Build
path: dist
- name: Setup python
uses: actions/setup-python@v4.6.1
with:
python-version: "3.11"
- name: Install requirements
run: |
python -m pip install -U pip
python -m pip install twine
- name: Publish to Pypi
run: twine upload dist/*
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
- name: Upload to GitHub
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh release upload ${{ github.ref_name }} dist/* --repo ${{ github.repository }}