From 15fdbeb4989610a90decaab61778579bd0b3b9c3 Mon Sep 17 00:00:00 2001 From: Marcelo Duarte Date: Thu, 22 Oct 2026 23:58:06 -0300 Subject: [PATCH 1/2] Build with cibuildwheel 4.3.4 --- .github/workflows/cmd.yml | 6 +++--- .pre-commit-config.yaml | 8 ++++---- ci/build-wheel.sh | 5 ++++- pyproject.toml | 4 ++-- requirements-dev.txt | 4 ++-- 5 files changed, 15 insertions(+), 12 deletions(-) diff --git a/.github/workflows/cmd.yml b/.github/workflows/cmd.yml index fc814bb..7caffb2 100644 --- a/.github/workflows/cmd.yml +++ b/.github/workflows/cmd.yml @@ -1,11 +1,11 @@ name: Command -on: +on: # zizmor: ignore[dangerous-triggers] issue_comment: types: [created] concurrency: - group: pypi-${{ github.ref }} + group: cmd-${{ github.ref }} cancel-in-progress: false permissions: @@ -23,7 +23,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Harden the runner (Audit all outbound calls) - uses: step-security/harden-runner@e14015d583714f6e62063499dc959a02595150a1 # v2.21.1 + uses: step-security/harden-runner@ccd8616d44fd3846e67624a50d5aad6d37bf2d25 # v2.22.1 with: egress-policy: audit diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 9acc3a4..b04aa70 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -19,14 +19,14 @@ repos: - id: trailing-whitespace - repo: https://github.com/abravalheri/validate-pyproject - rev: 17e12779811926f000bdfa1795f9e3735dd71ac3 # frozen: 0.26 + rev: 82d21874c3242e4dc27bb47641c996902ef64eef # frozen: v0.27 hooks: - id: validate-pyproject additional_dependencies: - validate-pyproject-schema-store[all]==2026.10.11 - repo: https://github.com/astral-sh/ruff-pre-commit - rev: 44b5042edab9382aba712eed4f9c7bab7a3d6a3e # frozen: v0.17.0 + rev: f368fb366ff7f2f808dd324b83a6d32267799e19 # frozen: v0.17.2 hooks: - id: ruff-check args: ["--fix", "--show-fixes", "--unsafe-fixes"] @@ -60,13 +60,13 @@ repos: - id: shellcheck - repo: https://github.com/astral-sh/ty-pre-commit - rev: ded8634232ffc633dc66d44f1b0dfe2bdf766542 # frozen: v0.0.86 + rev: 44e0d809f7977451fe65f3697106f594b0a02492 # frozen: v0.0.91 hooks: - id: ty args: [--no-sync] - repo: https://github.com/zizmorcore/zizmor-pre-commit - rev: fa412071e4f5d44d44f9e365f4676f9df92456a2 # frozen: v1.30.1 + rev: c92afdf2c6ca336aaa8f39e2bd8d48f62dbd8e1f # frozen: v1.31.1 hooks: - id: zizmor args: ["--fix=all", "--no-progress", "-p"] diff --git a/ci/build-wheel.sh b/ci/build-wheel.sh index 0d7b573..9fec118 100755 --- a/ci/build-wheel.sh +++ b/ci/build-wheel.sh @@ -227,7 +227,10 @@ if [ "$INSTALL" == "1" ]; then $CONDA_EXE install "$PKG_CONDA" --no-deps --yes else if [ "$IS_MINGW" == "1" ]; then - PIP_COMMAND="pip install --break-system-packages --force-reinstall" + pacman -R "$MINGW_PACKAGE_PREFIX-python-${NORMALIZED_NAME/_/-}" \ + -dd --noconfirm || true + pip uninstall --break-system-packages "$NORMALIZED_NAME" -y || true + PIP_COMMAND="pip install --break-system-packages --ignore-installed" else PIP_COMMAND="uv pip install --no-build --prerelease=allow --reinstall" fi diff --git a/pyproject.toml b/pyproject.toml index 0682569..9491d4d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -47,8 +47,8 @@ Documentation = "https://docs.python.org/3.12/library/msilib.html" [dependency-groups] dev = [ - "cibuildwheel>=4.3.1", - "prek>=0.5.5,<0.6.0", + "cibuildwheel>=4.3.4", + "prek>=0.5.7,<0.6.0", ] tests = [ "coverage>=7.13.0", diff --git a/requirements-dev.txt b/requirements-dev.txt index 8781c7f..04deac9 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -1,2 +1,2 @@ -cibuildwheel>=4.3.1 -prek>=0.5.5,<0.6.0 +cibuildwheel>=4.3.4 +prek>=0.5.7,<0.6.0 From 93ee538056b175eed214ab021cff362a057ccbf0 Mon Sep 17 00:00:00 2001 From: Marcelo Duarte Date: Fri, 23 Oct 2026 00:13:34 -0300 Subject: [PATCH 2/2] add changes of install-tools --- ci/install-tools.sh | 82 +++++++++++++++++++++++++-------------------- 1 file changed, 46 insertions(+), 36 deletions(-) diff --git a/ci/install-tools.sh b/ci/install-tools.sh index 495a98c..d5d6afe 100755 --- a/ci/install-tools.sh +++ b/ci/install-tools.sh @@ -95,10 +95,26 @@ if [ "$IS_CONDA" == "1" ]; then done < requirements.txt fi - # pytest and dependencies + # Dependencies for 'dev' + if [ -f requirements-dev.txt ]; then + SYS_PLATFORM=$(python -c "import sys; print(sys.platform, end='')") + while read -r line; do + if [[ $line != *sys_platform* ]] || \ + [[ $line == *sys_platform*==*${SYS_PLATFORM}* ]]; then + name=$(echo "$line" | awk -F '[><=]+' '{ print $1 }') + if [ "$name" == "cibuildwheel" ]; then continue; fi + if ! printf '%s\0' "${pkgs[@]}" | grep -Fxqz -- "$name"; then + pkgs+=("$name") + fi + fi + done < requirements-dev.txt + fi + + # Dependencies for 'tests' if [ "$INSTALL_TESTS" == "1" ] && [ -f tests/requirements.txt ]; then while read -r line; do name=$(echo "$line" | awk -F '[><=]+' '{ print $1 }') + if [ "$name" == "cx-freeze" ]; then name="cx_freeze"; fi pkgs+=("$name") done < tests/requirements.txt fi @@ -139,7 +155,25 @@ elif [ "$IS_MINGW" == "1" ]; then done < requirements.txt fi - # pytest and dependencies + # Dependencies for 'dev' + if [ -f requirements-dev.txt ]; then + while read -r line; do + if [[ $line != *sys_platform* ]] || \ + [[ $line == *sys_platform*==*win32* ]]; then + name=$(echo "$line" | awk -F '[><=]+' '{ print $1 }') + if [ "$name" == "cibuildwheel" ]; then continue; fi + if [ "$name" == "prek" ]; then + pkgs+=("$MINGW_PACKAGE_PREFIX-$name") + continue + fi + if ! printf '%s\0' "${pkgs[@]}" | grep -Fxqz -- "$name"; then + pkgs+=("$MINGW_PACKAGE_PREFIX-python-$name") + fi + fi + done < requirements-dev.txt + fi + + # Dependencies for 'tests' if [ "$INSTALL_TESTS" == "1" ] && [ -f tests/requirements.txt ]; then while read -r line; do name=$(echo "$line" | awk -F '[><=]+' '{ print $1 }') @@ -148,7 +182,7 @@ elif [ "$IS_MINGW" == "1" ]; then fi echo "Install packages" - pacman --needed --noconfirm --quiet -S "${pkgs[@]}" + pacman -S --needed --noconfirm --quiet "${pkgs[@]}" else if [ "$CI" == "true" ]; then if [ "$IS_WINDOWS" == "1" ]; then @@ -170,47 +204,23 @@ else else uv pip install --upgrade -r pyproject.toml fi -fi - -# Get Python version -PY_VERSION=$(python -c "import sysconfig; print(sysconfig.get_python_version(), end='')") -PY_ABI_THREAD=$(python -c "import sysconfig; print(sysconfig.get_config_var('abi_thread') or '', end='')") -# Install dev tools -if [ "$INSTALL_DEV" == "1" ]; then - if [ -f requirements-dev.txt ]; then - PY_VER_ABI="$PY_VERSION$PY_ABI_THREAD" - if [ "$PY_VERSION" == "3.10" ] || [ "$PY_VERSION" == "3.11" ]; then - PY_VER_ABI="3.12" - fi + # Install dev tools + PY_VER_FOR_TOOLS="3.12" + if [ "$INSTALL_DEV" == "1" ] && [ -f requirements-dev.txt ]; then while read -r line; do name=$(echo "$line" | awk -F '[><=]+' '{ print $1 }') - # prek has no dependencies (doesn't bloat the installed packages) - if [ "$name" == "prek" ] && [ "$IS_CONDA" == "1" ]; then - $CONDA_EXE install -c conda-forge "$name" -S -q -y - elif [ "$name" != "cibuildwheel" ] && [ "$IS_UV" == "1" ]; then - uv pip install --upgrade "$name" - elif [ "$IS_UV" == "1" ]; then - uv tool install -p "$PY_VER_ABI" "$line" + if [ "$name" == "cibuildwheel" ] && [ "$IS_UV" == "1" ]; then + uv tool install -p "$PY_VER_FOR_TOOLS" "$line" else - filename=$INSTALL_DIR/$name - echo "Create $filename" - echo "#!/bin/sh"> "$filename" - echo "uvx -p $PY_VER_ABI \"$line\" \$@">> "$filename" - chmod +x "$filename" + uv pip install "$name" fi done < requirements-dev.txt fi -fi -# Install doc tools (sphinx and extensions) -if [ "$INSTALL_DOC" == "1" ]; then - if [ -f doc/requirements.txt ]; then - PY_VER_ABI="$PY_VERSION$PY_ABI_THREAD" - if [ "$PY_VERSION" == "3.10" ] || [ "$PY_VERSION" == "3.11" ]; then - PY_VER_ABI="3.12" - fi - uv tool install -p "$PY_VER_ABI" \ + # Install doc tools (sphinx and extensions) + if [ "$INSTALL_DOC" == "1" ] && [ -f doc/requirements.txt ]; then + uv tool install -p "$PY_VER_FOR_TOOLS" \ --with-requirements=doc/requirements.txt sphinx fi fi