changeset 52729:8d4ec768aff4

pyproject: migrate shared identical `cibuildwheel` settings to pyproject.toml Let's have one source of truth, whether building manually or through CI. https://cibuildwheel.pypa.io/en/stable/options/#configuration-file
author Matt Harbison <matt_harbison@yahoo.com>
date Wed, 18 Dec 2024 18:27:04 -0500
parents f8f14e6d032b
children 430d21a6b3fc
files contrib/build-one-linux-wheel.sh contrib/heptapod-ci.yml contrib/packaging/build-linux-wheels.sh contrib/packaging/build-macos-wheels.sh contrib/packaging/build-windows-wheels.bat pyproject.toml
diffstat 6 files changed, 6 insertions(+), 27 deletions(-) [+]
line wrap: on
line diff
--- a/contrib/build-one-linux-wheel.sh	Thu Jan 30 13:51:02 2025 -0500
+++ b/contrib/build-one-linux-wheel.sh	Wed Dec 18 18:27:04 2024 -0500
@@ -5,9 +5,6 @@
 #
 set -eu
 
-# enforce that the translation are built
-export MERCURIAL_SETUP_FORCE_TRANSLATIONS=1
-
 if [ $# -lt 2 ]; then
     echo "usage $0 PYTHONTAG DEST_DIR" >&2
     echo "" >&2
--- a/contrib/heptapod-ci.yml	Thu Jan 30 13:51:02 2025 -0500
+++ b/contrib/heptapod-ci.yml	Wed Dec 18 18:27:04 2024 -0500
@@ -46,9 +46,6 @@
     # with shell runner, its content is not cleaned from one call to the next,
     # so plan for it.
     TMP_WORK_DIR: "${CI_PROJECT_DIR}/../.."
-    # we use CIBW_SKIP="pp*" to prevent the building of pypy wheel that are neither
-    # needed nor working.
-    CIBW_SKIP: "pp*"
 
 .all:
   # help changing all job at once when debugging
@@ -100,7 +97,6 @@
   variables:
     WHEEL_TYPE: ""
     FLAVOR: ""
-    MERCURIAL_SETUP_FORCE_TRANSLATIONS: "1"
     CI_CLEVER_CLOUD_FLAVOR: "XS"
   script:
     - PLATFORM=`/opt/python/cp313-cp313/bin/python -c 'import sys; print(sys.platform)'`
@@ -444,8 +440,6 @@
     - if: $CI_COMMIT_BRANCH =~ $RE_TOPIC
       needs:
         - "trigger-wheel-windows"
-    variables:
-      MERCURIAL_SETUP_FORCE_TRANSLATIONS: "1"
     script:
         - echo "Entering script section"
         - echo "python used, $Env:PYTHON"
@@ -559,8 +553,6 @@
 # this is the only one we need to test. However testing that build work on all
 # version is useful and match what we do with Linux.
 #
-# CIBW_SKIP is set globally at the start of the file. See comment there.
-#
 # The weird directory structure match the one we use for Linux to deal with the
 # multiple jobs. (all this might be unnecessary)
 build-c-wheel-macos:
@@ -574,8 +566,6 @@
     stage: build
     tags:
       - macos
-    variables:
-      MERCURIAL_SETUP_FORCE_TRANSLATIONS: "1"
     script:
       - PLATFORM=`$PYTHON -c 'import sys; print(sys.platform)'`
       - rm -rf tmp-wheels
--- a/contrib/packaging/build-linux-wheels.sh	Thu Jan 30 13:51:02 2025 -0500
+++ b/contrib/packaging/build-linux-wheels.sh	Wed Dec 18 18:27:04 2024 -0500
@@ -11,8 +11,6 @@
 
 PYTHON_TARGETS="cp38-cp38 cp39-cp39 cp310-cp310 cp311-cp311 cp312-cp312 cp313-cp313"
 
-export MERCURIAL_SETUP_FORCE_TRANSLATIONS=1
-
 # We need to copy the repository to ensure:
 # (1) we don't wrongly write roots files in the repository (or any other wrong
 #     users)
--- a/contrib/packaging/build-macos-wheels.sh	Thu Jan 30 13:51:02 2025 -0500
+++ b/contrib/packaging/build-macos-wheels.sh	Wed Dec 18 18:27:04 2024 -0500
@@ -17,17 +17,11 @@
 
 set -e
 
-# Build translations; requires msgfmt on PATH.
-export MERCURIAL_SETUP_FORCE_TRANSLATIONS=1
-
 if ! which msgfmt 2>/dev/null 1>/dev/null; then
     echo "msgfmt executable not found" >&2
     exit 1
 fi
 
-# Prevent building pypy wheels, which is broken.
-export CIBW_SKIP=pp*
-
 export CIBW_ARCHS=universal2
 
 # TODO: purge the repo?
--- a/contrib/packaging/build-windows-wheels.bat	Thu Jan 30 13:51:02 2025 -0500
+++ b/contrib/packaging/build-windows-wheels.bat	Wed Dec 18 18:27:04 2024 -0500
@@ -9,12 +9,6 @@
 REM - None of the variable set here live past this script exiting.
 setlocal
 
-REM - Build translations; requires msgfmt.exe on PATH.
-set MERCURIAL_SETUP_FORCE_TRANSLATIONS=1
-
-REM - Prevent building pypy wheels, which is broken.
-set CIBW_SKIP=pp*
-
 REM - Disable warning about not being able to test without an arm64 runner.
 set CIBW_TEST_SKIP=*-win_arm64
 
--- a/pyproject.toml	Thu Jan 30 13:51:02 2025 -0500
+++ b/pyproject.toml	Wed Dec 18 18:27:04 2024 -0500
@@ -73,6 +73,12 @@
 # there's no mechanism to age old ones out.
 build-frontend = { name = "pip", args = ["--no-cache-dir"] }
 
+# Build translations; requires msgfmt.exe on PATH.
+environment = { MERCURIAL_SETUP_FORCE_TRANSLATIONS="1" }
+
+# Prevent building pypy wheels, which is broken.
+skip = "pp*"
+
 
 [tool.setuptools_scm]
 version_file = "mercurial/__version__.py"