Skip to content

Commit

Permalink
Update to cibuildwheel 2.17
Browse files Browse the repository at this point in the history
cibuildwheel 2.17 doesn't need the "--platform" flag any more for
local builds, so get rid of that for simpler code
(pypa/cibuildwheel#1727).

(cherry picked from commit 46b0e43)
  • Loading branch information
imphil committed Jun 20, 2024
1 parent 47be0cd commit 51a4c58
Showing 1 changed file with 5 additions and 18 deletions.
23 changes: 5 additions & 18 deletions noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
import glob
import os
import shutil
import sys
from contextlib import suppress
from pathlib import Path
from typing import Dict, List, Optional, Tuple
Expand Down Expand Up @@ -34,6 +33,9 @@
"clang-format",
]

# Version of the cibuildwheel package used to build wheels.
cibuildwheel_version = "2.17.0"

#
# Helpers for use within this file.
#
Expand Down Expand Up @@ -378,31 +380,16 @@ def release_build_bdist(session: nox.Session) -> None:
"""Build a binary distribution (wheels) on the current operating system."""

# Pin a version to ensure reproducible builds.
session.run("pip", "install", "cibuildwheel==2.15.0")

# cibuildwheel only auto-detects the platform if it runs on a CI server.
# Do the auto-detect manually to enable local runs.
if sys.platform.startswith("linux"):
platform = "linux"
elif sys.platform == "darwin":
platform = "macos"
elif sys.platform == "win32":
platform = "windows"
else:
session.error(f"Unknown platform: {sys.platform!r}")
session.run("pip", "install", f"cibuildwheel=={cibuildwheel_version}")

session.log("Building binary distribution (wheels)")
session.run(
"cibuildwheel",
"--platform",
platform,
"--output-dir",
dist_dir,
)

session.log(
f"Binary distribution in release mode for {platform!r} built into {dist_dir!r}"
)
session.log(f"Binary distribution in release mode built into {dist_dir!r}")


@nox.session
Expand Down

0 comments on commit 51a4c58

Please sign in to comment.