Skip to content

Commit

Permalink
feat: drop python 3.6 & 3.7 support (#2282)
Browse files Browse the repository at this point in the history
  • Loading branch information
mayeut authored Feb 25, 2025
1 parent e061af0 commit 7e5810c
Show file tree
Hide file tree
Showing 19 changed files with 105 additions and 260 deletions.
3 changes: 0 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,12 @@ While cibuildwheel itself requires a recent Python version to run (we support th

| | macOS Intel | macOS Apple Silicon | Windows 64bit | Windows 32bit | Windows Arm64 | manylinux<br/>musllinux x86_64 | manylinux<br/>musllinux i686 | manylinux<br/>musllinux aarch64 | manylinux<br/>musllinux ppc64le | manylinux<br/>musllinux s390x | manylinux<br/>musllinux armv7l | Pyodide |
|----------------|----|-----|-----|-----|-----|----|-----|----|-----|-----|---|-----|
| CPython 3.6 || N/A ||| N/A |||||| ✅⁵ | N/A |
| CPython 3.7 || N/A ||| N/A |||||| ✅⁵ | N/A |
| CPython 3.8 ||||| N/A |||||| ✅⁵ | N/A |
| CPython 3.9 ||||| ✅² |||||| ✅⁵ | N/A |
| CPython 3.10 ||||| ✅² |||||| ✅⁵ | N/A |
| CPython 3.11 ||||| ✅² |||||| ✅⁵ | N/A |
| CPython 3.12 ||||| ✅² |||||| ✅⁵ | ✅⁴ |
| CPython 3.13³ ||||| ✅² |||||| ✅⁵ | N/A |
| PyPy 3.7 v7.3 || N/A || N/A | N/A | ✅¹ | ✅¹ | ✅¹ | N/A | N/A | N/A | N/A |
| PyPy 3.8 v7.3 |||| N/A | N/A | ✅¹ | ✅¹ | ✅¹ | N/A | N/A | N/A | N/A |
| PyPy 3.9 v7.3 |||| N/A | N/A | ✅¹ | ✅¹ | ✅¹ | N/A | N/A | N/A | N/A |
| PyPy 3.10 v7.3 |||| N/A | N/A | ✅¹ | ✅¹ | ✅¹ | N/A | N/A | N/A | N/A |
Expand Down
2 changes: 1 addition & 1 deletion cibuildwheel/linux.py
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ def build_in_container(
log.build_start(config.identifier)
build_options = options.build_options(config.identifier)
build_frontend = build_options.build_frontend or BuildFrontendConfig("pip")
use_uv = build_frontend.name == "build[uv]" and Version(config.version) >= Version("3.8")
use_uv = build_frontend.name == "build[uv]"
pip = ["uv", "pip"] if use_uv else ["pip"]

dependency_constraint_flags: list[PathOrStr] = []
Expand Down
37 changes: 14 additions & 23 deletions cibuildwheel/macos.py
Original file line number Diff line number Diff line change
Expand Up @@ -191,21 +191,13 @@ def install_pypy(tmp: Path, url: str) -> Path:
return installation_path / "bin" / "pypy3"


def can_use_uv(python_configuration: PythonConfiguration) -> bool:
conditions = (Version(python_configuration.version) >= Version("3.8"),)
return all(conditions)


def setup_python(
tmp: Path,
python_configuration: PythonConfiguration,
dependency_constraint_flags: Sequence[PathOrStr],
environment: ParsedEnvironment,
build_frontend: BuildFrontendName,
) -> tuple[Path, dict[str, str]]:
if build_frontend == "build[uv]" and not can_use_uv(python_configuration):
build_frontend = "build"

uv_path = find_uv()
use_uv = build_frontend == "build[uv]"

Expand Down Expand Up @@ -315,20 +307,19 @@ def setup_python(
)
env["MACOSX_DEPLOYMENT_TARGET"] = default_target

if python_configuration.version not in {"3.6", "3.7"}:
if config_is_arm64:
# macOS 11 is the first OS with arm64 support, so the wheels
# have that as a minimum.
env.setdefault("_PYTHON_HOST_PLATFORM", "macosx-11.0-arm64")
env.setdefault("ARCHFLAGS", "-arch arm64")
elif config_is_universal2:
env.setdefault("_PYTHON_HOST_PLATFORM", "macosx-10.9-universal2")
env.setdefault("ARCHFLAGS", "-arch arm64 -arch x86_64")
elif python_configuration.identifier.endswith("x86_64"):
# even on the macos11.0 Python installer, on the x86_64 side it's
# compatible back to 10.9.
env.setdefault("_PYTHON_HOST_PLATFORM", "macosx-10.9-x86_64")
env.setdefault("ARCHFLAGS", "-arch x86_64")
if config_is_arm64:
# macOS 11 is the first OS with arm64 support, so the wheels
# have that as a minimum.
env.setdefault("_PYTHON_HOST_PLATFORM", "macosx-11.0-arm64")
env.setdefault("ARCHFLAGS", "-arch arm64")
elif config_is_universal2:
env.setdefault("_PYTHON_HOST_PLATFORM", "macosx-10.9-universal2")
env.setdefault("ARCHFLAGS", "-arch arm64 -arch x86_64")
elif python_configuration.identifier.endswith("x86_64"):
# even on the macos11.0 Python installer, on the x86_64 side it's
# compatible back to 10.9.
env.setdefault("_PYTHON_HOST_PLATFORM", "macosx-10.9-x86_64")
env.setdefault("ARCHFLAGS", "-arch x86_64")

building_arm64 = config_is_arm64 or config_is_universal2
if building_arm64 and get_macos_version() < (10, 16) and "SDKROOT" not in env:
Expand Down Expand Up @@ -416,7 +407,7 @@ def build(options: Options, tmp_path: Path) -> None:
for config in python_configurations:
build_options = options.build_options(config.identifier)
build_frontend = build_options.build_frontend or BuildFrontendConfig("pip")
use_uv = build_frontend.name == "build[uv]" and can_use_uv(config)
use_uv = build_frontend.name == "build[uv]"
uv_path = find_uv()
if use_uv and uv_path is None:
msg = "uv not found"
Expand Down
7 changes: 6 additions & 1 deletion cibuildwheel/options.py
Original file line number Diff line number Diff line change
Expand Up @@ -980,7 +980,12 @@ def _get_pinned_container_images() -> Mapping[str, Mapping[str, str]]:

def deprecated_selectors(name: str, selector: str, *, error: bool = False) -> None:
if "p2" in selector or "p35" in selector:
msg = f"cibuildwheel 2.x no longer supports Python < 3.6. Please use the 1.x series or update {name}"
msg = f"cibuildwheel 3.x no longer supports Python < 3.8. Please use the 1.x series or update {name}"
if error:
raise errors.DeprecationError(msg)
log.warning(msg)
if "p36" in selector or "p37" in selector:
msg = f"cibuildwheel 3.x no longer supports Python < 3.8. Please use the 2.x series or update {name}"
if error:
raise errors.DeprecationError(msg)
log.warning(msg)
Loading

0 comments on commit 7e5810c

Please sign in to comment.