content: [project]
  name = "xgrammar"
  version = "0.1.25"
  description = "Efficient, Flexible and Portable Structured Generation"
  authors = [{ name = "MLC Team" }]
  readme = "README.md"
  license = { text = "Apache 2.0" }
  classifiers = [
    "License :: OSI Approved :: Apache Software License",
    "Development Status :: 4 - Beta",
    "Intended Audience :: Developers",
    "Intended Audience :: Education",
    "Intended Audience :: Science/Research",
  ]
  keywords = ["machine learning", "inference"]
  requires-python = ">=3.8, <4"
  dependencies = [
    "pydantic",
    "torch>=1.10.0",
    "transformers>=4.38.0",
    "triton; platform_system == 'Linux' and platform_machine == 'x86_64'",
    "mlx-lm; platform_system == 'Darwin' and platform_machine == 'arm64'",
    "ninja",
    "numpy",
    "typing-extensions>=4.9.0",
  ]
  
  [project.urls]
  Homepage = "https://xgrammar.mlc.ai/"
  GitHub = "https://github.com/mlc-ai/xgrammar"
  
  [project.optional-dependencies]
  test = [
    "huggingface-hub[cli]",
    "protobuf",
    "pytest",
    "sentencepiece",
    "tiktoken",
    # transformers==4.50.0 has error on MacOS.
    # https://github.com/huggingface/transformers/issues/36906
    "transformers<4.50.0; platform_system == 'Darwin'",
  ]
  
  [build-system]
  requires = ["scikit-build-core>=0.10.0", "nanobind==2.5.0"]
  build-backend = "scikit_build_core.build"
  
  [tool.scikit-build]
  minimum-version = "build-system.requires"
  
  # Build configuration
  build-dir = "build"
  build.verbose = true
  
  # CMake configuration
  cmake.version = "CMakeLists.txt"
  cmake.args = []
  cmake.build-type = "RelWithDebInfo"
  
  # Logging
  logging.level = "INFO"
  
  # Wheel configuration
  wheel.packages = ["python/xgrammar"]
  wheel.install-dir = "xgrammar"
  
  # Source distribution configuration
  sdist.include = [
    # Build files
    "/CMakeLists.txt",
    "/pyproject.toml",
    "/cmake/**/*",
    "/cpp/**/CMakeLists.txt",
  
    # Source code
    "/cpp/**/*.cc",
    "/cpp/**/*.cpp",
    "/cpp/**/*.h",
    "/include/**/*",
    "/python/xgrammar/**/*.py",
    "/python/xgrammar/py.typed",
  
    # Third party files
    "/3rdparty/**/*",
  
    # Documentation and metadata
    "/docs/**/*",
    "/LICENSE",
    "/README.md",
    "/NOTICE",
  
    # Tests
    "/tests/**/*",
  ]
  
  sdist.exclude = ["**/.git", "**/.github", "**/__pycache__", "**/*.pyc", "build", "dist"]
  
  # Editable install settings
  editable.rebuild = true
  editable.verbose = true
  
  [tool.pytest.ini_options]
  testpaths = ["tests"]
  addopts = "-rA --durations=0 --ignore=3rdparty"
  markers = ["hf_token_required: mark test as requiring a huggingface token"]
  
  [tool.mypy]
  strict = true
  
  [tool.ruff]
  include = ["python/**/*.py", "tests/**/*.py"]
  
  [tool.ruff.lint]
  # Never enforce `E501` (line length violations).
  ignore = ["C901", "E501", "E741", "F402", "F823", "E731"]
  select = ["C", "E", "F", "W"]
  
  [tool.ruff.lint.per-file-ignores]
  "__init__.py" = ["F401"]
  "tests/*" = ["E741"]
  
  [tool.ruff.lint.pylint]
  max-args = 10
  
  [tool.black]
  exclude = "3rdparty/*"
  line-length = 100
  skip-magic-trailing-comma = true
  
  [tool.isort]
  profile = "black"
  src_paths = ["python", "tests"]
  extend_skip = ["3rdparty"]
  line_length = 100
  skip_gitignore = true
  
  [tool.cibuildwheel]
  build-verbosity = 1
  # pypy doesn't play nice with pybind11 so skip pp* builds
  # pytorch stopped supporting Mac x64 back in 2.2 so there will be no Mac x64 wheels for python 3.13 so skip cp313-macosx_x86_64
  # python 3.13 support is still early and wheels are missing for Linux aarch64 for pytorch so temporarily skip cp313-manylinux_aarch64
  skip = [
    "cp36-*",
    "cp37-*",
    "cp38-*",
    "pp*",
    "*musllinux*",
    "cp313-manylinux_aarch64",
    "cp313-macosx_x86_64",
  ] # pypy doesn't play nice with pybind11
  build-frontend = "build[uv]"
  test-command = "pytest {project}/tests -m \"not hf_token_required\""
  test-extras = ["test"]
  
  [tool.cibuildwheel.linux]
  archs = ["x86_64", "aarch64"]
  
  [tool.cibuildwheel.macos]
  archs = ["x86_64", "arm64"]
  environment = { MACOSX_DEPLOYMENT_TARGET = "10.14" }
  
  [tool.cibuildwheel.windows]
  archs = ["AMD64"]
  