content: [build-system]
  requires = ["flit_core >=3.2,<4"]
  build-backend = "flit_core.buildapi"
  
  [project]
  name = "marray"
  authors = [{ name = "Matt Haberland", email = "mhaberla@calpoly.edu" }]
  readme = "README.md"
  license = { file = "LICENSE" }
  classifiers = [
    "License :: OSI Approved :: MIT License",
    "Programming Language :: Python :: 3.10",
    "Programming Language :: Python :: 3.11",
    "Programming Language :: Python :: 3.12",
    "Programming Language :: Python :: 3.13",
  ]
  dynamic = ["version", "description"]
  requires-python = ">=3.10"
  
  [project.optional-dependencies]
  test = [
    "numpy",
    "pytest",
    "pytest-cov",
    "array-api-strict",
    "array-api-compat",
    "pytorch",
  ]
  docs = ["jupyter-book", "ghp-import"]
  
  [project.urls]
  Home = "https://github.com/mdhaber/marray"
  
  [tool.ruff]
  target-version = "py310"
  builtins = ["ellipsis"]
  exclude = [".git", ".eggs", "build", "dist", "__pycache__"]
  line-length = 100
  
  [tool.ruff.lint]
  ignore = [
    "E402", # module level import not at top of file
    # "E501",  # line too long - let black worry about that
    "E731",  # do not assign a lambda expression, use a def
    "UP038", # type union instead of tuple for isinstance etc
  ]
  select = [
    "F",   # Pyflakes
    "E",   # Pycodestyle
    "I",   # isort
    "UP",  # Pyupgrade
    "TID", # flake8-tidy-imports
    "W",
  ]
  extend-safe-fixes = [
    "TID252", # absolute imports
  ]
  fixable = ["I", "TID252", "UP"]
  
  [tool.ruff.lint.isort]
  known-first-party = ["marray"]
  
  [tool.ruff.lint.flake8-tidy-imports]
  # Disallow all relative imports.
  ban-relative-imports = "all"
  
  [tool.coverage.run]
  source = ["marray"]
  branch = true
  
  [tool.coverage.report]
  show_missing = true
  exclude_lines = ["pragma: no cover", "if TYPE_CHECKING"]
  
  [tool.pytest.ini_options]
  filterwarnings = [
    "error",
    "ignore:invalid value encountered:RuntimeWarning",
    "ignore:divide by zero encountered:RuntimeWarning",
    "ignore:overflow encountered:RuntimeWarning",
  ]
  
  [tool.pixi.project]
  channels = ["conda-forge"]
  platforms = ["linux-64", "osx-arm64", "win-64"]
  
  [tool.pixi.dependencies]
  python = ">=3.10.16,<3.14"
  
  [tool.pixi.pypi-dependencies]
  marray = { path = ".", editable = true }
  
  [tool.pixi.feature.tests.dependencies]
  numpy = "*"
  pytest = "*"
  pytest-cov = "*"
  pytest-xdist = "*"
  array-api-strict = "*"
  array-api-compat = "*"
  pytorch = "*"
  
  [tool.pixi.feature.tests.tasks]
  tests = "pytest -v"
  tests-cov = "pytest -v -ra --cov=marray --cov-report=xml --cov-report=term --durations=20"
  coverage = { cmd = "coverage html", depends-on = ["tests-cov"] }
  open-coverage = { cmd = "open htmlcov/index.html", depends-on = ["coverage"] }
  
  [tool.pixi.feature.xp-tests.dependencies]
  pytest = "*"
  pytest-json-report = "*"
  hypothesis = "*"
  ndindex = "*"
  array-api-strict = "*"
  array-api-compat = "*"
  pytorch = "*"
  
  [tool.pixi.feature.xp-tests.tasks]
  # clean array-api-tests dir
  clean-xp-tests = { cwd = ".", cmd = "rm -rf array-api-tests" }
  # clone array-api-tests
  clone-xp-tests.cmd = "git clone https://github.com/data-apis/array-api-tests.git"
  clone-xp-tests.cwd = "."
  clone-xp-tests.depends-on = ["clean-xp-tests"]
  # checkout array-api-tests commit
  checkout-xp-tests.cmd = [
    "git",
    "reset",
    "--hard",
    "6acde7564f8b144a83b0368cfd75187ae5717fc8",
    "&&",
    "git",
    "submodule",
    "update",
    "--init",
  ]
  checkout-xp-tests.cwd = "array-api-tests"
  checkout-xp-tests.depends-on = ["clone-xp-tests"]
  # run tests
  xp-tests.cmd = [
    "pytest",
    "-v",
    "-rxXfE",
    "-W",
    # https://github.com/data-apis/array-api-tests/issues/284
    "ignore::UserWarning",
    # https://github.com/data-apis/array-api-tests/issues/329
    "--disable-extension",
    "fft",
    "--disable-extension",
    "linalg",
    "--xfails-file",
    "../tools/xp-tests-xfails.txt",
    "--max-examples=100",
    "--derandomize",
    "--disable-deadline",
    "array_api_tests/",
  ]
  xp-tests.env.ARRAY_API_TESTS_MODULE = "marray.array_api_strict"
  xp-tests.cwd = "array-api-tests"
  xp-tests.depends-on = ["checkout-xp-tests"]
  
  [tool.pixi.feature.lint.dependencies]
  pre-commit = "*"
  
  [tool.pixi.feature.lint.tasks]
  pre-commit-install = "pre-commit install"
  pre-commit = "pre-commit run --all-files"
  lint = { depends-on = ["pre-commit"] }
  
  [tool.pixi.feature.docs.dependencies]
  jupyter-book = "*"
  ghp-import = "*"
  numpy = "*"
  
  [tool.pixi.feature.docs.tasks]
  docs = { cmd = "jupyter-book build mybook/", cwd = "." }
  open-docs.cmd = "open mybook/_build/html/index.html"
  open-docs.cwd = "."
  open-docs.depends-on = ["docs"]
  
  [tool.pixi.feature.py310.dependencies]
  python = "~=3.10.0"
  
  [tool.pixi.feature.py313.dependencies]
  python = "~=3.13.0"
  
  [tool.pixi.feature.test-upstream-dev.dependencies]
  pytest = "*"
  pytest-reportlog = "*"
  
  [tool.pixi.feature.test-upstream-dev.pypi-dependencies]
  array-api-strict = "*"
  numpy = { version = "*", index = "https://pypi.anaconda.org/scientific-python-nightly-wheels/simple" }
  
  [tool.pixi.feature.test-upstream-dev.tasks]
  tests-log = "pytest --report-log output-log.jsonl"
  
  [tool.pixi.environments]
  default = { solve-group = "default" }
  dev.features = ["tests", "xp-tests", "lint", "docs"]
  dev.solve-group = "default"
  docs = { features = ["docs"], solve-group = "default" }
  ci-py310 = { features = ["py310", "tests", "xp-tests"] }
  ci-py313 = { features = ["py313", "tests", "xp-tests"] }
  ci-upstream-dev = { features = ["test-upstream-dev"] }
  pypi-test-extra = ["test"]
  