diff --git a/.github/workflows/build-wheels.yml b/.github/workflows/build-wheels.yml index 6a371db..b7d2c72 100644 --- a/.github/workflows/build-wheels.yml +++ b/.github/workflows/build-wheels.yml @@ -7,8 +7,9 @@ jobs: name: Build wheels on ${{ matrix.os }} runs-on: ${{ matrix.os }} strategy: + fail-fast: false matrix: - os: [ubuntu-20.04, windows-2019, macos-10.15] + os: [ubuntu-20.04, windows-2019, macos-11] steps: - uses: actions/checkout@v2 @@ -20,11 +21,8 @@ jobs: with: platforms: all - name: Build wheels - uses: pypa/cibuildwheel@v2.0.1 + uses: pypa/cibuildwheel@v2.8.1 with: output-dir: ./wheelhouse env: - CIBW_BUILD: "cp36-* cp37-* cp38-* cp39-* cp310-*" - CIBW_ARCHS_LINUX: auto aarch64 CIBW_PRERELEASE_PYTHONS: True - CIBW_BEFORE_ALL_LINUX: yum install -y libffi-devel diff --git a/.github/workflows/release-wheels.yml b/.github/workflows/release-wheels.yml index 1b4cc71..8122ec0 100644 --- a/.github/workflows/release-wheels.yml +++ b/.github/workflows/release-wheels.yml @@ -11,7 +11,7 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - os: [ubuntu-20.04, windows-2019, macos-10.15] + os: [ubuntu-20.04, windows-2019, macos-11] steps: - uses: actions/checkout@v2 @@ -23,14 +23,9 @@ jobs: with: platforms: all - name: Build wheels - uses: pypa/cibuildwheel@v2.0.1 + uses: pypa/cibuildwheel@v2.8.1 with: output-dir: ./wheelhouse - env: - CIBW_BUILD: "cp36-* cp37-* cp38-* cp39-* cp310-*" - CIBW_ARCHS_LINUX: auto aarch64 - CIBW_PRERELEASE_PYTHONS: True - CIBW_BEFORE_ALL_LINUX: yum install -y libffi-devel - uses: actions/upload-artifact@v2 with: path: ./wheelhouse/*.whl diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index d49f77a..87bbea6 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -9,7 +9,7 @@ jobs: strategy: fail-fast: false matrix: - os: [ubuntu-20.04, windows-2019, macos-10.15] + os: [ubuntu-20.04, windows-2019, macos-11] python-version: [ '3.6', '3.7', '3.8', '3.9', '3.10'] steps: - uses: actions/checkout@v2 @@ -22,6 +22,6 @@ jobs: - name: Install dependencies run: python -m pip install -U setuptools wheel - name: Build package - run: python setup.py install + run: python -m pip install . - name: Run tests run: python tests/tests.py diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..a0d0af7 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,27 @@ +[build-system] +requires = ["setuptools", "wheel", "cffi>=1.5.0"] +build-backend = "setuptools.build_meta" + +[tool.cibuildwheel] +build = "cp3*" + +[tool.cibuildwheel.linux] +archs = ["auto", "aarch64"] +before-all = """ +set -eux +# musllinux_* +if command -v apk; then + apk add libffi-dev +fi +# manylinux_2_24 +if command -v apt; then + apt install libffi-dev +fi +# manylinux_* +if command -v yum; then + yum install -y libffi-devel +fi +""" + +[tool.cibuildwheel.macos] +archs = ["x86_64", "universal2"] diff --git a/setup.py b/setup.py index 2b7a505..7a5d08e 100755 --- a/setup.py +++ b/setup.py @@ -2,7 +2,12 @@ # -*- coding: utf-8 -*- import codecs +import os import re +import sys + +# we have to import setup_cares.py which is in project's root folder +sys.path.insert(0, os.path.dirname(os.path.realpath(__file__))) from setuptools import setup @@ -40,7 +45,6 @@ def get_version(): 'Programming Language :: Python :: Implementation :: PyPy', ], cmdclass = {'build_ext': cares_build_ext}, - setup_requires = ['cffi>=1.5.0'], install_requires = ['cffi>=1.5.0'], extras_require = {'idna': ['idna >= 2.1']}, cffi_modules = ['src/_cffi_src/build_cares.py:ffi'],