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

Add support for Python 3.10 and musl-based runtimes #629

Merged
merged 16 commits into from
Oct 1, 2021
99 changes: 31 additions & 68 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@ on:
push:
branches:
- master
- '[0-9].[0-9]+' # matches to backport branches, e.g. 3.6
- '[0-9].[0-9]+' # matches to backport branches, e.g. 3.6
tags: [ 'v*' ]
pull_request:
branches:
- master
- '[0-9].[0-9]+' # matches to backport branches, e.g. 3.6
- '[0-9].[0-9]+' # matches to backport branches, e.g. 3.6
schedule:
- cron: '0 6 * * *' # Daily 6AM UTC build


jobs:

Expand Down Expand Up @@ -63,7 +63,7 @@ jobs:
needs: lint
strategy:
matrix:
pyver: [3.6, 3.7, 3.8, 3.9]
pyver: [3.6, 3.7, 3.8, 3.9, 3.10.0-rc.2]
no-extensions: ['', 'Y']
os: [ubuntu, macos, windows]
exclude:
Expand Down Expand Up @@ -134,10 +134,10 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v2.3.4
- name: Setup Python 3.8
- name: Setup Python 3.9
uses: actions/setup-python@v2.2.2
with:
python-version: 3.8
python-version: 3.9
asvetlov marked this conversation as resolved.
Show resolved Hide resolved
- name: Make sdist
run:
python setup.py sdist
Expand All @@ -147,86 +147,47 @@ jobs:
name: dist
path: dist

build-linux:
name: Linux
build-wheels:
name: Build wheels on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
needs: pre-deploy
strategy:
matrix:
pyver: [cp36-cp36m, cp37-cp37m, cp38-cp38, cp39-cp39]
arch: [x86_64, aarch64, i686, ppc64le, s390x]
os: [ubuntu-20.04, windows-2019, macos-10.15]
fail-fast: false
runs-on: ubuntu-latest
env:
py: /opt/python/${{ matrix.pyver }}/bin/python
img: quay.io/pypa/manylinux2014_${{ matrix.arch }}
needs: pre-deploy
steps:
- name: Checkout
uses: actions/checkout@v2.3.4
- name: Set up QEMU
id: qemu
if: runner.os == 'Linux'
uses: docker/setup-qemu-action@v1
- name: Available platforms
run: echo ${{ steps.qemu.outputs.platforms }}
- name: Install tools
run: |
docker run --rm -v ${{ github.workspace }}:/ws:rw --workdir=/ws \
${{ env.img }} ${{ env.py }} -m pip install -U setuptools wheel
- name: Make wheel
run: |
docker run --rm -v ${{ github.workspace }}:/ws:rw --workdir=/ws \
${{ env.img }} ${{ env.py }} setup.py bdist_wheel
- name: Repair wheel wheel
run: |
docker run --rm -v ${{ github.workspace }}:/ws:rw --workdir=/ws \
${{ env.img }} auditwheel repair dist/*.whl --wheel-dir wheelhouse/
- name: Upload artifacts
uses: actions/upload-artifact@v2
with:
name: dist
path: wheelhouse/*

build-binary:
name: Binary wheels
strategy:
matrix:
pyver: [3.6, 3.7, 3.8, 3.9]
os: [macos, windows]
arch: [x86, x64]
exclude:
- os: macos
arch: x86
fail-fast: false
runs-on: ${{ matrix.os }}-latest
needs: pre-deploy
steps:
- name: Checkout
uses: actions/checkout@v2.3.4
- name: Setup Python 3.8
uses: actions/setup-python@v2.2.2
with:
python-version: ${{ matrix.pyver }}
architecture: ${{ matrix.arch }}
- name: Install dependencies
run: |
python -m pip install -U setuptools wheel
- name: Make wheel
run:
python setup.py bdist_wheel
- name: Upload artifacts
uses: actions/upload-artifact@v2
platforms: all
id: qemu
- name: Available platforms
if: runner.os == 'Linux'
run: echo "${{ steps.qemu.outputs.platforms }}"
- name: Build wheels
uses: pypa/cibuildwheel@v2.2.0a1
env:
# configure cibuildwheel to build native archs ('auto'), and some
# emulated ones
CIBW_ARCHS_LINUX: auto aarch64 ppc64le s390x
CIBW_ARCHS_MACOS: x86_64 arm64 universal2
- uses: actions/upload-artifact@v2
with:
name: dist
path: dist
path: ./wheelhouse/*.whl

deploy:
name: Deploy
needs: [build-linux, build-binary, build-tarball]
needs: [build-tarball, build-wheels]
runs-on: ubuntu-latest
steps:
- name: Setup Python 3.8
- name: Setup Python 3.9
uses: actions/setup-python@v2.2.2
with:
python-version: 3.8
python-version: 3.9
- name: Install twine
run: |
python -m pip install twine
Expand All @@ -235,6 +196,8 @@ jobs:
with:
name: dist
path: dist
- name: Count dists
run: echo "$(ls dist|wc -l) distributions to upload"
- name: PyPI upload
env:
TWINE_USERNAME: __token__
Expand Down
1 change: 1 addition & 0 deletions CHANGES/629.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Added support for Python 3.10 and started shipping platform-specific wheels with the ``musl`` tag targeting typical Alpine Linux runtimes.
2 changes: 1 addition & 1 deletion multidict/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"getversion",
)

__version__ = "5.1.0"
__version__ = "5.2.0a6"


try:
Expand Down
7 changes: 7 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,10 @@ directory = "CHANGES/"
title_format = "{version} ({project_date})"
template = "CHANGES/.TEMPLATE.rst"
issue_format = "`#{issue} <https://github.com/aio-libs/multidict/issues/{issue}>`_"


[tool.cibuildwheel]
test-requires = "-r requirements/ci.txt"
test-command = "pytest {project}/tests"
# don't build PyPy wheels, install from source instead
skip = "pp*"
1 change: 1 addition & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ def read(f):
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Development Status :: 5 - Production/Stable",
],
author="Andrew Svetlov",
Expand Down