# SPDX-FileCopyrightText: Copyright (c) 2024-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. # # SPDX-License-Identifier: Apache-2.0 [build-system] # Keep the external tools in sync with dependency-groups.build. requires = [ "setuptools>=80", "setuptools-scm[simple]>=8,!=10.1", "Cython>=3.2.5,<3.3", "cuda-pathfinder>=1.5", ] build-backend = "build_hooks" backend-path = ["."] [project] name = "cuda-core" dynamic = [ "version", "readme", ] requires-python = '>=3.11' description = "cuda.core: pythonic CUDA module" authors = [ { name = "NVIDIA Corporation" } ] license = "Apache-2.0" classifiers = [ "Development Status :: 5 - Production/Stable", "Intended Audience :: Developers", "Intended Audience :: Science/Research", "Intended Audience :: End Users/Desktop", "Natural Language :: English", "Operating System :: POSIX :: Linux", "Operating System :: Microsoft :: Windows", "Topic :: Education", "Topic :: Scientific/Engineering", "Topic :: Software Development :: Libraries", "Programming Language :: Python :: 3 :: Only", "Programming Language :: Python :: 3.11", "Programming Language :: Python :: 3.12", "Programming Language :: Python :: 3.13", "Programming Language :: Python :: 3.14", "Programming Language :: Python :: 3.15", "Programming Language :: Python :: Implementation :: CPython", "Environment :: GPU :: NVIDIA CUDA", "Environment :: GPU :: NVIDIA CUDA :: 12", "Environment :: GPU :: NVIDIA CUDA :: 13", ] dependencies = [ "cuda-pathfinder >=1.4.2", "numpy", ] # The cuda-bindings pins below are the cuda-bindings *floors* of this release, one # per CUDA major. This is the only place that declares them. build_hooks.py, the # import-time check, the docs and CI read them from here (see # cuda/core/_bindings_floor.py and the "Bumping the cuda-bindings floor" # checklist in AGENTS.md). Keep the form `>=,<`. [project.optional-dependencies] cu12 = ["cuda-bindings[all]>=12.9.8,<13", "cuda-toolkit==12.*"] cu13 = ["cuda-bindings[all]>=13.4.1,<14", "cuda-toolkit==13.*"] [dependency-groups] # Keep build in sync with build-system.requires; install local cuda-pathfinder separately. build = [ "setuptools>=80", "setuptools-scm[simple]>=8,!=10.1", "Cython>=3.2.5,<3.3", ] test = [ "cython>=3.2.5,<3.3", "setuptools>=80", "pytest==9.1.0", "pytest-benchmark==5.2.3", "pytest-randomly==4.1.0", "pytest-repeat==0.9.4", "pytest-rerunfailures==16.3", "pytest-timeout==2.4.0", # CI: one GitHub annotation per failed test; inert outside GitHub Actions. "pytest-github-actions-annotate-failures==0.4.2", "cloudpickle==3.1.2", # psutil has no cp315t wheel yet, so 3.15t builds it from source. Windows CI # has no compiler, so skip it there. Tests skip when psutil is missing. "psutil==7.2.2; sys_platform != 'win32' or python_version < '3.15'", "packaging>=24", "docutils==0.23", # Required by tests/test_graphics.py; pinned to match cuda-bindings. "pyglet==2.1.14", "cffi==2.1.1", ] ml-dtypes = ["ml-dtypes>=0.5.4"] test-ft = ["pytest-run-parallel==0.10.0"] test-cu12 = [ {include-group = "ml-dtypes" }, {include-group = "test" }, "cupy-cuda12x; python_version < '3.15'", "cuda-toolkit[cudart]==12.*"] # runtime headers needed by CuPy test-cu13 = [ {include-group = "ml-dtypes" }, {include-group = "test" }, "cupy-cuda13x; python_version < '3.15'", "cuda-toolkit[cudart]==13.*"] # runtime headers needed by CuPy [tool.uv] conflicts = [ [ { extra = "cu12" }, { extra = "cu13" }, ], [ { group = "test-cu12" }, { group = "test-cu13" }, ], ] [project.urls] homepage = "https://nvidia.github.io/cuda-python/" documentation = "https://nvidia.github.io/cuda-python/cuda-core/" repository = "https://github.com/NVIDIA/cuda-python" issues = "https://github.com/NVIDIA/cuda-python/issues/" [tool.setuptools.packages.find] include = ["cuda.core*"] [tool.setuptools] include-package-data = false [tool.setuptools.package-data] "*" = ["*.pxd", "*.pyi", "py.typed"] "cuda.core._include" = ["*.h", "*.hpp"] "cuda.core._cpp" = ["**/*.h", "**/*.hpp"] [tool.setuptools.dynamic] readme = { file = ["DESCRIPTION.rst"], content-type = "text/x-rst" } [tool.setuptools_scm] root = ".." version_file = "cuda/core/_version.py" git_describe_command = ["git", "describe", "--dirty", "--tags", "--long", "--match", "cuda-core-v*[0-9]*"] [tool.mypy] # Try to keep the mypy configuration similar between the subprojects # Basic settings python_version = "3.11" namespace_packages = true mypy_path = "cuda_core" explicit_package_bases = true warn_return_any = true warn_unused_configs = true # Start strict, but allow some flexibility check_untyped_defs = true disallow_any_generics = true no_implicit_optional = true warn_redundant_casts = true warn_unused_ignores = true # Allow some common patterns to keep it simple allow_redefinition = true implicit_reexport = true # Ignore missing imports for now (you can tighten this later) ignore_missing_imports = true [tool.cibuildwheel] skip = "*-musllinux_*" build-verbosity = 1 [tool.cibuildwheel.linux] archs = "native" [tool.cibuildwheel.windows] repair-wheel-command = "delvewheel repair --namespace-pkg cuda --exclude \"torch_cpu.dll;torch_python.dll\" -w {dest_dir} {wheel}"