# SPDX-FileCopyrightText: Copyright (c) 2022 NVIDIA CORPORATION & AFFILIATES. All rights reserved. # SPDX-License-Identifier: Apache-2.0 [build-system] requires = ["setuptools>=75.3.2", "build", "wheel"] build-backend = "setuptools.build_meta" [project] name = "warp-lang" requires-python = ">=3.11" authors = [{ name = "NVIDIA Corporation", email = "warp-python@nvidia.com" }] description = "A Python framework for high-performance simulation and graphics programming" license = { text = "Apache-2.0" } classifiers = [ "Development Status :: 5 - Production/Stable", "Intended Audience :: Developers", "Intended Audience :: Science/Research", "Natural Language :: English", "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 :: 3 :: Only", "Environment :: GPU :: NVIDIA CUDA", "Environment :: GPU :: NVIDIA CUDA :: 13", "Operating System :: OS Independent", "Topic :: Scientific/Engineering", ] dependencies = ["numpy"] dynamic = ["version", "readme"] [project.urls] Homepage = "https://developer.nvidia.com/warp-python" Documentation = "https://nvidia.github.io/warp/stable/" Repository = "https://github.com/NVIDIA/warp" Issues = "https://github.com/NVIDIA/warp/issues" Changelog = "https://github.com/NVIDIA/warp/blob/main/CHANGELOG.md" [project.optional-dependencies] docs = [ "nvidia-sphinx-theme", "sphinx-copybutton", "pre-commit", "myst_parser", ] benchmark = [ "usd-core>=25.5 ; (sys_platform != 'linux' or platform_machine != 'aarch64') and (sys_platform != 'win32' or (platform_machine != 'ARM64' and platform_machine != 'arm64' and platform_machine != 'aarch64'))", "usd-exchange>=2.2 ; python_version < '3.13' and sys_platform == 'linux' and platform_machine == 'aarch64'", ] examples = [ "blosc>=1.11.1 ; sys_platform != 'win32' or (platform_machine != 'ARM64' and platform_machine != 'arm64' and platform_machine != 'aarch64')", "matplotlib>=3.7.5", "nlopt ; python_version < '3.15' and (sys_platform != 'win32' or (platform_machine != 'ARM64' and platform_machine != 'arm64' and platform_machine != 'aarch64'))", "pillow>=10.4.0", "psutil>=7.1.0", "pyglet>=2.1.9", "usd-core>=25.5 ; (sys_platform != 'linux' or platform_machine != 'aarch64') and (sys_platform != 'win32' or (platform_machine != 'ARM64' and platform_machine != 'arm64' and platform_machine != 'aarch64'))", "usd-exchange>=2.2 ; python_version < '3.13' and sys_platform == 'linux' and platform_machine == 'aarch64'", ] torch-cu12 = [ "warp-lang[examples]", "torch>=2.7.0", ] torch-cu13 = [ "warp-lang[examples]", "torch>=2.9.0", ] dev = [ "warp-lang[examples]", "warp-lang[docs]", "nvtx>=0.2.16", "coverage", "ml-dtypes>=0.5.4", ] [tool.setuptools.packages.find] include = ["warp*"] exclude = ["warp.examples.cpp*"] [tool.setuptools.dynamic] version = { file = ["VERSION.md"] } readme = { file = ["README.md"], content-type = "text/markdown" } [tool.ruff] cache-dir = ".cache/ruff" line-length = 120 indent-width = 4 extend-exclude = [ # Skill eval fixtures stand in for third-party codebases under assessment. # Their shape is what the evals grade, so they are neither linted nor # formatted. "skills/*/evals/files", "warp/_src/thirdparty/appdirs.py", "warp/_src/thirdparty/dlpack.py", "tools/build", "tools/ci/deploy_doc.py", "tools/ci/publishing", "tools/cmake", "tools/packman", "tools/pre-commit-hooks", "tools/repoman", ] [tool.ruff.lint] select = [ "E", # pycodestyle errors "I", # isort "F", # pyflakes "W", # pycodestyle warnings "B", # flake8-bugbear "S101", # flake8-bandit: assert "C4", # flake8-comprehensions "NPY", # NumPy-specific rules "PLC", # pylint convention "PLE", # pylint error "PLW", # pylint warning "UP", # pyupgrade "RUF", "D200", # One-line docstrings should fit on one line "D205", # Separate summaries from descriptions with a blank line "D400", # End summary lines with a period "D401", # Write summary lines in the imperative mood "D403", # Capitalize the first word of each docstring ] ignore = [ "E501", # Many lines are over 120 characters already "E741", # Warp often uses l as a variable name "F403", # Allow wildcard imports "F405", # Related to use of wildcard imports "F811", # Warp often uses overloads "E721", # Warp often uses == in float and int type comparisons "PLW0603", # Allow assignments to global variables "UP018", # Warp kernels often use float(val) and int(val) "RUF046", # Warp kernels often use int(val) "PLW1641", # TODO: Make sure classes implementing __eq__ also implement a __hash__ method ] [tool.ruff.lint.per-file-ignores] # Enforce the selected pydocstyle rules only in the Warp test suite for now. "!warp/tests/**.py" = ["D200", "D205", "D400", "D401", "D403"] "__init__.py" = ["F401", "PLC0414"] "__init__.pyi" = ["B008", "E402", "I001"] # `warp/__init__.py` registers all Warp module source declarations before # importing implementation symbols, so the statement-before-import ordering is # intentional. "warp/__init__.py" = ["E402"] "warp/*.py" = ["PLC0414"] "warp/tests/*.py" = ["F841"] "warp/tests/**/*.py" = ["S101"] # Skill evaluation fixtures intentionally contain the defects agents must # find (e.g. a computed-but-never-consumed adjoint), so unused-variable # lints are expected there. "skills/warp-debug-gradients/evals/files/**/*.py" = ["F841", "RUF059"] "asv/benchmarks/**.py" = ["RUF012"] [tool.ruff.lint.pydocstyle] convention = "google" [tool.ruff.format] # These skill trees contain signed artifacts and must remain byte-for-byte # aligned with the skill-signing pipeline until formatting is coordinated there. exclude = [ "skills/warp-compile-time-optimizer/**", "skills/warp-debug-gradients/**", "warp/__init__.pyi", ] quote-style = "double" indent-style = "space" skip-magic-trailing-comma = false line-ending = "auto" docstring-code-format = true [tool.coverage.run] # Use sys.monitoring on Python 3.12+ to reduce tracing overhead; Coverage.py falls back on older versions. core = "sysmon" source = ["warp", "warp.render"] disable_warnings = [ "module-not-measured", "module-not-imported", "no-data-collected", "couldnt-parse", ] [tool.coverage.report] exclude_lines = [ "pragma: no cover", "@wp", "@warp", "if 0:", "if __name__ == .__main__.:", ] omit = [ "*/warp/_src/thirdparty/*", "*/warp/examples/*", "*/warp/tests/*", "*/warp/_src/fem/*", "appdirs.py", "render_opengl.py", "build_dll.py", "config.py", "__init__.pyi", ] [tool.uv] managed = true required-environments = [ "sys_platform == 'win32' and platform_machine == 'AMD64'", ] conflicts = [ [ { extra = "torch-cu12" }, { extra = "torch-cu13" }, ], ] [tool.uv.sources] torch = [ { index = "pytorch-cu126", extra = "torch-cu12" }, { index = "pytorch-cu130", extra = "torch-cu13" }, ] [[tool.uv.index]] name = "pytorch-cu126" url = "https://download.pytorch.org/whl/cu126" explicit = true [[tool.uv.index]] name = "pytorch-cu130" url = "https://download.pytorch.org/whl/cu130" explicit = true [tool.towncrier] directory = "changelog" filename = "CHANGELOG.md" start_string = "\n" title_format = "## [{version}] - {project_date}" issue_format = "[GH-{issue}](https://github.com/NVIDIA/warp/issues/{issue})" issue_pattern = "\\d+" wrap = false ignore = [] [[tool.towncrier.type]] directory = "added" name = "Added" showcontent = true [[tool.towncrier.type]] directory = "removed" name = "Removed" showcontent = true [[tool.towncrier.type]] directory = "deprecated" name = "Deprecated" showcontent = true [[tool.towncrier.type]] directory = "changed" name = "Changed" showcontent = true [[tool.towncrier.type]] directory = "fixed" name = "Fixed" showcontent = true [[tool.towncrier.type]] directory = "documentation" name = "Documentation" showcontent = true [tool.typos] # Skill eval fixtures stand in for third-party codebases under assessment, so # their prose and identifiers are deliberately not held to Warp's conventions. files.extend-exclude = ["/tools/packman", "/tools/repoman", "/PUBLICATIONS.md", "/licenses", "/warp/native/nanovdb", "/warp/native/cuBQL", "*.svg", "*.usda", "/skills/*/evals/files"] [tool.typos.default] extend-ignore-re = [ # MSVC compiler flags like /Fo, /Fe, /Fd, etc. "/F[oedpircaOAu]", # Short-SHA commit links in design/deprecations.md, e.g. [ba7a865](https://github.com/NVIDIA/warp/commit/) "\\[[0-9a-f]{7,40}\\]\\(https://github\\.com/NVIDIA/warp/commit/[0-9a-f]{7,40}\\)", ] [tool.typos.default.extend-words] arange = "arange" commun = "commun" dout = "dout" iy = "iy" iz = "iz" lod = "lod" nd = "nd" setp = "setp" transformd = "transformd" [tool.typos.default.extend-identifiers] CU_DEVICE_ATTRIBUTE_MAX_SHARED_MEMORY_PER_BLOCK_OPTIN = "CU_DEVICE_ATTRIBUTE_MAX_SHARED_MEMORY_PER_BLOCK_OPTIN" ba = "ba" [tool.pyright] extraPaths = ["."] [[tool.pyright.executionEnvironments]] root = "warp/__init__.pyi" reportInvalidTypeVarUse = false