[project]
name = "ml_dtypes"
dynamic = ["version"]  # Load from ml_dtypes.__version__.
description = "ml_dtypes is a stand-alone implementation of several NumPy dtype extensions used in machine learning."
readme = "README.md"
requires-python = ">=3.9"
license = "Apache-2.0"
license-files = ["LICENSE", "LICENSE.eigen"]
authors = [{name = "ml_dtypes authors", email="ml_dtypes@google.com"}]
classifiers = [
    "Programming Language :: Python :: 3",
    "Programming Language :: Python :: 3 :: Only",
    "Intended Audience :: Science/Research",
]
keywords = []

# pip dependencies of the project
dependencies = [
    # Ensure numpy release supports Python version.
    "numpy>=1.21",
    "numpy>=1.21.2; python_version>='3.10'",
    "numpy>=1.23.3; python_version>='3.11'",
    "numpy>=1.26.0; python_version>='3.12'",
    "numpy>=2.1.0; python_version>='3.13'",
]

[project.urls]
homepage = "https://github.com/jax-ml/ml_dtypes"
repository = "https://github.com/jax-ml/ml_dtypes"
# Other: `documentation`, `changelog`

[project.optional-dependencies]
# Development deps (unittest, linting, formating,...)
# Installed through `pip install .[dev]`
dev = [
    "absl-py",
    "pytest",
    "pytest-xdist",
    "pylint>=2.6.0",
    "pyink",
]

[tool.pyink]
# Formatting configuration to follow Google style-guide
line-length = 80
preview = true
pyink-indentation = 2
pyink-use-majority-quotes = true

[build-system]
requires = [
    # We build against the most recent supported NumPy 2.0 release;
    # see https://github.com/numpy/numpy/issues/27265
    "numpy~=2.0",
    "setuptools~=80.9.0",
]
build-backend = "setuptools.build_meta"

[tool.setuptools]
packages = ["ml_dtypes"]
include-package-data = false

[tool.setuptools.dynamic]
version = {attr = "ml_dtypes.__version__"}

[tool.setuptools.package-data]
ml_dtypes = ["py.typed"]
