Skip to content

PYTHON-3882 [python-bsonjs] Support Python 3.7-3.12 (#48) #77

PYTHON-3882 [python-bsonjs] Support Python 3.7-3.12 (#48)

PYTHON-3882 [python-bsonjs] Support Python 3.7-3.12 (#48) #77

name: Python Wheels
on:
push:
branches: ["master"]
tags:
- "**"
pull_request:
workflow_dispatch:
concurrency:
group: wheels-${{ github.ref }}
cancel-in-progress: true
jobs:
build-wheels:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [macos-latest, windows-2019, ubuntu-latest]
name: Build CPython ${{ matrix.python-version }}-${{ matrix.os }}
steps:
- uses: actions/checkout@v2
- uses: pypa/[email protected]
env:
CIBW_ARCHS_MACOS: x86_64 universal2
CIBW_TEST_SKIP: '*universal2:arm64'
CIBW_BUILD: "cp37-macosx_x86_64 cp38-macosx_universal2 cp37-win* cp37-manylinux_{x86_64,i686}"
- uses: actions/upload-artifact@v2
with:
name: python_bsonjs-3.7-${{ matrix.os }}-wheel
path: ./wheelhouse/*.whl
if-no-files-found: error
test-non-linux-wheels:
needs: build-wheels
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [macos-latest, windows-2019]
python-version: [3.7, 3.8, 3.9, "3.10", "3.11", "3.12"]
name: Test CPython ${{ matrix.python-version }}-${{ matrix.os }}
steps:
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
allow-prereleases: true
- name: Download a previously created wheel
uses: actions/download-artifact@v2
with:
name: python_bsonjs-3.7-${{ matrix.os }}-wheel
- name: Test wheel
shell: bash
run: |
python -m pip install -U pip
python -m pip install --no-index --find-links=./ python_bsonjs
python -m pip list | grep python-bsonjs
python -c "from bsonjs import dumps"
# Linux
test-manylinux-wheels:
runs-on: ${{ matrix.os }}
needs: build-wheels
strategy:
matrix:
os: [ubuntu-latest]
container: ['manylinux2014_i686', 'manylinux2014_x86_64']
python-version: ['cp37-cp37m', 'cp38-cp38',
'cp39-cp39', 'cp310-cp310', 'cp311-cp311', 'cp312-cp312']
name: Test CPython ${{ matrix.python-version }}-${{ matrix.container }}
steps:
- name: Download a previously created wheel
uses: actions/download-artifact@v2
with:
name: python_bsonjs-3.7-${{ matrix.os }}-wheel
- name: Test wheel
run: |
docker run --rm --volume `pwd`:/python quay.io/pypa/${{ matrix.container }} /bin/bash -c "/opt/python/${{ matrix.python-version }}/bin/python -m pip install -U pip && /opt/python/${{ matrix.python-version }}/bin/python -m pip install --find-links=/python/ --no-index python_bsonjs && /opt/python/${{ matrix.python-version }}/bin/python -m pip list | grep python-bsonjs && /opt/python/${{ matrix.python-version }}/bin/python -c 'from bsonjs import dumps'"
make_sdist:
name: Make SDist
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Build SDist
run: python setup.py sdist --dist-dir=dist --formats=gztar
- uses: actions/upload-artifact@v2
with:
name: "sdist"
path: dist/*.tar.gz
collect-wheels:
runs-on: ubuntu-latest
needs: [build-wheels, make_sdist]
name: Download Wheels
steps:
- name: Download all workflow run artifacts
uses: actions/download-artifact@v2
- name: Flatten directory
run: |
find . -mindepth 2 -type f -exec mv {} . \;
find . -type d -empty -delete
- uses: actions/upload-artifact@v2
with:
name: all-dist
path: "./*"