From 60a7a82a015c0c2486322144404c9da243bb8e7d Mon Sep 17 00:00:00 2001 From: mayeut Date: Sat, 6 Jul 2024 09:26:08 +0200 Subject: [PATCH] fix tests on cirrus --- .cirrus.yml | 30 +++++++++++++++++++++--------- examples/cirrus-ci-intel-mac.yml | 6 +++--- examples/cirrus-ci-minimal.yml | 23 +++++++++++++++++------ 3 files changed, 41 insertions(+), 18 deletions(-) diff --git a/.cirrus.yml b/.cirrus.yml index ddd94105e..9edd4d6cf 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -2,11 +2,11 @@ only_if: changesInclude('.cirrus.yml') || ($CIRRUS_BRANCH == "main" && !changesI run_tests: &RUN_TESTS install_cibuildwheel_script: + - python -V - python -m pip install -e ".[dev]" pytest-custom-exit-code run_cibuildwheel_tests_script: - python ./bin/run_tests.py - linux_x86_task: timeout_in: 120m compute_engine_instance: @@ -15,9 +15,14 @@ linux_x86_task: platform: linux cpu: 8 memory: 8G - + env: + VENV_ROOT: ${HOME}/venv-cibuildwheel + PATH: ${VENV_ROOT}/bin:${PATH} install_pre_requirements_script: - - apt install -y python3-venv python-is-python3 + - 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: @@ -28,9 +33,14 @@ linux_aarch64_task: platform: linux cpu: 4 memory: 4G - + env: + VENV_ROOT: ${HOME}/venv-cibuildwheel + PATH: ${VENV_ROOT}/bin:${PATH} install_pre_requirements_script: - - apt install -y python3-venv python-is-python3 + - 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: @@ -51,22 +61,24 @@ windows_x86_task: macos_arm64_task: macos_instance: image: ghcr.io/cirruslabs/macos-sonoma-xcode - env: - PATH: /opt/homebrew/opt/python@3.12/libexec/bin:$PATH + 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-sonoma-xcode - env: - PATH: /opt/homebrew/opt/python@3.12/libexec/bin:$PATH + 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 diff --git a/examples/cirrus-ci-intel-mac.yml b/examples/cirrus-ci-intel-mac.yml index 4d2f9f121..7cf319335 100644 --- a/examples/cirrus-ci-intel-mac.yml +++ b/examples/cirrus-ci-intel-mac.yml @@ -11,10 +11,10 @@ macos_task: name: Build macOS x86_64 and arm64 wheels. macos_instance: image: ghcr.io/cirruslabs/macos-sonoma-xcode - env: - PATH: /opt/homebrew/opt/python@3.12/libexec/bin:$PATH - CIBW_ARCHS_MACOS: x86_64 arm64 + 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} <<: *BUILD_AND_STORE_WHEELS diff --git a/examples/cirrus-ci-minimal.yml b/examples/cirrus-ci-minimal.yml index 96ec53a0e..266ff365e 100644 --- a/examples/cirrus-ci-minimal.yml +++ b/examples/cirrus-ci-minimal.yml @@ -15,9 +15,14 @@ linux_x86_task: platform: linux cpu: 4 memory: 4G - + env: + VENV_ROOT: ${HOME}/venv-cibuildwheel + PATH: ${VENV_ROOT}/bin:${PATH} install_pre_requirements_script: - - apt install -y python3-venv python-is-python3 + - add-apt-repository -y ppa:deadsnakes/ppa + - apt-get update + - apt-get install -y python3.12-venv + - python3.12 -m venv ${VENV_ROOT} <<: *BUILD_AND_STORE_WHEELS linux_aarch64_task: @@ -29,9 +34,14 @@ linux_aarch64_task: platform: linux cpu: 4 memory: 4G - + env: + VENV_ROOT: ${HOME}/venv-cibuildwheel + PATH: ${VENV_ROOT}/bin:${PATH} install_pre_requirements_script: - - apt install -y python3-venv python-is-python3 + - add-apt-repository -y ppa:deadsnakes/ppa + - apt-get update + - apt-get install -y python3.12-venv + - python3.12 -m venv ${VENV_ROOT} <<: *BUILD_AND_STORE_WHEELS windows_x86_task: @@ -51,9 +61,10 @@ macos_arm64_task: name: Build macOS arm64 wheels. macos_instance: image: ghcr.io/cirruslabs/macos-sonoma-xcode - env: - PATH: /opt/homebrew/opt/python@3.12/libexec/bin:$PATH + 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} <<: *BUILD_AND_STORE_WHEELS