Files
CoolProp/.github/workflows/python_cibuildwheel.yml
Ian Bell f0b988236f build: replace git submodules with CPM.cmake (#2728)
* build: replace git submodules with CPM.cmake

All 11 submodules (Eigen, fmtlib, msgpack-c, rapidjson, IF97,
REFPROP-headers, multicomplex, Catch2, pybind11, ExcelAddinInstaller,
FindMathematica) are now fetched by CPM.cmake at configure time.

Set CPM_SOURCE_CACHE (e.g. ~/.cache/CPM) to share the download cache
across git worktrees and build directories — no more per-worktree
`git submodule update --init --recursive`.

Vendored deps that have no upstream release cycle (miniz, nlohmann-json,
incbin) remain in externals/ as before.

Source-level changes: angle-bracket includes for rapidjson, IF97, and
REFPROP-headers now that their directories are on the include path via
CPM-provided source dirs rather than relative paths from the repo root.

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

* fix(python): wire up CPM.cmake in Python wrapper, fix include paths

The Python wrapper CMakeLists.txt was still referencing submodule paths
(externals/Eigen, externals/fmtlib, externals/msgpack-c) removed by the
CPM migration. Include CPM.cmake + dependencies.cmake from the root and
use the ${Pkg_SOURCE_DIR} variables instead.  Also adds missing
rapidjson, IF97, and REFPROP_headers include dirs required by CoolProp
sources.

CI workflows drop the now-meaningless `submodules: recursive` checkout
option and add a CPM source-cache step to avoid re-downloading on each
macOS/Windows runner.

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

* docs: remove git submodule references after CPM.cmake migration

Dependencies are now managed by CPM.cmake (fetched automatically at
CMake configure time), so git submodules no longer exist.

- Drop `--recursive` from all `git clone` commands in Web docs and
  wrapper READMEs (26 .rst/.md files)
- Remove `submodules: recursive` from all CI workflow checkout steps
  (13 workflow files)
- Remove `git submodule foreach/update` calls from release.bsh and
  delete the now-dead pybind11 security-workaround lines
- Drop `--recursive` from build_swigged_matlab.sh and gitMirror.bsh
- Update CONTRIBUTING.md: drop "and its submodules" phrasing

Changelog entries referencing old submodule PRs are left intact as
historical records. The --recursive in buildbot.rst is for the
Dockerfiles repo (unrelated) and is also left unchanged.

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

* fix(ci): remove empty 'with:' blocks after submodule removal, apply clang-format

After removing 'submodules: recursive' from checkout steps, some workflow
files were left with dangling empty 'with:' blocks that GitHub Actions
rejects as workflow file errors. Remove the empty 'with:' in 9 workflows.

Also apply clang-format to fix spacing in REFPROPMixtureBackend.cpp,
HumidAirProp.cpp, and Helmholtz.cpp.

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

---------

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-18 11:45:10 -04:00

97 lines
3.0 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
- 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: Cache CPM packages
uses: actions/cache@v4
with:
path: ~/.cache/CPM
key: cpm-${{ runner.os }}-${{ inputs.arch }}-${{ hashFiles('cmake/dependencies.cmake') }}
restore-keys: |
cpm-${{ runner.os }}-${{ inputs.arch }}-
cpm-${{ runner.os }}-
- 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 CPM_SOURCE_CACHE=$HOME/.cache/CPM
CIBW_BEFORE_BUILD_LINUX: >
pip install ninja &&
git config --global --add safe.directory "*"
CIBW_ENVIRONMENT_LINUX: COOLPROP_CMAKE=default,NATIVE CPM_SOURCE_CACHE=/root/.cache/CPM
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