content: [build-system]
  requires = [
      "scikit-build-core",
      "nanobind==2.9.2",
      "drjit==1.2.0",
      "typing_extensions>=4.12",
      "hatch-fancy-pypi-readme",
  ]
  build-backend = "scikit_build_core.build"
  
  
  [project]
  name = "Mitsuba"
  dynamic = ["version", "readme"]
  description = "Mitsuba 3: A Retargetable Forward and Inverse Renderer"
  dependencies = [
    "typing_extensions>=4.12;python_version<\"3.11\"",
    "drjit==1.2.0",
  ]
  requires-python = ">=3.9"
  authors = [
      { name = "Wenzel Jakob", email = "wenzel.jakob@epfl.ch" }
  ]
  classifiers = [
      "License :: OSI Approved :: BSD License"
  ]
  
  [project.urls]
  Homepage = "https://github.com/mitsuba-renderer/mitsuba3"
  
  [project.scripts]
  mitsuba = "mitsuba.cli:_main"
  
  
  [tool.scikit-build]
  # Protect the configuration against future changes in scikit-build-core
  minimum-version = "0.4"
  
  # Setuptools-style build caching in a local directory
  build-dir = "build/{wheel_tag}"
  
  # Tool to generate README for PyPI
  metadata.readme.provider = "scikit_build_core.metadata.fancy_pypi_readme"
  
  cmake.verbose = true
  logging.level = "INFO"
  
  
  [tool.cibuildwheel]
  # Necessary to see build output from the actual compilation
  build-verbosity = 1
  
  build = ["cp39-*", "cp310-*", "cp311-*", "cp312-*", "cp313-*"]
  archs = ["auto64"]
  skip = "*-musllinux* pp*"
  
  # Try to import the package to see if it was built correctly (compromise)
  test-command = ["python -c \"import mitsuba as mi; mi.set_variant('scalar_rgb')\""]
  
  # Needed for full C++17 support
  [tool.cibuildwheel.macos.environment]
  MACOSX_DEPLOYMENT_TARGET = "10.14"
  
  [tool.cibuildwheel.macos]
  repair-wheel-command = "delocate-wheel --require-archs {delocate_archs} -w {dest_dir} --ignore-missing-dependencies {wheel}"
  
  [tool.cibuildwheel.linux]
  before-all = "yum install -y libatomic"
  
  repair-wheel-command = "pip install wheel>=0.40; new_whl_name=$(python -m wheel tags --platform-tag manylinux_2_17_x86_64.manylinux2014_x86_64 {wheel} | tail -1 | cat); cp $(dirname {wheel})/$new_whl_name {dest_dir}"
  
  [tool.pytest.ini_options]
  testpaths = [ "src" ]
  norecursedirs = [ "src/python" ]
  
  [tool.scikit-build.metadata.version]
  # Fetch version number from header file
  provider = "scikit_build_core.metadata.regex"
  input = "include/mitsuba/mitsuba.h"
  regex = '''(?sx)
  \#define \s+ MI_VERSION_MAJOR \s+ (?P<major>\d+) .*?
  \#define \s+ MI_VERSION_MINOR \s+ (?P<minor>\d+) .*?
  \#define \s+ MI_VERSION_PATCH \s+ (?P<patch>\d+) .*?
  '''
  result = "{major}.{minor}.{patch}"
  
  # Build PyPI compliant README file from original README.md
  [tool.hatch.metadata.hooks.fancy-pypi-readme]
  content-type = "text/markdown"
  
  [[tool.hatch.metadata.hooks.fancy-pypi-readme.fragments]]
  text = '''
  ![Mitsuba banner](https://raw.githubusercontent.com/mitsuba-renderer/mitsuba-data/master/docs/images/banners/banner_01.jpg)
  '''
  
  [[tool.hatch.metadata.hooks.fancy-pypi-readme.fragments]]
  path = "README.md"
  start-after = "Mitsuba banner\">\n"
  pattern = "(.*)"
  