63 Commits

Author SHA1 Message Date
Ian Bell
70d03056e0 Modernize Python build system to use scikit-build-core (#2632)
* Modernize Python build system to use scikit-build-core

This commit replaces the old setuptools-based build system with a modern
scikit-build-core + CMake build system for the Python bindings.

Key changes:
- Replace setup.py with pyproject.toml using scikit-build-core backend
- Create new CMakeLists.txt for Cython module compilation
- Add FindCython.cmake helper module
- Update README from .rst to .md format
- Enable incremental builds with proper CMake dependency tracking
- Support Python 3.8-3.14 with proper Cython directives

Benefits:
- Incremental builds work correctly (only rebuild changed files)
- Modern PEP 517/518 compliant build system
- Build artifacts cached in build/{wheel_tag} directories
- Better integration with pip and modern Python tooling
- No more need for custom _py_backend build hooks

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

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

* Add build-time file generation and ignore generated files

This commit adds the missing build-time steps from setup.py:
- Header generation from JSON files (generate_headers.py)
- Cython constants module generation (generate_constants_module.py)
- Copying headers, fmtlib, and BibTeX file to package directory

Also updates .gitignore to ignore:
- wrappers/Python/CoolProp/include/ (generated during build)
- wrappers/Python/CoolProp/CoolPropBibTeXLibrary.bib (copied during build)

Includes test script to verify wheel contents match between old and new build approaches.

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

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

* Set CMAKE_POSITION_INDEPENDENT_CODE for shared library build

Enable -fPIC flag for all targets to ensure proper shared library compilation.

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

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

* Remove deprecated buildbot configuration

The buildbot system is deprecated and no longer in use.

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

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

* Update extract_version.py to use .version file instead of setup.py

With the migration to scikit-build-core, version information is now stored
in the .version file and read by pyproject.toml. Updated the script to:

- Rename replace_setup_py() to replace_version_file()
- Update .version file instead of modifying setup.py
- Change --replace-setup-py flag to --replace-version

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

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

* Update build scripts and documentation for scikit-build-core

Changes:
- Updated documentation to show modern pip-based installation
- Updated manylinux build script to use pip wheel instead of setup.py
- Updated conda metadata generator to use pip install
- Removed deprecated PyPI preparation script (replaced by `python -m build --sdist`)

All build infrastructure now uses the new scikit-build-core build system.

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

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

* Update manylinux Docker script for scikit-build-core

Removed SETUP_PY_ARGS since cmake options are no longer passed via
setup.py arguments. The new build system uses CMake directly via
scikit-build-core. Also fixed typo and updated install_root path.

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

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

* Remove deprecated _py_backend custom build backend

The _py_backend was a custom setuptools build backend wrapper used
with the old setup.py build system. It's no longer needed with
scikit-build-core.

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

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

* Add uv package manager documentation

Added section on using uv (Astral's fast Python package manager) to
install and work with CoolProp. Includes examples for:
- Installing in current environment
- Creating new projects with CoolProp
- Running scripts with automatic environment management
- Development installations from source

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

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

* Fix sdist packaging and update scikit-build-core config

Changes:
- Updated pyproject.toml to use newer scikit-build-core config syntax
  - cmake.minimum-version → cmake.version
  - cmake.verbose → build.verbose
- Added sdist.include to ensure .version file is in source distributions
- Added .version to MANIFEST.in for completeness

This fixes the issue where building a wheel from an sdist would fail
due to missing .version file. Now sdist → wheel builds work correctly.

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

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

* Rename setup.py to deprecated_setup.py

The old setuptools-based build system has been fully replaced with
scikit-build-core. Renaming setup.py to deprecated_setup.py to:
- Clearly indicate it's no longer the primary build method
- Keep it available for reference and backward compatibility
- Prevent accidental use of the old build system

Users should now use: pip install .

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

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

* Update GitHub Actions workflows for new build system

Changes:
- Replace --replace-setup-py with --replace-version flag
- Update sdist build to use 'python -m build --sdist' instead of deprecated prepare_pypi.py
- Workflows now work with scikit-build-core build system

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

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

* Fix cibuildwheel to build from repository root

With scikit-build-core, the pyproject.toml is at the repository root,
not in wrappers/Python/. Updated cibuildwheel configuration:
- Changed package-dir from ./wrappers/Python/ to .
- Removed redundant CIBW_BEFORE_BUILD (dependencies are in pyproject.toml)
- Build dependencies are now automatically installed by pip from pyproject.toml

This fixes the "Multiple top-level packages discovered" error.

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

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

* Set macOS deployment target to 11.0 in pyproject.toml

Configure MACOSX_DEPLOYMENT_TARGET=11.0 (Big Sur) in cibuildwheel config.
This matches the setting in GitHub Actions and ensures wheels are built
with consistent compatibility for macOS 11.0 and later.

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

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

* Remove old pyproject.toml from wrappers/Python

This file was used by the old setuptools build system. With
scikit-build-core, the main pyproject.toml at the repository root
is now used for all Python packaging configuration.

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

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

* Remove redundant PyPy skip selector from cibuildwheel

The 'pp*' skip selector was causing a warning because PyPy isn't enabled
in the build matrix anyway. Since we explicitly specify only CPython
versions in the build directive (cp38-*, cp39-*, etc.), the pp* skip is
unnecessary.

Fixes warning: "Invalid skip selector: 'pp*'. This selector matches a
group that wasn't enabled."

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

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

* Update fmtlib from 11.1.3 to 12.0.0

Updated the fmtlib submodule to the latest stable release (12.0.0).

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

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

* Remove pdsim

---------

Co-authored-by: Claude <noreply@anthropic.com>
2025-10-11 13:07:10 -04:00
Ian Bell
238ca71e48 Python 3.14 support? (#2630)
* Python 3.14 support?

* Don't need explicit skip for pypy

* Explicit 3.14

* wrong python for pip?

* Another pyproject.toml to fix deps?
2025-10-10 08:59:01 -04:00
Ian Bell
0708ca97de More debugging, please and thank you 2025-05-23 08:25:41 -04:00
Ian Bell
409626463d Pass through as input? 2025-05-22 21:10:35 -04:00
Ian Bell
cfdfcbf84c Try to fix the version mess for test pypi again
confidence levels are low
2025-05-22 21:03:00 -04:00
Ian Bell
d6430b9d8c CIBW args are weird 2025-04-10 22:03:56 -04:00
Ian Bell
f0d90a73b1 Try a more elegant solution for python 2025-04-10 21:46:36 -04:00
Ian Bell
0d68ee8a67 Try a different workaround for git revision issue 2025-04-10 21:27:46 -04:00
Ian Bell
8a70a86f73 Another check 2025-04-10 19:34:28 -04:00
Ian Bell
f1062f6285 Check that git revision is not placeholder in wheels
see #2531
2025-04-10 19:30:40 -04:00
Ian Bell
1abb9601d6 Bump some checkouts to newer versions
Might help to fix issues like those in https://github.com/actions/checkout/issues/1048
2025-04-10 19:26:42 -04:00
Ian Bell
6012b31544 Bump deployment target for mac to 11.0
Was released in 2020: https://en.wikipedia.org/wiki/MacOS_version_history
2025-04-04 20:00:23 -04:00
Ian Bell
f03e8aa810 Revert "Modernize use of git in building headers"
This reverts commit 1419689b66.
2025-03-08 08:27:05 -05:00
Ian Bell
16342a3a85 Revert "One more gitpython"
This reverts commit 3af1c4890c.
2025-03-08 08:26:49 -05:00
Ian Bell
3af1c4890c One more gitpython 2025-03-08 08:23:43 -05:00
Ian Bell
1419689b66 Modernize use of git in building headers 2025-03-08 08:11:26 -05:00
Ian Bell
f071be3a51 Fix the runner names for github actions
Was required to add arm64 runners; the -latest broke the naming of the arm64 runner
2025-02-22 14:36:41 -05:00
Ian Bell
275581e1ab Move to a more sane option for managing boost archive expansion 2025-01-01 15:07:45 -05:00
Ian Bell
1f428fd935 Try to fix the python 3.13 builds on windows
Remove the string in interface. It seems like the string here should be left untyped to allow auto conversion of strings
2024-12-30 15:21:58 -05:00
Niels Holswilder
fbb2d587bd Python 3.13 and replace distutils with setuptools PEP 632 – Deprecate distutils (#2436)
* Update setup.py replace distutils with setuptools

PEP 632 – Deprecate distutils module.

Edit line 4-6:
from distutils.version import LooseVersion
from distutils.sysconfig import get_config_var
from setuptools.command.build_ext import build_ext
To
from packaging.version import Version
from sysconfig import get_config_var
from setuptools.command.build_ext import build_ext

Edit line 291:
cython_version = Version (Cython.__version__)
To
cython_version = str(Version (Cython.__version__))

Edit line 353:
from distutils.errors import CompileError
To
from setuptools import CompileError

Edit line 394:
from Cython.Distutils.extension import Extension
To
from setuptools.extension import Extension

Delete line 396:
from Cython.Distutils import build_ext
This is now handled with line 6 and thus redundant
from setuptools.command.build_ext import build_ext

Edit line 3, 60, 61 62, 66, 77, 229, and 291
Replace all instances of LooseVersion with Version

* Update python_buildwheels.yml

* Update python_cibuildwheel.yml

* Update setup.py

* Update setup.py

* Update setup.py

* Update python_buildwheels.yml

Added module packaging to the list of dependencies.

* Update python_cibuildwheel.yml

Updated cibuildwheel version form 2.17.0 to latest edition 2.21.3 for python 3.13 support.

* Update python_buildwheels.yml

Deleted lines with python specific exclusions for Windows ARM64 as it already excluded generically.

* Update python_buildwheels.yml

Deleted lines with python specific exclusions for MacOS as these are no longer supported.
2024-11-07 20:45:25 -05:00
Ian Bell
a78541ad44 Make the artifact files uniquely named 2024-09-07 11:31:04 -04:00
Ian Bell
ccbb9d289c Bump action version for QEMU 2024-09-07 11:30:37 -04:00
Ian Bell
161098ff91 Bump a lot of actions to newer versions 2024-09-07 10:25:32 -04:00
Ian Bell
3c60f822b6 Bump cibuildwheel version
Maybe it fixes the failures?
2024-03-23 11:56:42 -04:00
Ian Bell
4e39188a8f Another new Cython permitted 2023-11-03 19:09:27 -04:00
Ian Bell
b54caf55d9 Bump cibuildwheel to turn on python 3.12
See #2310
2023-11-03 18:25:07 -04:00
Arnab Mahanti
db1b0953cd Revert "Fix failing python_cibuildwheel workflows" and update (#2271)
* Revert "Switch to older cython version (#2270)"

This reverts commit 3a16339a8c.

* updated to cython<3.0
2023-07-26 12:08:33 -04:00
Arnab Mahanti
3a16339a8c Switch to older cython version (#2270) 2023-07-26 10:51:05 -04:00
Jorrit Wronski
62f9022182 one more typo in the job file 2022-12-08 00:28:51 +01:00
Jorrit Wronski
d9d87a960e Simplify the build selector for Python 2022-12-07 23:55:35 +01:00
Jorrit Wronski
a14412559e Automatically convert ARM64 to arm64 2022-12-07 19:58:12 +01:00
Jorrit Wronski
8375065bc5 back to the old definition 2022-12-07 15:49:13 +01:00
Jorrit Wronski
6bd16ece89 More architecture debugging 2022-12-07 15:46:10 +01:00
Jorrit Wronski
4902147821 Handle missing arch identifier 2022-12-07 15:39:24 +01:00
Jorrit Wronski
8d18be564b Fix the architecture selection 2022-12-07 15:36:49 +01:00
Jorrit Wronski
ab5fbf9203 Update the actions to avoid Node.js 12 warnings 2022-12-07 15:05:03 +01:00
Jorrit Wronski
fc59025b50 use the tagged action 2022-12-07 14:04:28 +01:00
Jorrit Wronski
42989cbfe5 Pass the OS as part of the call 2022-12-07 13:58:47 +01:00
Jorrit Wronski
c9c7018cf9 Build the wheels with a reusable workflow 2022-12-07 13:47:26 +01:00
Jorrit Wronski
2ba2f122a3 Skip one more cross-compilation architecture 2022-12-07 12:01:45 +01:00
Jorrit Wronski
626f8d4a5f Remove the Windows ARM64 builds for now, more debugging is needed 2022-12-07 11:38:39 +01:00
Jorrit Wronski
720355220d Checking for ARM64 on Windows 2022-12-07 00:05:41 +01:00
Jorrit Wronski
76daa5abe6 Force a native build on Linux instead of 64bit 2022-12-06 23:16:03 +01:00
Jorrit Wronski
61e6ed4577 skip universal2 on macOS 2022-12-06 22:51:03 +01:00
Jorrit Wronski
daa265b55c Do not compile i686 on Linux 2022-12-06 22:47:50 +01:00
Jorrit Wronski
17ee4d2144 Renamed the Python build jobs 2022-12-06 22:40:40 +01:00
Jorrit Wronski
18381431c2 Use the default action to build wheels 2022-12-06 22:38:18 +01:00
Jorrit Wronski
522e810574 Build the docs for v6.4.2 (#2191)
- Streamlined the build of the HTML documentation based on a private docker image.
- Invoke doxygen and Sphinx to create the final HTML pages.
- Employ a cache for the GitHub actions to store the output of the expensive tasks.
- Restructured the GitHub actions builders and introduced a naming scheme.
- Fixed a few typos in the docs.
- Automatically publish the documentation to GitHub pages.
2022-12-06 21:49:08 +01:00
Jorrit Wronski
3d423d8034 Use the Python directory 2022-12-01 13:06:52 +01:00
Jorrit Wronski
d390c2927b Include folder names 2022-11-30 00:14:17 +01:00