path: ./dist/tornado-*.tar.gz
build_wheels:
- name: Build wheels on ${{ matrix.os }}
+ name: Build wheels on ${{ matrix.os }}${{ matrix.name_suffix || '' }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-24.04, ubuntu-24.04-arm, windows-2025, windows-11-arm, macos-15]
+ arch: [auto]
+ include:
+ - os: ubuntu-24.04
+ arch: "riscv64"
+ name_suffix: "-riscv64"
steps:
- uses: actions/checkout@v4
with:
python-version: ${{ env.python-version }}
+ - name: Set up QEMU
+ if: matrix.arch != 'auto'
+ uses: docker/setup-qemu-action@v3
+ with:
+ platforms: ${{ matrix.arch }}
+
- name: Build wheels
uses: pypa/cibuildwheel@v3.4.0
+ env:
+ CIBW_ARCHS: ${{ matrix.arch }}
+ # Increase timeouts for emulated archs
+ CIBW_ENVIRONMENT: ${{ matrix.arch != 'auto' && 'ASYNC_TEST_TIMEOUT=30 EMULATION=1' || '' }}
- name: Audit ABI3 compliance
# This may be moved into cibuildwheel itself in the future. See
- uses: actions/upload-artifact@v4
with:
- name: artifacts-${{ matrix.os }}
+ name: artifacts-${{ matrix.os }}${{ matrix.name_suffix || '' }}
path: ./wheelhouse/*.whl
upload_pypi_test:
dependabot/*: ref-pin
# Additional trusted repositories
pypa/*: ref-pin
- astral-sh/setup-uv: ref-pin
\ No newline at end of file
+ astral-sh/setup-uv: ref-pin
+ docker/setup-qemu-action: ref-pin
import urllib.parse
import unittest
+from tornado.test.util import skipIfEmulated
+
def form_data_args() -> tuple[dict[str, list[bytes]], dict[str, list[HTTPFile]]]:
"""Return two empty dicts suitable for use with parse_multipart_form_data.
c = parse_cookie(encoded)
self.assertEqual(c["a"], decoded)
+ @skipIfEmulated
def test_unquote_large(self):
# Adapted from
# https://github.com/python/cpython/blob/dc7a2b6522ec7af41282bc34f405bee9b306d611/Lib/test/test_http_cookies.py#L87
def test_request_timeout(self):
timeout = 0.1
- if os.name == "nt":
+ if os.name == "nt" or os.environ.get("EMULATION") == "1":
timeout = 0.5
with self.assertRaises(HTTPTimeoutError):
# depend on an external network.
skipIfNoNetwork = unittest.skipIf("NO_NETWORK" in os.environ, "network access disabled")
+# Set the environment variable EMULATION=1 to disable any tests that
+# are unreliable under emulation
+skipIfEmulated = unittest.skipIf(
+ "EMULATION" in os.environ, "test unreliable under emulation"
+)
+
skipNotCPython = unittest.skipIf(
# "CPython" here essentially refers to the traditional synchronous refcounting GC,
# so we skip these tests in free-threading builds of cpython too.