Skip to content

Commit

Permalink
chore: use SPEC 0 schedule for cibuildwheel
Browse files Browse the repository at this point in the history
  • Loading branch information
mayeut committed Aug 19, 2024
1 parent 126b819 commit 76c27fb
Show file tree
Hide file tree
Showing 32 changed files with 120 additions and 158 deletions.
36 changes: 24 additions & 12 deletions .cirrus.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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:
Expand All @@ -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:
Expand All @@ -43,30 +53,32 @@ windows_x86_task:
memory: 8G

install_pre_requirements_script:
- choco install -y --no-progress python3 --version 3.10.6
- 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-sonoma-xcode

env:
PATH: /opt/homebrew/opt/python@3.10/libexec/bin:$PATH
VENV_ROOT: ${HOME}/venv-cibuildwheel
PATH: ${VENV_ROOT}/bin:${PATH}
install_pre_requirements_script:
- brew install python@3.10
- 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.10/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.10
- 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
Expand Down
5 changes: 3 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,17 +38,18 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-13, macos-14]
python_version: ['3.12']
python_version: ['3.13']
include:
- os: ubuntu-latest
python_version: '3.8'
python_version: '3.11'
timeout-minutes: 180
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
name: Install Python ${{ matrix.python_version }}
with:
python-version: ${{ matrix.python_version }}
allow-prereleases: true

- uses: yezz123/setup-uv@v4

Expand Down
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ repos:
rev: v1.11.1
hooks:
- id: mypy
name: mypy 3.8 on cibuildwheel/
name: mypy 3.11 on cibuildwheel/
exclude: ^cibuildwheel/resources/.*py|bin/generate_schema.py$
args: ["--python-version=3.8"]
args: ["--python-version=3.11"]
additional_dependencies: &mypy-dependencies
- bracex
- nox
Expand Down
22 changes: 11 additions & 11 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,21 +8,21 @@ branches:

jobs:
include:
- name: Linux | x86_64 + i686 | Python 3.9
python: 3.9
- name: Linux | x86_64 + i686 | Python 3.11
python: 3.11
services: docker
env: PYTHON=python

- name: Linux | arm64 | Python 3.9
python: 3.9
- name: Linux | arm64 | Python 3.11
python: 3.11
services: docker
arch: arm64-graviton2
group: edge
virt: vm
env: PYTHON=python

- name: Linux | ppc64le | Python 3.9
python: 3.9
- name: Linux | ppc64le | Python 3.11
python: 3.11
services: docker
arch: ppc64le
allow_failure: True
Expand All @@ -32,16 +32,16 @@ jobs:
# c.f. https://travis-ci.community/t/running-out-of-disk-space-quota-when-using-docker-on-ppc64le/11634
- PYTEST_ADDOPTS='-k "not test_manylinuxXXXX_only"'

- name: Windows | x86_64 | Python 3.9
- name: Windows | x86_64 | Python 3.11
os: windows
language: shell
before_install:
- choco upgrade python3 -y --version 3.9.13 --limit-output --params "/InstallDir:C:\\Python39"
- choco upgrade python3 -y --version 3.11.9 --limit-output --params "/InstallDir:C:\\Python311"
env:
- PYTHON=C:\\Python39\\python
- PYTHON=C:\\Python311\\python

- name: Linux | s390x | Python 3.9
python: 3.9
- name: Linux | s390x | Python 3.11
python: 3.11
services: docker
arch: s390x
allow_failure: True
Expand Down
12 changes: 6 additions & 6 deletions CI.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
This is a summary of the host Python versions and platforms covered by the different CI platforms:

| | 3.8 | 3.9 | 3.10 | 3.11 | 3.12 |
|---------|----------------------------------|-----------|-----------|---------|--------------------------------------------------|
| Linux | Azure Pipelines / GitHub Actions | Travis CI | Cirrus CI | | AppVeyor¹ / CircleCI¹ / GitHub Actions / GitLab¹ |
| macOS | Azure Pipelines | | Cirrus CI | GitLab¹ | AppVeyor¹ /CircleCI¹ / GitHub Actions |
| Windows | Azure Pipelines | Travis CI | Cirrus CI | | AppVeyor¹ / GitHub Actions / GitLab¹ |
| | 3.11 | 3.12 | 3.13 |
|---------|----------------------------------------------|---------------------------------------------|----------------|
| Linux | Azure Pipelines / GitHub Actions / Travis CI | AppVeyor¹ / CircleCI¹ / Cirrus CI / GitLab¹ | GitHub Actions |
| macOS | Azure Pipelines / GitLab¹ | AppVeyor¹ / CircleCI¹ / Cirrus CI / GitLab¹ | GitHub Actions |
| Windows | Azure Pipelines / Travis CI | AppVeyor¹ / Cirrus CI / GitLab¹ | GitHub Actions |

> ¹ Runs a reduced set of tests to reduce CI load
Non-x86 architectures are covered on Travis CI using Python 3.9.
Non-x86 architectures are covered on Travis CI using Python 3.11.
12 changes: 6 additions & 6 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,34 +5,34 @@ pr:
- .pre-commit-config.yaml

jobs:
- job: linux_38
- job: linux_311
timeoutInMinutes: 120
pool: {vmImage: 'Ubuntu-20.04'}
steps:
- task: UsePythonVersion@0
inputs:
versionSpec: '3.8'
versionSpec: '3.11'
- bash: |
python -m pip install -e ".[dev]"
python ./bin/run_tests.py
- job: macos_38
- job: macos_311
pool: {vmImage: 'macOS-12'}
steps:
- task: UsePythonVersion@0
inputs:
versionSpec: '3.8'
versionSpec: '3.11'
- bash: |
python -m pip install -e ".[dev]"
python ./bin/run_tests.py --num-processes 2
- job: windows_38
- job: windows_311
pool: {vmImage: 'windows-2019'}
timeoutInMinutes: 180
steps:
- task: UsePythonVersion@0
inputs:
versionSpec: '3.8'
versionSpec: '3.11'
- bash: |
python -m pip install -e ".[dev]"
python ./bin/run_tests.py
6 changes: 1 addition & 5 deletions bin/bump_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,13 @@
import os
import subprocess
import sys
import tomllib
import urllib.parse
from pathlib import Path

import click
from packaging.version import InvalidVersion, Version

if sys.version_info < (3, 11):
import tomli as tomllib
else:
import tomllib

config = [
# file path, version find/replace format
("pyproject.toml", 'version = "{}"'),
Expand Down
3 changes: 1 addition & 2 deletions bin/update_nodejs.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

import difflib
import logging
import tomllib
from dataclasses import dataclass
from pathlib import Path
from typing import Final
Expand All @@ -16,8 +17,6 @@
from rich.logging import RichHandler
from rich.syntax import Syntax

from cibuildwheel._compat import tomllib

log = logging.getLogger("cibw")

# Looking up the dir instead of using utils.resources_dir
Expand Down
6 changes: 3 additions & 3 deletions bin/update_pythons.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,10 @@
import copy
import difflib
import logging
import tomllib
from collections.abc import Mapping, MutableMapping
from pathlib import Path
from typing import Any, Final, Literal, TypedDict, Union
from typing import Any, Final, Literal, TypedDict

import click
import requests
Expand All @@ -17,7 +18,6 @@
from rich.logging import RichHandler
from rich.syntax import Syntax

from cibuildwheel._compat import tomllib
from cibuildwheel.extra import dump_python_configurations

log = logging.getLogger("cibw")
Expand Down Expand Up @@ -50,7 +50,7 @@ class ConfigMacOS(TypedDict):
url: str


AnyConfig = Union[ConfigWinCP, ConfigWinPP, ConfigMacOS]
AnyConfig = ConfigWinCP | ConfigWinPP | ConfigMacOS


# The following set of "Versions" classes allow the initial call to the APIs to
Expand Down
3 changes: 1 addition & 2 deletions bin/update_virtualenv.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import difflib
import logging
import subprocess
import tomllib
from dataclasses import dataclass
from pathlib import Path
from typing import Final
Expand All @@ -15,8 +16,6 @@
from rich.logging import RichHandler
from rich.syntax import Syntax

from cibuildwheel._compat import tomllib

log = logging.getLogger("cibw")

# Looking up the dir instead of using utils.resources_dir
Expand Down
7 changes: 3 additions & 4 deletions cibuildwheel/__main__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from __future__ import annotations

import argparse
import contextlib
import dataclasses
import os
import shutil
Expand All @@ -12,7 +13,7 @@
from collections.abc import Iterable, Sequence, Set
from pathlib import Path
from tempfile import mkdtemp
from typing import Protocol
from typing import Protocol, assert_never

import cibuildwheel
import cibuildwheel.linux
Expand All @@ -21,7 +22,6 @@
import cibuildwheel.util
import cibuildwheel.windows
from cibuildwheel import errors
from cibuildwheel._compat.typing import assert_never
from cibuildwheel.architecture import Architecture, allowed_architectures_check
from cibuildwheel.logger import log
from cibuildwheel.options import CommandLineArguments, Options, compute_options
Expand All @@ -31,7 +31,6 @@
BuildSelector,
CIProvider,
Unbuffered,
chdir,
detect_ci_provider,
fix_ansi_codes_for_github_actions,
strtobool,
Expand Down Expand Up @@ -200,7 +199,7 @@ def main_inner(global_options: GlobalOptions) -> None:
# This is now the new package dir
args.package_dir = project_dir.resolve()

with chdir(project_dir):
with contextlib.chdir(project_dir):
build_in_directory(args)
finally:
# avoid https://github.com/python/cpython/issues/86962 by performing
Expand Down
1 change: 0 additions & 1 deletion cibuildwheel/_compat/__init__.py

This file was deleted.

10 changes: 0 additions & 10 deletions cibuildwheel/_compat/tomllib.py

This file was deleted.

14 changes: 0 additions & 14 deletions cibuildwheel/_compat/typing.py

This file was deleted.

3 changes: 1 addition & 2 deletions cibuildwheel/architecture.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,8 @@
import sys
from collections.abc import Set
from enum import Enum
from typing import Final, Literal
from typing import Final, Literal, assert_never

from ._compat.typing import assert_never
from .typing import PlatformName

PRETTY_NAMES: Final[dict[PlatformName, str]] = {
Expand Down
Loading

0 comments on commit 76c27fb

Please sign in to comment.