diff --git a/.circleci/config.yml b/.circleci/config.yml index 5c8bef6f6..0f4fe1218 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1,67 +1,67 @@ -version: 2 +# version: 2 -jobs: - osx-python3.12: - macos: - xcode: 15.4.0 - resource_class: macos.m1.medium.gen1 - environment: - PYTHON: python3 - steps: - - checkout +# jobs: +# osx-python3.12: +# macos: +# xcode: 15.4.0 +# resource_class: macos.m1.medium.gen1 +# environment: +# PYTHON: python3 +# steps: +# - checkout - - run: - name: Prepare the environment. - command: bash .circleci/prepare.sh - - run: - name: Test. - command: venv/bin/python ./bin/run_tests.py - no_output_timeout: 30m +# - run: +# name: Prepare the environment. +# command: bash .circleci/prepare.sh +# - run: +# name: Test. +# command: venv/bin/python ./bin/run_tests.py +# no_output_timeout: 30m - linux-python3.12: - docker: - - image: cimg/python:3.12 - environment: - PYTHON: python3 - # Temporarily restrict the tests that are run on CircleCI to prevent - # test timeouts. - PYTEST_ADDOPTS: -k "unit_test or main_tests or test_0_basic or test_docker_images" - steps: - - checkout - - setup_remote_docker +# # linux-python3.12: +# # docker: +# # - image: cimg/python:3.12 +# # environment: +# # PYTHON: python3 +# # # Temporarily restrict the tests that are run on CircleCI to prevent +# # # test timeouts. +# # PYTEST_ADDOPTS: -k "unit_test or main_tests or test_0_basic or test_docker_images" +# # steps: +# # - checkout +# # - setup_remote_docker - - run: - name: Prepare the environment. - command: bash .circleci/prepare.sh - - run: - name: Test. - command: venv/bin/python ./bin/run_tests.py - no_output_timeout: 30m +# # - run: +# # name: Prepare the environment. +# # command: bash .circleci/prepare.sh +# # - run: +# # name: Test. +# # command: venv/bin/python ./bin/run_tests.py +# # no_output_timeout: 30m - linux-aarch64: - machine: - image: default - resource_class: arm.medium - environment: - PYTHON: python3 - # Temporarily restrict the tests that are run on CircleCI to prevent - # test timeouts. - PYTEST_ADDOPTS: -k "unit_test or main_tests or test_0_basic or test_docker_images" - steps: - - checkout +# # linux-aarch64: +# # machine: +# # image: default +# # resource_class: arm.medium +# # environment: +# # PYTHON: python3 +# # # Temporarily restrict the tests that are run on CircleCI to prevent +# # # test timeouts. +# # PYTEST_ADDOPTS: -k "unit_test or main_tests or test_0_basic or test_docker_images" +# # steps: +# # - checkout - - run: - name: Prepare the environment. - command: bash .circleci/prepare.sh - - run: - name: Test. - command: venv/bin/python ./bin/run_tests.py - no_output_timeout: 30m +# # - run: +# # name: Prepare the environment. +# # command: bash .circleci/prepare.sh +# # - run: +# # name: Test. +# # command: venv/bin/python ./bin/run_tests.py +# # no_output_timeout: 30m -workflows: - version: 2 - all-tests: - jobs: - - osx-python3.12 - - linux-python3.12 - - linux-aarch64 +# workflows: +# version: 2 +# all-tests: +# jobs: +# - osx-python3.12 +# # - linux-python3.12 +# # - linux-aarch64 diff --git a/.cirrus.yml b/.cirrus.yml index 6c13ee1a7..88057f6ad 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -7,82 +7,82 @@ run_tests: &RUN_TESTS run_cibuildwheel_tests_script: - python ./bin/run_tests.py -linux_x86_task: - timeout_in: 120m - compute_engine_instance: - image_project: cirrus-images - image: family/docker-builder - platform: linux - cpu: 8 - memory: 8G - env: - VENV_ROOT: ${HOME}/venv-cibuildwheel - PATH: ${VENV_ROOT}/bin:${PATH} - install_pre_requirements_script: - - docker run --rm --privileged docker.io/tonistiigi/binfmt:latest --install all - - add-apt-repository -y ppa:deadsnakes/ppa - - apt-get update - - apt-get install -y python3.12-venv - - python3.12 -m venv ${VENV_ROOT} - <<: *RUN_TESTS +# linux_x86_task: +# timeout_in: 120m +# compute_engine_instance: +# image_project: cirrus-images +# image: family/docker-builder +# platform: linux +# cpu: 8 +# memory: 8G +# env: +# VENV_ROOT: ${HOME}/venv-cibuildwheel +# PATH: ${VENV_ROOT}/bin:${PATH} +# install_pre_requirements_script: +# - docker run --rm --privileged docker.io/tonistiigi/binfmt:latest --install all +# - add-apt-repository -y ppa:deadsnakes/ppa +# - apt-get update +# - apt-get install -y python3.12-venv +# - python3.12 -m venv ${VENV_ROOT} +# <<: *RUN_TESTS -linux_aarch64_task: - compute_engine_instance: - image_project: cirrus-images - image: family/docker-builder-arm64 - architecture: arm64 - platform: linux - cpu: 4 - memory: 4G - env: - VENV_ROOT: ${HOME}/venv-cibuildwheel - PATH: ${VENV_ROOT}/bin:${PATH} - install_pre_requirements_script: - - docker run --rm --privileged docker.io/tonistiigi/binfmt:latest --install all - - add-apt-repository -y ppa:deadsnakes/ppa - - apt-get update - - apt-get install -y python3.12-venv - - python3.12 -m venv ${VENV_ROOT} - <<: *RUN_TESTS +# linux_aarch64_task: +# compute_engine_instance: +# image_project: cirrus-images +# image: family/docker-builder-arm64 +# architecture: arm64 +# platform: linux +# cpu: 4 +# memory: 4G +# env: +# VENV_ROOT: ${HOME}/venv-cibuildwheel +# PATH: ${VENV_ROOT}/bin:${PATH} +# install_pre_requirements_script: +# - docker run --rm --privileged docker.io/tonistiigi/binfmt:latest --install all +# - add-apt-repository -y ppa:deadsnakes/ppa +# - apt-get update +# - apt-get install -y python3.12-venv +# - python3.12 -m venv ${VENV_ROOT} +# <<: *RUN_TESTS -windows_x86_task: - # The task takes ~55 minutes while the timeout happens - # after 60 minutes by default, let's allow some wiggle room. - timeout_in: 120m - windows_container: - image: cirrusci/windowsservercore:visualstudio2022 - cpu: 8 - memory: 8G +# windows_x86_task: +# # The task takes ~55 minutes while the timeout happens +# # after 60 minutes by default, let's allow some wiggle room. +# timeout_in: 120m +# windows_container: +# image: cirrusci/windowsservercore:visualstudio2022 +# cpu: 8 +# memory: 8G - install_pre_requirements_script: - - choco install -y --no-progress python3 --version 3.12.4 - - refreshenv - - echo PATH=%PATH% >> "%CIRRUS_ENV%" - <<: *RUN_TESTS +# install_pre_requirements_script: +# - choco install -y --no-progress python3 --version 3.12.4 +# - refreshenv +# - echo PATH=%PATH% >> "%CIRRUS_ENV%" +# <<: *RUN_TESTS -macos_arm64_task: - macos_instance: - image: ghcr.io/cirruslabs/macos-runner:sonoma - env: - VENV_ROOT: ${HOME}/venv-cibuildwheel - PATH: ${VENV_ROOT}/bin:${PATH} - install_pre_requirements_script: - - brew install python@3.12 - - python3.12 -m venv ${VENV_ROOT} - <<: *RUN_TESTS +# macos_arm64_task: +# macos_instance: +# image: ghcr.io/cirruslabs/macos-runner:sonoma +# env: +# VENV_ROOT: ${HOME}/venv-cibuildwheel +# PATH: ${VENV_ROOT}/bin:${PATH} +# install_pre_requirements_script: +# - brew install python@3.12 +# - python3.12 -m venv ${VENV_ROOT} +# <<: *RUN_TESTS -macos_arm64_cp38_task: - macos_instance: - image: ghcr.io/cirruslabs/macos-runner:sonoma - env: - VENV_ROOT: ${HOME}/venv-cibuildwheel - PATH: ${VENV_ROOT}/bin:${PATH} - PYTEST_ADDOPTS: --run-cp38-universal2 -k 'test_cp38_arm64_testing_universal2_installer or test_arch_auto' - install_pre_requirements_script: - - brew install python@3.12 - - python3.12 -m venv ${VENV_ROOT} - - curl -fsSLO https://www.python.org/ftp/python/3.8.10/python-3.8.10-macos11.pkg - - sudo installer -pkg python-3.8.10-macos11.pkg -target / - - rm python-3.8.10-macos11.pkg - - sh "/Applications/Python 3.8/Install Certificates.command" - <<: *RUN_TESTS +# macos_arm64_cp38_task: +# macos_instance: +# image: ghcr.io/cirruslabs/macos-runner:sonoma +# env: +# VENV_ROOT: ${HOME}/venv-cibuildwheel +# PATH: ${VENV_ROOT}/bin:${PATH} +# PYTEST_ADDOPTS: --run-cp38-universal2 -k 'test_cp38_arm64_testing_universal2_installer or test_arch_auto' +# install_pre_requirements_script: +# - brew install python@3.12 +# - python3.12 -m venv ${VENV_ROOT} +# - curl -fsSLO https://www.python.org/ftp/python/3.8.10/python-3.8.10-macos11.pkg +# - sudo installer -pkg python-3.8.10-macos11.pkg -target / +# - rm python-3.8.10-macos11.pkg +# - sh "/Applications/Python 3.8/Install Certificates.command" +# <<: *RUN_TESTS diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 6d690562d..bd671f671 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -17,30 +17,32 @@ concurrency: cancel-in-progress: true jobs: - lint: - name: Linters (mypy, flake8, etc.) - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - uses: actions/setup-python@v5 - id: python - with: - python-version: "3.x" - - uses: pre-commit/action@v3.0.1 - - name: PyLint checks - run: pipx run --python "${{ steps.python.outputs.python-path }}" nox -s pylint -- --output-format=github + # lint: + # name: Linters (mypy, flake8, etc.) + # runs-on: ubuntu-latest + # steps: + # - uses: actions/checkout@v4 + # - uses: actions/setup-python@v5 + # id: python + # with: + # python-version: "3.x" + # - uses: pre-commit/action@v3.0.1 + # - name: PyLint checks + # run: pipx run --python "${{ steps.python.outputs.python-path }}" nox -s pylint -- --output-format=github test: name: Test on ${{ matrix.os }} (${{ matrix.python_version }}) - needs: lint + # needs: lint runs-on: ${{ matrix.os }} strategy: + fail-fast: false matrix: - os: [ubuntu-latest, ubuntu-24.04-arm, windows-latest, macos-13, macos-14] + # os: [ubuntu-latest, ubuntu-24.04-arm, windows-latest, macos-13, macos-15] + os: [macos-13, macos-15] python_version: ['3.13'] - include: - - os: ubuntu-latest - python_version: '3.11' + # include: + # - os: ubuntu-latest + # python_version: '3.11' timeout-minutes: 180 steps: - uses: actions/checkout@v4 @@ -73,141 +75,157 @@ jobs: run: | uv sync --no-dev --group test - - name: Generate a sample project - run: | - uv run -m test.test_projects test.test_0_basic.basic_project sample_proj - - - name: Run a sample build (GitHub Action) - uses: ./ - with: - package-dir: sample_proj - output-dir: wheelhouse - env: - CIBW_ARCHS_MACOS: x86_64 universal2 arm64 - CIBW_BUILD_FRONTEND: 'build[uv]' - CIBW_ENABLE: "cpython-prerelease cpython-freethreading pypy" - - - name: Run a sample build (GitHub Action, only) - uses: ./ - with: - package-dir: sample_proj - output-dir: wheelhouse_only - only: cp312-${{ runner.os == 'Linux' && (runner.arch == 'ARM64' && 'manylinux_aarch64' || 'manylinux_x86_64') || (runner.os == 'Windows' && 'win_amd64' || 'macosx_x86_64') }} - - - name: Create custom configuration file - shell: bash - run: | - cat > sample_proj/cibw.toml < sample_proj/cibw.toml <> "$GITHUB_OUTPUT" - - test-emulated: - name: Test Linux ${{ matrix.arch }} using qemu - needs: emulated-archs - runs-on: ubuntu-latest - timeout-minutes: 180 - strategy: - matrix: - arch: ${{ fromJSON(needs.emulated-archs.outputs.archs) }} - steps: - - uses: actions/checkout@v4 - - uses: actions/setup-python@v5 - with: - python-version: "3.x" - - uses: astral-sh/setup-uv@v5 - - name: Install dependencies - run: uv sync --no-dev --group test - - - name: Set up QEMU - uses: docker/setup-qemu-action@v3 - with: - # This should be temporary - # xref https://github.com/docker/setup-qemu-action/issues/188 - # xref https://github.com/tonistiigi/binfmt/issues/215 - image: tonistiigi/binfmt:qemu-v8.1.5 - - - name: Run the emulation tests - run: uv run pytest --run-emulation ${{ matrix.arch }} test/test_emulation.py - - test-pyodide: - name: Test cibuildwheel building Pyodide wheels - needs: lint - runs-on: ubuntu-24.04 - timeout-minutes: 180 - steps: - - uses: actions/checkout@v4 - - uses: actions/setup-python@v5 - name: Install Python 3.12 - with: - python-version: '3.12' - - uses: astral-sh/setup-uv@v5 - - - name: Install dependencies - run: uv sync --no-dev --group test - - - name: Generate a sample project - run: | - uv run -m test.test_projects test.test_0_basic.basic_project sample_proj - - - name: Run a sample build (GitHub Action) - uses: ./ - with: - package-dir: sample_proj - output-dir: wheelhouse - env: - CIBW_PLATFORM: pyodide - - - name: Run tests with 'CIBW_PLATFORM' set to 'pyodide' - run: | - uv run ./bin/run_tests.py - env: - CIBW_PLATFORM: pyodide + # emulated-archs: + # name: Get qemu emulated architectures + # needs: lint + # runs-on: ubuntu-latest + # outputs: + # archs: ${{ steps.archs.outputs.archs }} + # steps: + # - uses: actions/checkout@v4 + # - uses: actions/setup-python@v5 + # with: + # python-version: "3.x" + # - uses: astral-sh/setup-uv@v5 + # - name: Install dependencies + # run: uv sync --no-dev --group test + # - name: Get qemu emulated architectures + # id: archs + # run: | + # OUTPUT=$(uv run python -c "from json import dumps; from test.utils import EMULATED_ARCHS; print(dumps(EMULATED_ARCHS))") + # echo "${OUTPUT}" + # echo "archs=${OUTPUT}" >> "$GITHUB_OUTPUT" + + # test-emulated: + # name: Test Linux ${{ matrix.arch }} using qemu + # needs: emulated-archs + # runs-on: ubuntu-latest + # timeout-minutes: 180 + # strategy: + # matrix: + # arch: ${{ fromJSON(needs.emulated-archs.outputs.archs) }} + # steps: + # - uses: actions/checkout@v4 + # - uses: actions/setup-python@v5 + # with: + # python-version: "3.x" + # - uses: astral-sh/setup-uv@v5 + # - name: Install dependencies + # run: uv sync --no-dev --group test + + # - name: Set up QEMU + # uses: docker/setup-qemu-action@v3 + # with: + # # This should be temporary + # # xref https://github.com/docker/setup-qemu-action/issues/188 + # # xref https://github.com/tonistiigi/binfmt/issues/215 + # image: tonistiigi/binfmt:qemu-v8.1.5 + + # - name: Run the emulation tests + # run: uv run pytest --run-emulation ${{ matrix.arch }} test/test_emulation.py + + # test-pyodide: + # name: Test cibuildwheel building Pyodide wheels + # needs: lint + # runs-on: ubuntu-24.04 + # timeout-minutes: 180 + # steps: + # - uses: actions/checkout@v4 + # - uses: actions/setup-python@v5 + # name: Install Python 3.12 + # with: + # python-version: '3.12' + # - uses: astral-sh/setup-uv@v5 + + # - name: Install dependencies + # run: uv sync --no-dev --group test + + # - name: Generate a sample project + # run: | + # uv run -m test.test_projects test.test_0_basic.basic_project sample_proj + + # - name: Run a sample build (GitHub Action) + # uses: ./ + # with: + # package-dir: sample_proj + # output-dir: wheelhouse + # env: + # CIBW_PLATFORM: pyodide + + # - name: Run tests with 'CIBW_PLATFORM' set to 'pyodide' + # run: | + # uv run ./bin/run_tests.py + # env: + # CIBW_PLATFORM: pyodide diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index ecf0361fb..d0042d474 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,37 +1,37 @@ -linux: - image: python:3.12 - services: - - name: docker:dind - entrypoint: ["env", "-u", "DOCKER_HOST"] - command: ["dockerd-entrypoint.sh"] - variables: - DOCKER_HOST: tcp://docker:2375/ - DOCKER_DRIVER: overlay2 - # See https://github.com/docker-library/docker/pull/166 - DOCKER_TLS_CERTDIR: "" - - # skip all but the basic tests - # (comment the below line in a PR to debug a Gitlab-specific issue) - PYTEST_ADDOPTS: -k "unit_test or test_0_basic" --suppress-no-test-exit-code - script: - - curl -sSL https://get.docker.com/ | sh - - docker run --rm --privileged docker.io/tonistiigi/binfmt:latest --install all - - python -m pip install dependency-groups - - python -m dependency_groups test | xargs python -m pip install -e. pytest-custom-exit-code - - python ./bin/run_tests.py +# linux: +# image: python:3.12 +# services: +# - name: docker:dind +# entrypoint: ["env", "-u", "DOCKER_HOST"] +# command: ["dockerd-entrypoint.sh"] +# variables: +# DOCKER_HOST: tcp://docker:2375/ +# DOCKER_DRIVER: overlay2 +# # See https://github.com/docker-library/docker/pull/166 +# DOCKER_TLS_CERTDIR: "" -windows: - image: mcr.microsoft.com/windows/servercore:1809 - variables: - PYTEST_ADDOPTS: -k "unit_test or test_0_basic" --suppress-no-test-exit-code - before_script: - - choco install python -y --version 3.12.4 - script: - - py -m pip install dependency-groups - - py -m pip install -e. pytest-custom-exit-code $(py -m dependency_groups test) - - py bin\run_tests.py - tags: - - saas-windows-medium-amd64 +# # skip all but the basic tests +# # (comment the below line in a PR to debug a Gitlab-specific issue) +# PYTEST_ADDOPTS: -k "unit_test or test_0_basic" --suppress-no-test-exit-code +# script: +# - curl -sSL https://get.docker.com/ | sh +# - docker run --rm --privileged docker.io/tonistiigi/binfmt:latest --install all +# - python -m pip install dependency-groups +# - python -m dependency_groups test | xargs python -m pip install -e. pytest-custom-exit-code +# - python ./bin/run_tests.py +# +# windows: +# image: mcr.microsoft.com/windows/servercore:1809 +# variables: +# PYTEST_ADDOPTS: -k "unit_test or test_0_basic" --suppress-no-test-exit-code +# before_script: +# - choco install python -y --version 3.12.4 +# script: +# - py -m pip install dependency-groups +# - py -m pip install -e. pytest-custom-exit-code $(py -m dependency_groups test) +# - py bin\run_tests.py +# tags: +# - saas-windows-medium-amd64 macos: image: macos-14-xcode-15 diff --git a/.travis.yml b/.travis.yml index ec2365a09..8eaef8c71 100644 --- a/.travis.yml +++ b/.travis.yml @@ -7,7 +7,8 @@ branches: - main # only build the main branch or PR that explicitely want to test with Travis CI -if: (type = "push") OR (commit_message =~ /travis-ci/) +# if: (type = "push") OR (commit_message =~ /travis-ci/) +if: (commit_message =~ /travis-ci/) jobs: include: diff --git a/appveyor.yml b/appveyor.yml index ca5d4a6c4..92989b302 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -1,38 +1,38 @@ -environment: - matrix: - - APPVEYOR_BUILD_WORKER_IMAGE: Ubuntu2204 - APPVEYOR_JOB_NAME: "python312-x64-ubuntu" - - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2022 - APPVEYOR_JOB_NAME: "python312-x64-vs2022" - - APPVEYOR_BUILD_WORKER_IMAGE: macos-sonoma - APPVEYOR_JOB_NAME: "python312-x64-macos" +# environment: +# matrix: +# # - APPVEYOR_BUILD_WORKER_IMAGE: Ubuntu2204 +# # APPVEYOR_JOB_NAME: "python312-x64-ubuntu" +# # - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2022 +# # APPVEYOR_JOB_NAME: "python312-x64-vs2022" +# - APPVEYOR_BUILD_WORKER_IMAGE: macos-sonoma +# APPVEYOR_JOB_NAME: "python312-x64-macos" -stack: python 3.12 +# stack: python 3.12 -build: off +# build: off -init: -- ps: | - $BRANCH = if ($env:APPVEYOR_PULL_REQUEST_HEAD_REPO_BRANCH) { $env:APPVEYOR_PULL_REQUEST_HEAD_REPO_BRANCH } else { $env:APPVEYOR_REPO_BRANCH } - if (-not ($BRANCH -eq 'main' -or $BRANCH.ToLower().StartsWith('appveyor-'))) { - $env:PYTEST_ADDOPTS = '-k "unit_test or test_0_basic" --suppress-no-test-exit-code' - } - if ($IsLinux) { - docker run --rm --privileged docker.io/tonistiigi/binfmt:latest --install all - } +# init: +# - ps: | +# $BRANCH = if ($env:APPVEYOR_PULL_REQUEST_HEAD_REPO_BRANCH) { $env:APPVEYOR_PULL_REQUEST_HEAD_REPO_BRANCH } else { $env:APPVEYOR_REPO_BRANCH } +# if (-not ($BRANCH -eq 'main' -or $BRANCH.ToLower().StartsWith('appveyor-'))) { +# $env:PYTEST_ADDOPTS = '-k "unit_test or test_0_basic" --suppress-no-test-exit-code' +# } +# if ($IsLinux) { +# docker run --rm --privileged docker.io/tonistiigi/binfmt:latest --install all +# } -install: - - python -m pip install -U pip - - python -m pip install -e ".[dev]" pytest-custom-exit-code +# install: +# - python -m pip install -U pip +# - python -m pip install -e ".[dev]" pytest-custom-exit-code -# the '-u' flag is required so the output is in the correct order. -# See https://github.com/pypa/cibuildwheel/pull/24 for more info. -test_script: python -u ./bin/run_tests.py +# # the '-u' flag is required so the output is in the correct order. +# # See https://github.com/pypa/cibuildwheel/pull/24 for more info. +# test_script: python -u ./bin/run_tests.py -branches: - only: - - main +# branches: +# only: +# - main -skip_commits: - files: - - docs/* +# skip_commits: +# files: +# - docs/* diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 76b1c6186..c5f283e60 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -5,38 +5,38 @@ pr: - .pre-commit-config.yaml jobs: -- job: linux_311 - timeoutInMinutes: 120 - pool: {vmImage: 'Ubuntu-20.04'} - steps: - - task: UsePythonVersion@0 - inputs: - versionSpec: '3.11' - - bash: | - docker run --rm --privileged docker.io/tonistiigi/binfmt:latest --install all - python -m pip install dependency-groups - python -m dependency_groups test | xargs python -m pip install -e. - python ./bin/run_tests.py +# - job: linux_311 +# timeoutInMinutes: 120 +# pool: {vmImage: 'Ubuntu-20.04'} +# steps: +# - task: UsePythonVersion@0 +# inputs: +# versionSpec: '3.11' +# - bash: | +# docker run --rm --privileged docker.io/tonistiigi/binfmt:latest --install all +# python -m pip install dependency-groups +# python -m dependency_groups test | xargs python -m pip install -e. +# python ./bin/run_tests.py -- job: macos_311 - pool: {vmImage: 'macOS-13'} - steps: - - task: UsePythonVersion@0 - inputs: - versionSpec: '3.11' - - bash: | - python -m pip install dependency-groups - python -m dependency_groups test | xargs python -m pip install -e. - python ./bin/run_tests.py --num-processes 2 +# - job: macos_311 +# pool: {vmImage: 'macOS-13'} +# steps: +# - task: UsePythonVersion@0 +# inputs: +# versionSpec: '3.11' +# - bash: | +# python -m pip install dependency-groups +# python -m dependency_groups test | xargs python -m pip install -e. +# python ./bin/run_tests.py --num-processes 2 -- job: windows_311 - pool: {vmImage: 'windows-2019'} - timeoutInMinutes: 180 - steps: - - task: UsePythonVersion@0 - inputs: - versionSpec: '3.11' - - bash: | - python -m pip install dependency-groups - python -m dependency_groups test | xargs python -m pip install -e. - python ./bin/run_tests.py +# - job: windows_311 +# pool: {vmImage: 'windows-2019'} +# timeoutInMinutes: 180 +# steps: +# - task: UsePythonVersion@0 +# inputs: +# versionSpec: '3.11' +# - bash: | +# python -m pip install dependency-groups +# python -m dependency_groups test | xargs python -m pip install -e. +# python ./bin/run_tests.py diff --git a/bin/run_tests.py b/bin/run_tests.py index 2aed4f01a..421d29366 100755 --- a/bin/run_tests.py +++ b/bin/run_tests.py @@ -34,13 +34,39 @@ if args.run_podman: unit_test_args += ["--run-podman"] + print( + "\n\n================================== UNIT TESTS ==================================", + flush=True, + ) subprocess.run(unit_test_args, check=True) - # integration tests + # Run the serial integration tests without --dist + serial_integration_test_args = [ + sys.executable, + "-m", + "pytest", + "-m", + "serial", + "-x", + "--durations", + "0", + "--timeout=2400", + "test", + "-vv", + ] + print( + "\n\n=========================== SERIAL INTEGRATION TESTS ===========================", + flush=True, + ) + subprocess.run(serial_integration_test_args, check=True) + + # Non-serial integration tests integration_test_args = [ sys.executable, "-m", "pytest", + "-m", + "not serial", "--dist", "loadgroup", f"--numprocesses={args.num_processes}", @@ -55,4 +81,8 @@ if sys.platform.startswith("linux") and args.run_podman: integration_test_args += ["--run-podman"] + print( + "\n\n========================= NON-SERIAL INTEGRATION TESTS =========================", + flush=True, + ) subprocess.run(integration_test_args, check=True) diff --git a/pyproject.toml b/pyproject.toml index 0319e2e09..e3efab7ca 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -102,7 +102,9 @@ junit_family = "xunit2" xfail_strict = true filterwarnings = ["error"] log_cli_level = "info" - +markers = [ + "serial: tests that must *not* be run in parallel (deselect with '-m \"not serial\"')", +] [tool.mypy] python_version = "3.11" diff --git a/test/test_ios.py b/test/test_ios.py index 6dc7b40d3..ca6bc7ab2 100644 --- a/test/test_ios.py +++ b/test/test_ios.py @@ -20,10 +20,12 @@ def test_platform(self): """ -# iOS tests shouldn't be run in parallel, because they're dependent on starting -# a simulator. It's *possible* to start multiple simulators, but not advisable -# to start as many simulators as there are CPUs on the test machine. -@pytest.mark.xdist_group(name="ios") +# iOS tests shouldn't be run in parallel, because they're dependent on calling +# Xcode, and starting a simulator. These are both multi-threaded operations, and +# it's easy to overload the CI machine if there are multiple test processes +# running multithreaded processes. Therefore, they're put in the serial group, +# which is guaranteed to run single-process. +@pytest.mark.serial @pytest.mark.parametrize( "build_config", [ @@ -48,6 +50,7 @@ def test_ios_platforms(tmp_path, build_config): "CIBW_BUILD": "cp313-*", "CIBW_TEST_SOURCES": "tests", "CIBW_TEST_COMMAND": "unittest discover tests test_platform.py", + "CIBW_BUILD_VERBOSITY": "1", **build_config, }, ) @@ -71,7 +74,7 @@ def test_ios_platforms(tmp_path, build_config): assert set(actual_wheels) == expected_wheels -@pytest.mark.xdist_group(name="ios") +@pytest.mark.serial def test_no_test_sources(tmp_path, capfd): if utils.platform != "macos": pytest.skip("this test can only run on macOS")