[project]
name = "manifold3d"
version = "3.0.0"
authors = [
  { name="Emmett Lalish", email="elalish@gmail.com" },
]
description = "Library for geometric robustness"
readme = "README.md"
classifiers = [
    "Development Status :: 5 - Production/Stable",
    "License :: OSI Approved :: Apache Software License",
    "Operating System :: OS Independent",
    "Programming Language :: C++",
    "Topic :: Multimedia :: Graphics :: 3D Modeling",
]
requires-python = ">=3.8"

dependencies = [
    "numpy; python_version<'3.12'",
    "numpy>=1.26.0b1; python_version>='3.12'"
]

[project.urls]
"Homepage" = "https://github.com/elalish/manifold"
"Bug Tracker" = "https://github.com/elalish/manifold/issues"

[build-system]
requires = [
    "nanobind>=1.8.0,<=2.2.0",
    "scikit-build-core",
]
build-backend = "scikit_build_core.build"

[tool.scikit-build]
cmake.minimum-version = "3.18"
sdist.exclude = [
    ".github",
    "bindings/c",
    "bindings/wasm",
    "docs",
    "extras",
    "samples",
    "test",
    "oneTBB", # we may have this when we build with cibuildwheel
]
wheel.packages = ["manifold3d"]
cmake.args = ["-DMANIFOLD_PYBIND=ON", "-DMANIFOLD_CBIND=OFF", "-DMANIFOLD_PAR=ON", "-DMANIFOLD_TEST=OFF", "-DBUILD_SHARED_LIBS=OFF"]
install.components = ["bindings"]

[tool.cibuildwheel]
build-frontend = "build"
test-requires = ["trimesh", "pytest"]
test-command = "python {project}/bindings/python/examples/run_all.py"
# Setuptools bug causes collision between pypy and cpython artifacts
manylinux-x86_64-image = "manylinux_2_28"
musllinux-x86_64-image = "musllinux_1_2"
skip = ["*-win32", "*_i686", "pp*", "*-musllinux*"]

# only clone TBB once
before-all = "git clone --depth 1 --branch v2021.10.0 https://github.com/oneapi-src/oneTBB.git"
[tool.cibuildwheel.config-settings]
"cmake.define.FETCHCONTENT_SOURCE_DIR_TBB" = "./oneTBB"
"cmake.define.FETCHCONTENT_UPDATES_DISCONNECTED" = "ON"

[tool.cibuildwheel.macos]
environment = "MACOSX_DEPLOYMENT_TARGET=10.14"

[tool.cibuildwheel.windows]
before-build = "pip install delvewheel"
repair-wheel-command = "delvewheel repair -w {dest_dir} {wheel}"
