diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 75e0e18..6947f41 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -140,11 +140,14 @@ jobs: pip install -U pip pip install -U setuptools wheel twine cffi - - name: Build AccessControl (Python 3.10 and 3.11 on MacOS) + - name: Build AccessControl (macOS x86_64, Python 3.8+) if: > startsWith(runner.os, 'Mac') - && (startsWith(matrix.python-version, '3.10') - || startsWith(matrix.python-version, '3.11')) + && !(startsWith(matrix.python-version, 'pypy') + || matrix.python-version == '2.7' + || matrix.python-version == '3.5' + || matrix.python-version == '3.6' + || matrix.python-version == '3.7') env: MACOSX_DEPLOYMENT_TARGET: 10.9 _PYTHON_HOST_PLATFORM: macosx-10.9-x86_64 @@ -154,21 +157,40 @@ jobs: # output (pip install uses a random temporary directory, making this difficult). python setup.py build_ext -i python setup.py bdist_wheel - # Also install it, so that we get dependencies in the (pip) cache. - pip install -U 'faulthandler; python_version == "2.7" and platform_python_implementation == "CPython"' - pip install .[test] - + - name: Build AccessControl (macOS arm64, Python 3.8+) + if: > + startsWith(runner.os, 'Mac') + && !(startsWith(matrix.python-version, 'pypy') + || matrix.python-version == '2.7' + || matrix.python-version == '3.5' + || matrix.python-version == '3.6' + || matrix.python-version == '3.7') + env: + MACOSX_DEPLOYMENT_TARGET: 11.0 + _PYTHON_HOST_PLATFORM: macosx-11.0-arm64 + ARCHFLAGS: -arch arm64 + run: | + # Next, build the wheel *in place*. This helps ccache, and also lets us cache the configure + # output (pip install uses a random temporary directory, making this difficult). + python setup.py build_ext -i + python setup.py bdist_wheel - name: Build AccessControl (all other versions) if: > !startsWith(runner.os, 'Mac') - || !(startsWith(matrix.python-version, '3.10') - || startsWith(matrix.python-version, '3.11')) + || startsWith(matrix.python-version, 'pypy') + || matrix.python-version == '2.7' + || matrix.python-version == '3.5' + || matrix.python-version == '3.6' + || matrix.python-version == '3.7' run: | # Next, build the wheel *in place*. This helps ccache, and also lets us cache the configure # output (pip install uses a random temporary directory, making this difficult). python setup.py build_ext -i python setup.py bdist_wheel - # Also install it, so that we get dependencies in the (pip) cache. + + - name: Install AccessControl and dependencies + run: | + # Install to collect dependencies into the (pip) cache. pip install -U 'faulthandler; python_version == "2.7" and platform_python_implementation == "CPython"' pip install .[test] @@ -176,7 +198,31 @@ jobs: run: | ls -l dist twine check dist/* - - name: Upload AccessControl wheel + - name: Upload AccessControl wheel (macOS x86_64) + if: > + startsWith(runner.os, 'Mac') + uses: actions/upload-artifact@v3 + with: + name: AccessControl-${{ runner.os }}-${{ matrix.python-version }}.whl + path: dist/*x86_64.whl + - name: Upload AccessControl wheel (macOS arm64) + if: > + startsWith(runner.os, 'Mac') + && !(startsWith(matrix.python-version, 'pypy') + || matrix.python-version == '2.7' + || matrix.python-version == '3.5' + || matrix.python-version == '3.6' + || matrix.python-version == '3.7') + uses: actions/upload-artifact@v3 + with: + # The arm64 wheel is uploaded with a different name just so it can be + # manually downloaded when desired. The wheel itself *cannot* be tested + # on the GHA runner, which uses x86_64 architecture. + name: AccessControl-${{ runner.os }}-${{ matrix.python-version }}-arm64.whl + path: dist/*arm64.whl + - name: Upload AccessControl wheel (all other platforms) + if: > + !startsWith(runner.os, 'Mac') uses: actions/upload-artifact@v3 with: name: AccessControl-${{ runner.os }}-${{ matrix.python-version }}.whl diff --git a/.meta.toml b/.meta.toml index e3aa275..365f30d 100644 --- a/.meta.toml +++ b/.meta.toml @@ -2,7 +2,7 @@ # https://github.com/zopefoundation/meta/tree/master/config/c-code [meta] template = "c-code" -commit-id = "f9d86135b0fe60f778df1c75c869f61449eff05e" +commit-id = "57e4030390098babcc18db626cc426388394c231" [python] with-appveyor = true diff --git a/CHANGES.rst b/CHANGES.rst index 6abcb9d..2c77604 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -6,6 +6,8 @@ For changes before version 3.0, see ``HISTORY.rst``. 5.7 (unreleased) ---------------- +- Add support for building arm64 wheels on macOS. + 5.6 (2022-11-03) ----------------