|
| 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-exception |
| 4 | +# Copyright (c) 2025. |
| 5 | + |
| 6 | +[project] |
| 7 | +name = "standalone-python-bindings" |
| 8 | +dynamic = ["version"] |
| 9 | +requires-python = ">=3.8,<=3.14" |
| 10 | +dependencies = [ |
| 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] |
| 18 | +Homepage = "https://github.com/llvm/llvm-project" |
| 19 | +Discussions = "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] |
| 24 | +requires = [ |
| 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 | +] |
| 30 | +build-backend = "scikit_build_core.build" |
| 31 | + |
| 32 | +[tool.scikit-build] |
| 33 | +# This is the minimum version of scikit-build-core. |
| 34 | +minimum-version = "0.10.7" |
| 35 | +# This pyproject.toml must be adjacent to the root CMakeLists.txt (wherever project(...) is specified). |
| 36 | +cmake.source-dir = "." |
| 37 | +# This is for installing/distributing the python bindings target and only the python bindings target. |
| 38 | +build.targets = ["StandalonePythonModules"] |
| 39 | +install.components = ["StandalonePythonModules"] |
| 40 | + |
| 41 | +[tool.scikit-build.cmake.define] |
| 42 | +# Optional |
| 43 | +CMAKE_C_COMPILER = { env = "CMAKE_C_COMPILER", default = "" } |
| 44 | +CMAKE_CXX_COMPILER = { env = "CMAKE_CXX_COMPILER", default = "" } |
| 45 | +CMAKE_C_COMPILER_LAUNCHER = { env = "CMAKE_C_COMPILER_LAUNCHER", default = "" } |
| 46 | +CMAKE_CXX_COMPILER_LAUNCHER = { env = "CMAKE_CXX_COMPILER_LAUNCHER", default = "" } |
| 47 | +CMAKE_GENERATOR = { env = "CMAKE_GENERATOR", default = "Ninja" } |
| 48 | +LLVM_USE_LINKER = { env = "LLVM_USE_LINKER", default = "" } |
| 49 | +# Optional but highly recommended (this makes the bindings compatible with other bindings packages |
| 50 | +# by preventing symbol collisions). |
| 51 | +CMAKE_VISIBILITY_INLINES_HIDDEN = "ON" |
| 52 | +CMAKE_C_VISIBILITY_PRESET = "hidden" |
| 53 | +CMAKE_CXX_VISIBILITY_PRESET = "hidden" |
| 54 | + |
| 55 | +# Non-optional (alternatively you could use CMAKE_PREFIX_PATH here). |
| 56 | +MLIR_DIR = { env = "MLIR_DIR", default = "" } |
| 57 | +# Non-optional |
| 58 | +CMAKE_BUILD_TYPE = { env = "CMAKE_BUILD_TYPE", default = "Release" } |
| 59 | +MLIR_ENABLE_BINDINGS_PYTHON = "ON" |
| 60 | +# Effectively non-optional (any downstream project should specify this). |
| 61 | +MLIR_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 is |
| 64 | +# the root package. |
| 65 | +MLIR_BINDINGS_PYTHON_INSTALL_PREFIX = "mlir_standalone" |
0 commit comments