#########################
# build-system settings #
#########################

[build-system]
requires = [
    "scikit-build-core>=0.8",
]
build-backend = "scikit_build_core.build"


####################
# project settings #
####################

[project]
name = "python-casacore"
description = "A wrapper around CASACORE, the radio astronomy library"
dynamic = ["version"]
keywords = ["pyrap", "casacore", "utilities", "astronomy"]
license = {file = "LICENSE"}
readme = {file = "README.rst", content-type = "text/x-rst"}
requires-python = ">=3.10"
authors = [
    {name = "Malte Marquarding", email = "Malte.Marquarding@gmail.com"},
    {name = "Ger van Diepen", email = "gervandiepen@gmail.com"},
    {name = "Gijs Molenaar", email = "gijs@pythonic.nl"},
    {name = "Tammo Jan Dijkema", email = "dijkema@astron.nl"},
    {name = "Marcel Loose", email = "loose@astron.nl"},
]
classifiers=[
    "Development Status :: 5 - Production/Stable",
    "Intended Audience :: Science/Research",
    "License :: OSI Approved :: GNU Lesser General Public License v3 (LGPLv3)",
    "Natural Language :: English",
    "Operating System :: POSIX :: Linux",
    "Programming Language :: C++",
    "Programming Language :: Python :: 3",
    "Topic :: Scientific/Engineering :: Astronomy",
]
dependencies = [
    "numpy",
]

[project.urls]
Homepage = "https://github.com/casacore/python-casacore"


#########################
# cibuildwheel settings #
#########################

[tool.cibuildwheel]
build = "cp3{10,11,12,13,14}-*_x86_64"
build-verbosity = 1
environment = """ \
    CXXFLAGS="-I/usr/include/cfitsio" \
    LD_LIBRARY_PATH=/opt/boost/lib \
"""
test-command = "cd {package}/tests && pytest"
test-requires = "pytest"

[tool.cibuildwheel.macos]
repair-wheel-command = """\
    DYLD_LIBRARY_PATH=${BOOST_INSTALL_DIR}/lib delocate-wheel \
    --require-archs {delocate_archs} -w {dest_dir} -v {wheel}\
"""

[tool.cibuildwheel.linux]
skip = ["*-musllinux_*"]

[[tool.cibuildwheel.overrides]]
select="cp310-*"
manylinux-x86_64-image = "quay.io/casacore/casacore:py310_v3.8.1"

[[tool.cibuildwheel.overrides]]
select="cp311-*"
manylinux-x86_64-image = "quay.io/casacore/casacore:py311_v3.8.1"

[[tool.cibuildwheel.overrides]]
select="cp312-*"
manylinux-x86_64-image = "quay.io/casacore/casacore:py312_v3.8.1"

[[tool.cibuildwheel.overrides]]
select="cp313-*"
manylinux-x86_64-image = "quay.io/casacore/casacore:py313_v3.8.1"

[[tool.cibuildwheel.overrides]]
select="cp314-*"
manylinux-x86_64-image = "quay.io/casacore/casacore:py314_v3.8.1"


#########################
# scikit-build settings #
#########################

[tool.scikit-build]
cmake.version = ">=3.15"
ninja.version = ">=1.5"
logging.level = "INFO"
install.components = ["data", "libraries"]
metadata.version.provider = "scikit_build_core.metadata.setuptools_scm"
sdist.exclude = [".github", ".gitignore"]
sdist.include = ["casacore/_version.py"]
wheel.packages = ["casacore", "pyrap"]

[tool.scikit-build.cmake.define]
BUILD_TESTING = "ON"


###########################
# setuptools_scm settings #
###########################

[tool.setuptools_scm]
write_to = "casacore/_version.py"
