Files
CoolProp/.github/workflows/python_cibuildwheel.yml
Ian Bell d5761cb150 Use ninja for the examples (#2635)
* Use ninja for the examples

Should help a little bit with doc building

* FIx some templates

* Fix template deduction error in count_x_for_y_many functions

The count_x_for_y_many and count_x_for_y_manyC functions were using
a single template parameter for both input (double) and output (size_t)
arrays, causing template deduction failures in Cython bindings.

Changed to use separate template parameters YContainer and CountContainer
to properly support different types for input y values and output counts.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>

* Fix types in PXD header too

* Docs should get ninja too

* Changes from clang-format

* Fix git diff argument order in clang-format script

The script was comparing PR_BRANCH to TARGET_BRANCH, which shows changes from the PR branch to the target (what's in target that's NOT in PR). For PR validation, we need the opposite: changes from target to PR (what's in PR that's NOT in target).

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>

* Fix Cython template deduction errors in solve_for_x_manyC and count_x_for_y_manyC

Add explicit template parameters [double, size_t] to both function calls
to resolve template type deduction errors when compiling with Cython.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>

* Fix wheel building by removing return from void Cython template calls

The functions solve_for_x_manyC and count_x_for_y_manyC return void in C++.
When Cython sees a return statement with a void function call containing
template arguments with commas (e.g., [double, size_t]), it wraps the call
in the __Pyx_void_to_None macro. This macro is a simple preprocessor macro
that cannot handle the commas in template arguments, treating them as macro
argument separators instead.

The fix is to remove the return statements, making these simple void function
calls. This prevents the __Pyx_void_to_None wrapping and allows the wheel to
build successfully.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>

---------

Co-authored-by: Claude <noreply@anthropic.com>
2025-10-12 09:28:57 -04:00

90 lines
2.7 KiB
YAML

name: Python build one single wheel
on:
workflow_call:
inputs:
python-version:
required: true
type: string
os:
required: true
type: string
arch:
required: true
type: string
TESTPYPI_VERSION:
required: true
type: string
jobs:
build:
#name: py${{ inputs.python-version }}-${{ inputs.os }}-${{ inputs.arch }}
runs-on: ${{ inputs.os }}
steps:
- name: Show the context for this job
env:
EVENT_CONTEXT: ${{ toJSON(github.event) }}
run: |
echo $EVENT_CONTEXT
- uses: actions/checkout@v4.2.2
with:
submodules: recursive
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: 3.13.x
- name: Install Python dependencies
run: |
python -m pip install --upgrade pip
python -m pip install requests packaging ninja
- name: Figure out the TestPyPi/PyPi Version
shell: bash
run: |
if [[ "$GITHUB_REF" == *"refs/tags"* ]]; then
python dev/extract_version.py --pypi --replace-version
else
python dev/extract_version.py --replace-version --version "${{ inputs.TESTPYPI_VERSION }}"
fi;
- name: Set up QEMU
if: ${{ runner.os == 'Linux' }}
uses: docker/setup-qemu-action@v3.2.0
with:
platforms: all
- name: Build and test wheels
uses: pypa/cibuildwheel@v3.2.0
env:
MACOSX_DEPLOYMENT_TARGET: 11.0
CIBW_ENVIRONMENT_MACOS: MACOSX_DEPLOYMENT_TARGET=11.0 SDKROOT=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk
CIBW_BEFORE_BUILD_LINUX: >
pip install ninja &&
git config --global --add safe.directory "*"
CIBW_ENVIRONMENT_LINUX: COOLPROP_CMAKE=default,NATIVE
CIBW_BUILD: cp${{ inputs.python-version }}-*
CIBW_ARCHS_MACOS: ${{ inputs.arch }} # x86_64 arm64 # universal2 is redundant
CIBW_ARCHS_WINDOWS: ${{ inputs.arch }} # AMD64 x86 # ARM64 creates problems with msgpack-c
CIBW_ARCHS_LINUX: ${{ inputs.arch }} # i686 x86_64 aarch64 ppc64le s390x
CIBW_TEST_COMMAND: python -c "import CoolProp; assert '?' not in CoolProp.__gitrevision__"
CIBW_MANYLINUX_X86_64_IMAGE: manylinux2014
CIBW_MANYLINUX_I686_IMAGE: manylinux2014
CIBW_MANYLINUX_AARCH64_IMAGE: manylinux2014
# CIBW_SKIP: "pp*"
CIBW_TEST_SKIP: "*-macosx_arm64 *-win_arm64"
with:
package-dir: .
output-dir: Python
- name: Upload Files
uses: actions/upload-artifact@v4
with:
name: Python-${{ inputs.os }}-${{ inputs.python-version }}-${{ inputs.arch }}
path: |
./Python/*.whl