[build-system]
requires = ["setuptools>=75", "wheel"]
build-backend = "setuptools.build_meta"

[project]
name = "{{ library_name }}"
version = "{{ version }}"
description = "{{ description }}"
license = { text = "BSD 2-Clause License" }
readme = "README.md"
requires-python = ">=3.13"
keywords = []

authors = [{ name = "Aquaveo" }]

# Dependencies
dependencies = [
    "numpy",
    {%- for dependency in xms_dependencies -%}{%- if not (dependency.no_python | default(false)) %}{{'\n    '}}"{{ dependency.name }}>={{ dependency.version }}",{%- endif %}{% endfor %}
]

[tool.setuptools.packages.find]
include = ["xms*"]

[tool.setuptools.package-data]
# Include additional data files (compiled extensions)
"xms.{{ python_namespaced_dir }}" = ["*.pyd", "*.so", "*.dll", "*.dylib"]
{% if python_binding_type | default('pybind11') == 'vtk_wrap' %}
"xms.{{ python_namespaced_dir }}.*" = ["*.pyd", "*.so", "*.dll", "*.dylib"]
{% endif %}
# Force platform-specific wheel creation
[tool.setuptools]
# This ensures that wheels are platform-specific when binary files are present
zip-safe = false
include-package-data = true
{% if python_binding_type | default('pybind11') == 'pybind11' %}
ext-modules = [
  { name = "xms.{{ python_namespaced_dir }}._{{ library_name }}", sources = [], optional = true }
]
{% endif %}
[tool.cibuildwheel]
build = "cp313-*"
skip = ["*-musllinux_*"]

[tool.cibuildwheel.windows]
archs = "AMD64"

[tool.cibuildwheel.macos]
archs = "arm64"
environment = { MACOSX_DEPLOYMENT_TARGET = "15.0" }

[tool.cibuildwheel.linux]
archs = "x86_64"
repair-wheel-command = "cp {wheel} {dest_dir}"
