# Copyright (c) 2025 Huawei Technologies Co., Ltd.
# This program is free software, you can redistribute it and/or modify it under the terms and conditions of
# CANN Open Software License Agreement Version 2.0 (the "License").
# Please refer to the License for details. You may not use this file except in compliance with the License.
# THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED,
# INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY, OR FITNESS FOR A PARTICULAR PURPOSE.
# See LICENSE in the root of the software repository for the full text of the License.
# -----------------------------------------------------------------------------------------------------------

[build-system]
requires = [
    "setuptools>=77.0.3",
    "pybind11>=3.0.1",
]
build-backend = "setuptools.build_meta"

[project]
name = "pypto"
version = "0.2.1"
authors = [
    { name = "PyPTO Team", email = "pto@cann.osinfra.cn" }
]
description = "A high-performance programming framework for tile-centric computing"
readme = { file = "README.md", content-type = "text/markdown" }
license = "LicenseRef-CANN-Open-Software-License-Agreement-Version-2.0"
license-files = ["LICENSE"]
requires-python = ">=3.9"
dependencies = [
]
keywords = ["python", "pto", "tile", "tile-centric"]
classifiers = [  # 分类器,PyPI 用于分类筛选(必填多个合理分类)
    "Development Status :: 4 - Beta",
    "Intended Audience :: Developers",
    "Topic :: Software Development :: Compilers",
    "Programming Language :: Python :: 3",
    "Programming Language :: Python :: 3.9",
    "Programming Language :: Python :: 3.10",
    "Programming Language :: Python :: 3.11",
    "Programming Language :: Python :: 3.12",
]

[project.urls]
Homepage = "https://gitcode.com/cann/pypto"
Repository = "https://gitcode.com/cann/pypto"
"Bug Tracker" = "https://gitcode.com/cann/pypto/issues"


[project.optional-dependencies]
dev = [
    "setuptools>=77.0.3",
    "pybind11>=3.0.1",
    "pip",
    "build",
    "packaging",
    "pytest",
    "pytest-forked",
    "pytest-xdist",
]
tests = [
    "pytest",
    "pytest-forked",
    "pytest-xdist",
]

[tool.setuptools]
# 根包在 python 路径下
package-dir = {"" = "python"}

# 指明所有被检测的目录
packages.find.where = ["python", ]
packages.find.include = [
    "pypto",
    "pypto.op",
    "pypto.include.tilefwk",
    "pypto.lib",
    "pypto.lib.configs",
    "pypto.lib.include.mock",
    "pypto.lib.include.tilefwk",
    "pypto.lib.include.tileop",
    "pypto.lib.include.tileop.arch32",
    "pypto.lib.include.tileop.arch32.dynamic",
    "pypto.lib.include.tileop.cube",
    "pypto.lib.include.tileop.vector",
    "pypto.lib.include.tileop.utils",
    "pypto.lib.cmake.PTO_Framework",
]

# 保留 package-data,确保目录下的 .so/.h 等文件被包含
include-package-data = true
package-data = { "pypto" = ["lib/**/*", "include/**/*"] }
zip-safe = false