[build-system]
requires = ["setuptools>=61.0", "wheel"]
build-backend = "setuptools.build_meta"

[project]
name = "ray-ascend"
dynamic = ["version"]
description = "Community maintained hardware plugin for Ray on Ascend"
readme = "README.md"
requires-python = ">=3.10"
license = {text = "Apache 2.0"}
authors = [
    {name = "ray-ascend contributors"}
]
keywords = ["ray", "ascend", "distributed computing", "machine learning"]
classifiers = [
    "Development Status :: 3 - Alpha",
    "Intended Audience :: Developers",
    "Intended Audience :: Science/Research",
    "License :: OSI Approved :: Apache Software License",
    "Operating System :: OS Independent",
    "Programming Language :: Python :: 3",
    "Programming Language :: Python :: 3.10",
    "Programming Language :: Python :: 3.11",
    "Topic :: Scientific/Engineering :: Artificial Intelligence",
    "Topic :: System :: Distributed Computing",
]

[tool.setuptools.dynamic]
dependencies = {file = "requirements.txt"}
version = {attr = "ray_ascend.__version__"}

[project.optional-dependencies]
test = [
    "torch>=2.7.1; platform_machine == 'x86_64'",
    "torch>=2.7.1; platform_machine == 'aarch64'",
    "torch-npu>=2.7.1.post2",
    "pytest>=7.0.0",
    "pytest-cov",
]

yr = [
    "openyuanrong-datasystem>=0.8.0",
    "torch>=2.7.1; platform_machine == 'x86_64'",
    "torch>=2.7.1; platform_machine == 'aarch64'",
    "torch-npu>=2.7.1.post2",
    "requests",
]

[project.urls]
Homepage = "https://github.com/Ascend/ray-ascend"
Repository = "https://github.com/Ascend/ray-ascend"
Issues = "https://github.com/Ascend/ray-ascend/issues"

[tool.setuptools.packages.find]
where = ["."]
include = ["ray_ascend*"]

[tool.black]
line-length = 88
target-version = ['py310', 'py311']
include = '\.pyi?$'
extend-exclude = '''
/(
  # directories
  \.eggs
  | \.git
  | \.hg
  | \.mypy_cache
  | \.tox
  | \.venv
  | build
  | dist
)/
'''

[tool.isort]
profile = "black"
line_length = 88
multi_line_output = 3
include_trailing_comma = true
force_grid_wrap = 0
use_parentheses = true
ensure_newline_before_comments = true

[tool.mypy]
python_version = "3.10"
warn_return_any = true
warn_unused_configs = true
disallow_untyped_defs = false
ignore_missing_imports = true

[tool.pytest.ini_options]
testpaths = ["tests"]
python_files = ["test_*.py"]
python_classes = ["Test*"]
python_functions = ["test_*"]
addopts = [
    "--cov=ray_ascend",
    "--cov-report=term-missing",
    "--cov-report=html",
    "--cov-report=xml",
]

[tool.coverage.run]
source = ["ray_ascend"]
omit = [
    "*/tests/*",
    "*/__pycache__/*",
    "*/site-packages/*",
]

[tool.coverage.report]
exclude_lines = [
    "pragma: no cover",
    "def __repr__",
    "raise AssertionError",
    "raise NotImplementedError",
    "if __name__ == .__main__.:",
    "if TYPE_CHECKING:",
    "@abstractmethod",
]