# ----------------------------------------------------------------------------
# Copyright (c) Huawei Technologies Co., Ltd. 2025-2026. All rights reserved.
#
# Licensed 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 = ["setuptools", "wheel"]
build-backend = "setuptools.build_meta"

[tool.pytest.ini_options]
testpaths = ["tests/unit_test", "tests/amct_pytorch"]
markers = [
    "cpu: tests that run on CPU only and are fast (default)",
    "npu: tests that require an Ascend NPU",
    "slow: tests that take more than a few seconds",
]
addopts = "-ra"
env = [
    "TORCH_DEVICE_BACKEND_AUTOLOAD=0",
]

[tool.coverage.run]
source = ["amct_pytorch"]
omit = [
    "*/experimental/*",
]

[tool.coverage.report]
show_missing = true
skip_covered = false
exclude_lines = [
    "pragma: no cover",
    "raise NotImplementedError",
    "if __name__ == .__main__.:",
]

[tool.ruff.format]
quote-style = "preserve"

[tool.codespell]
# CANN/cann: Huawei product name / org in URLs; nd: tensor dim count variable;
# CopyIn/vor: AscendC intrinsic names.
ignore-words-list = "cann,nd,copyin,vor"