| # Licensed to the Apache Software Foundation (ASF) under one |
| # or more contributor license agreements. See the NOTICE file |
| # distributed with this work for additional information |
| # regarding copyright ownership. The ASF licenses this file |
| # to you under the Apache License, Version 2.0 (the |
| # "License"); you may not use this file except in compliance |
| # with the License. You may obtain a copy of the License at |
| # |
| # http://www.apache.org/licenses/LICENSE-2.0 |
| # |
| # Unless required by applicable law or agreed to in writing, |
| # software distributed under the License is distributed on an |
| # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY |
| # KIND, either express or implied. See the License for the |
| # specific language governing permissions and limitations |
| # under the License. |
| |
| [build-system] |
| requires = ["scikit-build-core>=0.10.0"] |
| build-backend = "scikit_build_core.build" |
| |
| [project] |
| name = "tvm" |
| # Note: Call version.py to update the version before building the wheel |
| version = "0.24.dev0" |
| description = "Apache TVM: An End-to-End Deep Learning Compiler Stack" |
| readme = "README.md" |
| license = { text = "Apache-2.0" } |
| requires-python = ">=3.10" |
| authors = [{ name = "Apache TVM Community", email = "dev@tvm.apache.org" }] |
| keywords = ["machine learning", "compiler", "deep learning", "inference"] |
| classifiers = [ |
| "Development Status :: 4 - Beta", |
| "Intended Audience :: Developers", |
| "Intended Audience :: Education", |
| "Intended Audience :: Science/Research", |
| "License :: OSI Approved :: Apache Software License", |
| "Programming Language :: Python :: 3", |
| "Programming Language :: Python :: 3.9", |
| "Programming Language :: Python :: 3.10", |
| "Programming Language :: Python :: 3.11", |
| "Programming Language :: Python :: 3.12", |
| "Topic :: Scientific/Engineering :: Artificial Intelligence", |
| "Topic :: Software Development :: Libraries :: Python Modules", |
| ] |
| # Core dependencies - these are the minimum required for basic TVM functionality |
| dependencies = [ |
| "apache-tvm-ffi", |
| "cloudpickle", |
| "ml_dtypes", |
| "numpy", |
| "packaging", |
| "psutil", |
| "scipy", |
| "tornado", |
| "typing_extensions", |
| ] |
| |
| # Optional dependencies for different features |
| [project.optional-dependencies] |
| # Model importers |
| importer-coreml = ["coremltools"] |
| importer-keras = ["tensorflow", "tensorflow-estimator"] |
| importer-onnx = [ |
| "future", |
| "onnx", |
| "onnxoptimizer", |
| "onnxruntime", |
| "torch", |
| "torchvision", |
| ] |
| importer-pytorch = ["torch", "torchvision"] |
| importer-tensorflow = ["tensorflow", "tensorflow-estimator"] |
| importer-tflite = ["tflite"] |
| importer-paddle = ["paddlepaddle"] |
| |
| # AutoTVM and autoscheduler |
| autotvm = ["xgboost"] |
| autoscheduler = ["xgboost"] |
| |
| # Development and testing |
| dev = [ |
| "ruff", |
| "mypy", |
| "pre-commit", |
| "pytest", |
| "pytest-xdist", |
| "pytest-cov", |
| "pytest-mock", |
| "pytest-benchmark", |
| "pytest-timeout", |
| "pytest-rerunfailures", |
| "pytest-repeat", |
| ] |
| |
| # All optional dependencies (excluding dev) |
| all = [ |
| "coremltools", |
| "tensorflow", |
| "tensorflow-estimator", |
| "future", |
| "onnx", |
| "onnxoptimizer", |
| "onnxruntime", |
| "torch", |
| "torchvision", |
| "tflite", |
| "paddlepaddle", |
| "xgboost", |
| ] |
| |
| [project.urls] |
| Homepage = "https://tvm.apache.org/" |
| Documentation = "https://tvm.apache.org/docs/" |
| Repository = "https://github.com/apache/tvm" |
| "Bug Tracker" = "https://github.com/apache/tvm/issues" |
| |
| [tool.scikit-build] |
| # Point to the root CMakeLists.txt |
| cmake.source-dir = "." |
| cmake.build-type = "Release" |
| |
| # Configure the wheel to be Python version-agnostic |
| wheel.py-api = "py3" |
| |
| # Build configuration |
| build-dir = "build" |
| |
| # CMake configuration - ensure proper installation paths |
| cmake.args = ["-DTVM_BUILD_PYTHON_MODULE=ON"] |
| |
| # Wheel configuration |
| wheel.packages = ["python/tvm"] |
| wheel.install-dir = "tvm" |
| |
| # Source distribution configuration |
| sdist.include = [ |
| # Build files |
| "/CMakeLists.txt", |
| "/pyproject.toml", |
| "/cmake/**/*", |
| "/ */*", |
| |
| # Source code |
| "/src/**/*.cc", |
| "/src/**/*.h", |
| "/include/**/*.h", |
| |
| # Python source |
| "/python/tvm/**/*.py", |
| "/python/tvm/**/*.pyi", |
| |
| # Documentation and metadata |
| "/docs/**/*", |
| "/LICENSE", |
| "/README.md", |
| "/NOTICE", |
| |
| # Tests |
| "/tests/**/*", |
| ] |
| |
| sdist.exclude = [ |
| "**/.git", |
| "**/.github", |
| "**/__pycache__", |
| "**/*.pyc", |
| "build", |
| "dist", |
| "**/3rdparty/*/docs", |
| "**/3rdparty/*/media", |
| "**/3rdparty/*/examples", |
| "**/3rdparty/*/test", |
| ] |
| |
| # Logging |
| logging.level = "INFO" |
| |
| [tool.pytest.ini_options] |
| testpaths = ["tests"] |
| addopts = "-v --tb=short" |
| python_files = ["test_*.py", "*_test.py"] |
| python_classes = ["Test*"] |
| python_functions = ["test_*"] |
| |
| [tool.ruff] |
| include = [ |
| "python/**/*.py", |
| "tests/**/*.py", |
| "docs/**/*.py", |
| "apps/**/*.py", |
| "ci/scripts/**/*.py", |
| "conftest.py", |
| "jvm/**/*.py", |
| "version.py", |
| "web/tests/**/*.py", |
| ] |
| line-length = 100 |
| indent-width = 4 |
| target-version = "py310" |
| exclude = [ |
| "3rdparty", |
| "build", |
| "dist", |
| ".venv", |
| ".mypy_cache", |
| ".ruff_cache", |
| "node_modules", |
| ] |
| |
| [tool.ruff.lint] |
| select = [ |
| "E", # pycodestyle errors, https://docs.astral.sh/ruff/rules/#pycodestyle-e-w |
| "F", # pyflakes, https://docs.astral.sh/ruff/rules/#pyflakes-f |
| "I", # isort, https://docs.astral.sh/ruff/rules/#isort-i |
| "UP", # pyupgrade, https://docs.astral.sh/ruff/rules/#pyupgrade-up |
| "RUF", # ruff, https://docs.astral.sh/ruff/rules/#ruff-specific-rules-ruf |
| ] |
| ignore = [ |
| # pyupgrade (style preference or low-value) |
| "UP028", # yield-in-for-loop — sometimes clearer to keep |
| "UP030", # format-literals — minor |
| "UP031", # printf-string-formatting — style preference |
| # ruff (preview rules, not yet stable) |
| "RUF043", # pytest-raises-ambiguous-pattern |
| "RUF059", # unused-unpacked-variable |
| ] |
| fixable = ["ALL"] |
| unfixable = [] |
| |
| [tool.ruff.lint.per-file-ignores] |
| "__init__.py" = ["E402", "F401", "F403", "F405"] |
| |
| [tool.ruff.lint.isort] |
| known-first-party = ["tvm"] |
| |
| [tool.ruff.format] |
| quote-style = "double" |
| indent-style = "space" |
| skip-magic-trailing-comma = false |
| line-ending = "auto" |
| docstring-code-format = false |
| docstring-code-line-length = "dynamic" |
| |
| [tool.mypy] |
| python_version = "3.9" |
| show_error_codes = true |
| mypy_path = ["python"] |
| files = ["python/tvm"] |
| namespace_packages = true |
| explicit_package_bases = true |
| allow_redefinition = true |
| ignore_missing_imports = true |
| follow_imports = "skip" |
| strict_optional = false |
| exclude = '''(?x)( |
| ^\.venv/| |
| ^build/| |
| ^dist/| |
| ^\.mypy_cache/| |
| ^3rdparty/ |
| )''' |
| |
| [[tool.mypy.overrides]] |
| module = ["python.tvm.auto_scheduler.*"] |
| ignore_errors = true |
| |
| [[tool.mypy.overrides]] |
| module = ["python.tvm.runtime.*"] |
| ignore_errors = true |
| |
| [dependency-groups] |
| lint = ["pre-commit"] |