From a315b4be2b6709f952a144f0686e0a21d3740c97 Mon Sep 17 00:00:00 2001 From: Christian Bundy Date: Mon, 5 Feb 2024 11:35:04 -0800 Subject: [PATCH] Add `linux_aarch64` platform --- .github/workflows/build.yml | 6 +++++- cibuildwheel.toml | 14 ++++++++++++++ 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 6fc95f11..b0dd4c6c 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -39,7 +39,7 @@ jobs: ) echo "include=$MATRIX" | tee -a $GITHUB_OUTPUT env: - CIBW_ARCHS_LINUX: x86_64 + CIBW_ARCHS_LINUX: x86_64 aarch64 CIBW_ARCHS_MACOS: x86_64 arm64 CIBW_ARCHS_WINDOWS: AMD64 @@ -53,6 +53,10 @@ jobs: include: ${{ fromJson(needs.generate_wheels_matrix.outputs.include) }} steps: + - uses: docker/setup-qemu-action@v2 + if: runner.os == 'Linux' + with: + platforms: arm64 - uses: actions/checkout@v4 - name: Checkout mypy shell: bash diff --git a/cibuildwheel.toml b/cibuildwheel.toml index 91a70dd9..94f1e47b 100644 --- a/cibuildwheel.toml +++ b/cibuildwheel.toml @@ -82,3 +82,17 @@ before-test = [ "pip install -r {project}/mypy/test-requirements.txt", ] environment = { MYPYC_OPT_LEVEL="3", MYPYC_DEBUG_LEVEL="0", CC="clang" } + +[[tool.cibuildwheel.overrides]] +select = "*linux_aarch64" +# Only run testcheck, since the other tests are slow and can be flaky (because of TimeoutError). +test-command = """ \ + ( \ + DIR=$(python -c 'import mypy, os; dn = os.path.dirname; print(dn(dn(mypy.__path__[0])))') \ + && cp '{project}/mypy/pyproject.toml' '{project}/mypy/conftest.py' $DIR \ +\ + && MYPY_TEST_DIR=$(python -c 'import mypy.test; print(mypy.test.__path__[0])') \ +\ + && MYPY_TEST_PREFIX='{project}/mypy' pytest $MYPY_TEST_DIR/testcheck.py \ + ) +"""