content: [project]
  name = 'oofem'
  requires-python = '>=3.11'
  readme='README.md'
  license={'file'='COPYING.LGPLv2.1'}
  dynamic=['version']
  dependencies = [ 'pytest', 'numpy', 'matplotlib' ]
  description='oofem etc' 
  
  [build-system]
  #requires = ['py-build-cmake~=0.4.2','pytest']
  #build-backend = "py_build_cmake.build"
  requires=['scikit-build-core','pybind11','pytest']
  build-backend = 'scikit_build_core.build'
  
  [tool.scikit-build]
  metadata.version.provider = "scikit_build_core.metadata.setuptools_scm"
  build.verbose = true
  logging.level = 'INFO'
  install.components=['python_module']
  sdist.cmake = false
  sdist.exclude = ['.cache','.wenv']
  wheel.packages = ['bindings/python/oofem']
  #sdist.include = ['CMakeLists.txt','bindings/python','cmake','src','extern','doc','README','README.md','pyproject.toml','COPYING.LGPLv2.1']
  
  [tool.setuptools_scm]
  
  [tool.py-build-cmake.sdist]
  include = ['CMakeLists.txt','bindings/python','cmake','src','extern','doc','README']
  exclude = ['**/_build','.*']
  
  [tool.py-build-cmake.cmake]
  minimum_version="3.17"
  build_type="Release"
  options = {'USE_PYBIND_BINDINGS'='1','USE_SHARED_LIB'='0','USE_SM'='1','USE_FM'='1','USE_TM'='1','USE_MPM'='1','USE_OOFEM_EXE'='0'}
  install_components=['python_module']
  # https://github.com/pypa/cibuildwheel/issues/643
  # use Ninja everywhere (including windows), where it needs compiler paths to be set up (done via setup-msvc-dev in cibuildwheel.yml)
  generator ='Ninja'
  
  [tool.scikit-build.cmake]
  build-type="Release"
  args=['-GNinja']
  
  [tool.scikit-build.cmake.define]
  USE_PYBIND_BINDINGS=1
  USE_SHARED_LIB=0
  USE_SM=1
  USE_FM=1
  USE_TM=1
  USE_MPM=1
  USE_OOFEM_EXE=0
  
  [[tool.scikit-build.overrides]]
  if.platform-system='win32'
  cmake.args=['-GNinja','-DCMAKE_C_COMPILER=cl','-DCMAKE_CXX_COMPILER=cl']
  
  [tool.py-build-cmake.windows.cmake]
  # extra options, but pass them as args so that options don't have to be repeated
  args = ['-DCMAKE_C_COMPILER=cl','-DCMAKE_CXX_COMPILER=cl']
  
  [tool.py-build-cmake.module]
  name='oofem'
  directory = 'bindings/python'
  
  [tool.py-build-cmake.editable]
  mode='symlink'
  build_hook = true
  
  #[tool.mypy]
  #files = "setup.py"
  #python_version = "3.7"
  #strict = true
  #show_error_codes = true
  #enable_error_code = ["ignore-without-code", "redundant-expr", "truthy-bool"]
  #warn_unreachable = true
  
  #[[tool.mypy.overrides]]
  #module = ["ninja"]
  #ignore_missing_imports = true
  
  
  [tool.pytest.ini_options]
  testpaths = ["bindings/python/tests"]
  pythonpath=["bindings/python/oofem","build"]
  
  [tool.cibuildwheel]
  test-command = "pytest {project}/bindings/python/tests"
  # test-extras = ["test"]
  # test-skip = ["*universal2:arm64"]
  # Setuptools bug causes collision between pypy and cpython artifacts
  before-build = "rm -rf {project}/build"
  build-verbosity = 1
  # see https://cibuildwheel.pypa.io/en/stable/cpp_standards/#macos-and-deployment-target-versions for MACOSX_DEPLOYMENT_TARGET
  environment = { PY_BUILD_CMAKE_VERBOSE="1", MACOSX_DEPLOYMENT_TARGET="10.14" }
  # same as CIBW_SKIP environment in the workflow file (cibuildhweel.yml)
  # (a) skip all 32-bit builds (source issue: datastream.h assumes size_t != unsigned long, which breaks on 32bit)
  # (b) skipy pypy builds: embedding interpreter not supported (pythonfield.C)
  # (c) skip all musllinux builds (compiles but segfaults at import time)
  skip = "*-win32 *-manylinux_i686 pp* *musllinux*"
  
  [tool.cibuildwheel.linux]
  # skip i686 on linux
  archs = ["x86_64"]
  
  #[[tool.cibuildwheel.windows]]
  ## seems not necessary with MSVC builds, and might become the default in cibuildwheel itself later
  #before-build = "pip install delvewheel"
  #repair-wheel-command = "delvewheel repair -w {dest_dir} {wheel}"
  