[build-system]
requires = ["scikit-build-core", "cython @cython_version_spec@", "numpy>=2.0"]
build-backend = "scikit_build_core.build"

[project]
name = "cantera"
version = "@cantera_version@"
description = "Cantera is an open-source suite of tools for problems involving chemical kinetics, thermodynamics, and transport processes."
authors = [{name = "Cantera Developers", email = "developers@cantera.org"}]
keywords = ["chemistry physics"]
license = "BSD-3-Clause"
license-files = ["License.txt"]
classifiers = [
    "Development Status :: 5 - Production/Stable",
    "Intended Audience :: Education",
    "Intended Audience :: Science/Research",
    "Operating System :: MacOS :: MacOS X",
    "Operating System :: Microsoft :: Windows",
    "Operating System :: POSIX :: Linux",
    "Programming Language :: C",
    "Programming Language :: C++",
    "Programming Language :: Cython",
    "Programming Language :: Fortran",
    "Programming Language :: Python :: 3 :: Only",
    "Programming Language :: Python :: 3.10",
    "Programming Language :: Python :: 3.11",
    "Programming Language :: Python :: 3.12",
    "Programming Language :: Python :: 3.13",
    "Programming Language :: Python :: Implementation :: CPython",
    "Topic :: Scientific/Engineering :: Chemistry",
    "Topic :: Scientific/Engineering :: Physics",
]
requires-python = "@py_requires_ver_str@"
dependencies = [
    "numpy @numpy_version_spec@",
    "ruamel.yaml @ruamel_version_spec@",
]

[project.readme]
file = "README.rst"
content-type = "text/x-rst"

[project.urls]
Homepage = "https://cantera.org"
Documentation = "https://cantera.org/stable/reference"
Funding = "https://numfocus.org/donate-to-cantera"
Source = "https://github.com/Cantera/cantera"
Tracker = "https://github.com/Cantera/cantera/issues"

[project.optional-dependencies]
pandas = ["pandas"]
units = ["pint"]
graphviz = ["graphviz"]

[project.scripts]
ck2yaml = "cantera.ck2yaml:main"
cti2yaml = "cantera.cti2yaml:main"
ctml2yaml = "cantera.ctml2yaml:main"
yaml2ck = "cantera.yaml2ck:main"
lxcat2yaml = "cantera.lxcat2yaml:main"

[tool.scikit-build]
logging.level = "DEBUG"
build.verbose = true

[tool.scikit-build.cmake]
version = ">=3.27"

[tool.scikit-build.ninja]
# As of 01-DEC-2024, Ninja 1.12 is not available on PyPI
version = ">=1.11"
make-fallback = false

[tool.scikit-build.cmake.define]
CMAKE_POSITION_INDEPENDENT_CODE = "ON"
Boost_INCLUDE_DIRS = { env = "Boost_INCLUDE_DIRS" }
HDF5_ROOT = { env = "HDF5_ROOT" }

[tool.scikit-build.sdist]
exclude = ["pyproject.toml.in", "cantera/with_units/solution.py.in"]

[tool.scikit-build.wheel]
exclude = ["include", "lib", "share", "**.pyx", "cantera/CMakeLists.txt"]

[tool.cibuildwheel]
build-frontend = { name="build", args=["-vv"] }
skip = "*musllinux*"
test-extras = ["pandas", "units", "graphviz"]
test-requires = ["pytest"]
manylinux-x86_64-image = "ghcr.io/cantera/cantera-base-manylinux_2_28-x86_64"
manylinux-aarch64-image = "ghcr.io/cantera/cantera-base-manylinux_2_28-aarch64"
test-command = "pytest -vv --durations=100 ${CANTERA_TEST_DIR}/test/python"

[tool.cibuildwheel.windows]
before-build = "pip install delvewheel"
repair-wheel-command = "delvewheel repair --add-path %HDF5_LIB_DIR%;%SUNDIALS_LIB_DIR% -w {dest_dir} {wheel}"
test-command = "pytest -vv --durations=100 %CANTERA_TEST_DIR%\\test\\python"

[tool.cibuildwheel.macos]
# https://cibuildwheel.pypa.io/en/stable/faq/#macos-passing-dyld_library_path-to-delocate
repair-wheel-command = """\
DYLD_FALLBACK_LIBRARY_PATH=${DYLD_FALLBACK_LIBRARY_PATH} \
delocate-wheel --require-archs {delocate_archs} -w {dest_dir} -v {wheel}
"""
