Files
CoolProp/.github/workflows/python_buildwheels.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

188 lines
5.6 KiB
YAML

name: Python cibuildwheel
on:
push:
branches: [ 'master', 'main', 'develop', 'actions_pypi' ]
tags: [ 'v*' ]
pull_request:
branches: [ 'master', 'main', 'develop' ]
jobs:
set-version:
runs-on: ubuntu-latest
outputs:
testpypiversion: ${{ steps.set.outputs.testpypiversion }}
steps:
- name: Set version for testpypi
id: set
run: echo "testpypiversion=$(date +%Y%m%d%H%M%S)" >> $GITHUB_OUTPUT
python_source:
needs: set-version
name: Build source package
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: 3.13.x
- name: Install dependencies
run: pip install setuptools wheel Cython requests jinja2 pyyaml packaging
- 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 "${{ needs.set-version.outputs.testpypiversion }}"
fi;
- name: Build package, sdist
run: |
pip install build
python -m build --sdist --outdir ${GITHUB_WORKSPACE}/Python
- name: Store artifacts
uses: actions/upload-artifact@v4
with:
name: Python-sdist
path: |
./Python/*.tar.gz
python_ubuntu:
needs: set-version
strategy:
# Ensure that a wheel builder finishes even if another fails
fail-fast: false
matrix:
os: [ubuntu-latest]
python-version: [39, 310, 311, 312, 313, 314]
arch: [i686, x86_64, ppc64le, s390x]
exclude:
- os: ubuntu-latest
arch: i686 # reduce the build time until people ask for the binaries
- os: ubuntu-latest
arch: ppc64le # reduce the build time until people ask for the binaries
- os: ubuntu-latest
arch: s390x # reduce the build time until people ask for the binaries
uses: ./.github/workflows/python_cibuildwheel.yml
with:
os: ${{ matrix.os }}
python-version: ${{ matrix.python-version }}
arch: ${{ matrix.arch }}
TESTPYPI_VERSION: ${{ needs.set-version.outputs.testpypiversion }}
python_ubuntu_arm:
needs: set-version
strategy:
# Ensure that a wheel builder finishes even if another fails
fail-fast: false
matrix:
os: [ubuntu-24.04-arm]
python-version: [39, 310, 311, 312, 313, 314]
arch: [aarch64]
uses: ./.github/workflows/python_cibuildwheel.yml
with:
os: ${{ matrix.os }}
python-version: ${{ matrix.python-version }}
arch: ${{ matrix.arch }}
TESTPYPI_VERSION: ${{ needs.set-version.outputs.testpypiversion }}
python_windows:
needs: set-version
strategy:
# Ensure that a wheel builder finishes even if another fails
fail-fast: false
matrix:
os: [windows-latest]
python-version: [39, 310, 311, 312, 313, 314]
arch: [AMD64, x86, ARM64]
#exclude:
# - os: windows
# arch: ARM64 # creates problems with msgpack-c
uses: ./.github/workflows/python_cibuildwheel.yml
with:
os: ${{ matrix.os }}
python-version: ${{ matrix.python-version }}
arch: ${{ matrix.arch }}
TESTPYPI_VERSION: ${{ needs.set-version.outputs.testpypiversion }}
python_macos:
needs: set-version
strategy:
# Ensure that a wheel builder finishes even if another fails
fail-fast: false
matrix:
os: [macos-latest]
python-version: [39, 310, 311, 312, 313, 314]
arch: [x86_64, arm64, universal2]
exclude:
- os: macos-latest
arch: universal2 # is redundant
uses: ./.github/workflows/python_cibuildwheel.yml
with:
os: ${{ matrix.os }}
python-version: ${{ matrix.python-version }}
arch: ${{ matrix.arch }}
TESTPYPI_VERSION: ${{ needs.set-version.outputs.testpypiversion }}
merge_wheels:
runs-on: ubuntu-latest
needs: [python_source, python_ubuntu, python_ubuntu_arm, python_windows, python_macos]
steps:
- name: Merge Artifacts
uses: actions/upload-artifact/merge@v4
with:
name: Python
pattern: Python-*
upload_python_bindings_to_pypi:
needs: merge_wheels
name: Upload to PyPi
runs-on: ubuntu-latest
steps:
- 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
pip install setuptools wheel twine requests packaging
if [[ "$GITHUB_REF" == *"refs/tags"* ]]; then
TWINE_REPOSITORY=pypi
TWINE_PASSWORD=${{ secrets.PYPI_TOKEN }}
else
TWINE_REPOSITORY=testpypi
TWINE_PASSWORD=${{ secrets.TESTPYPI_TOKEN }}
fi;
echo "Using TWINE_REPOSITORY=$TWINE_REPOSITORY"
echo "TWINE_REPOSITORY=$TWINE_REPOSITORY" >> $GITHUB_ENV
echo "TWINE_PASSWORD=$TWINE_PASSWORD" >> $GITHUB_ENV
- name: Download ALL wheels
uses: actions/download-artifact@v4.1.7
with:
name: Python
path: Python
- name: Display structure of downloaded files
run: |
set -x
ls -R
du -sh
- name: Publish wheels to (Test)PyPI
if: ${{ github.event_name != 'pull_request' }}
env:
TWINE_USERNAME: __token__
run: python -m twine upload --verbose --skip-existing Python/*.whl Python/*.tar.gz