66 lines · toml
1# Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.2# See https://llvm.org/LICENSE.txt for license information.3# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception4# Copyright (c) 2025.5 6[project]7name = "standalone-python-bindings"8dynamic = ["version"]9requires-python = ">=3.8,<=3.14"10dependencies = [11 "numpy>=1.19.5, <=2.1.2",12 "PyYAML>=5.4.0, <=6.0.1",13 "ml_dtypes>=0.1.0, <=0.6.0; python_version<'3.13'",14 "ml_dtypes>=0.5.0, <=0.6.0; python_version>='3.13'",15]16 17[project.urls]18Homepage = "https://github.com/llvm/llvm-project"19Discussions = "https://discourse.llvm.org/"20"Issue Tracker" = "https://github.com/llvm/llvm-project/issues?q=is%3Aissue%20state%3Aopen%20label%3Amlir%3Apython%20"21"Source Code" = "https://github.com/llvm/llvm-project/tree/main/mlir/python"22 23[build-system]24requires = [25 "scikit-build-core>=0.10.7",26 "typing_extensions>=4.12.2",27 "nanobind>=2.9, <3.0",28 "pybind11>=2.10.0, <=2.13.6",29]30build-backend = "scikit_build_core.build"31 32[tool.scikit-build]33# This is the minimum version of scikit-build-core.34minimum-version = "0.10.7"35# This pyproject.toml must be adjacent to the root CMakeLists.txt (wherever project(...) is specified).36cmake.source-dir = "."37# This is for installing/distributing the python bindings target and only the python bindings target.38build.targets = ["StandalonePythonModules"]39install.components = ["StandalonePythonModules"]40 41[tool.scikit-build.cmake.define]42# Optional43CMAKE_C_COMPILER = { env = "CMAKE_C_COMPILER", default = "" }44CMAKE_CXX_COMPILER = { env = "CMAKE_CXX_COMPILER", default = "" }45CMAKE_C_COMPILER_LAUNCHER = { env = "CMAKE_C_COMPILER_LAUNCHER", default = "" }46CMAKE_CXX_COMPILER_LAUNCHER = { env = "CMAKE_CXX_COMPILER_LAUNCHER", default = "" }47CMAKE_GENERATOR = { env = "CMAKE_GENERATOR", default = "Ninja" }48LLVM_USE_LINKER = { env = "LLVM_USE_LINKER", default = "" }49# Optional but highly recommended (this makes the bindings compatible with other bindings packages50# by preventing symbol collisions).51CMAKE_VISIBILITY_INLINES_HIDDEN = "ON"52CMAKE_C_VISIBILITY_PRESET = "hidden"53CMAKE_CXX_VISIBILITY_PRESET = "hidden"54 55# Non-optional (alternatively you could use CMAKE_PREFIX_PATH here).56MLIR_DIR = { env = "MLIR_DIR", default = "" }57# Non-optional58CMAKE_BUILD_TYPE = { env = "CMAKE_BUILD_TYPE", default = "Release" }59MLIR_ENABLE_BINDINGS_PYTHON = "ON"60# Effectively non-optional (any downstream project should specify this).61MLIR_PYTHON_PACKAGE_PREFIX = "mlir_standalone"62# This specifies the directory in the install directory (i.e., /tmp/pip-wheel/platlib) where _mlir_libs, dialects, etc.63# are installed. Thus, this will be the package location (and the name of the package) that pip assumes is64# the root package.65MLIR_BINDINGS_PYTHON_INSTALL_PREFIX = "mlir_standalone"66