pyproject.toml 4.53 KB
Newer Older
Neelay Shah's avatar
Neelay Shah committed
1
# SPDX-FileCopyrightText: Copyright (c) 2024-2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
2
3
4
5
6
7
8
9
10
11
12
13
14
15
# SPDX-License-Identifier: Apache-2.0
#
# 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.

Neelay Shah's avatar
Neelay Shah committed
16
[project]
Neelay Shah's avatar
Neelay Shah committed
17
name = "dynamo"
Neelay Shah's avatar
Neelay Shah committed
18
19
20
21
version = "0.2.1"
description = "Distributed Inference Framework"
readme = "README.md"
authors = [
Neelay Shah's avatar
Neelay Shah committed
22
    { name = "NVIDIA Inc.", email = "sw-dl-dynamo@nvidia.com" },
Neelay Shah's avatar
Neelay Shah committed
23
24
25
26
27
]
license = { file = "LICENSE" }
requires-python = ">=3.10"
dependencies = [
    "pytest>=8.3.4",
28
29
    "pydantic>=2.10.6",
    "uvloop>=0.21.0",
30
    "nats-py>=2.6.0",
Neelay Shah's avatar
Neelay Shah committed
31
32
]

33
[tool.maturin]
Neelay Shah's avatar
Neelay Shah committed
34
module-name = "dynamo._core"
35
36
37
# Point to the Rust crate directory
manifest-path = "lib/bindings/python/Cargo.toml"
# Include all Python packages
Neelay Shah's avatar
Neelay Shah committed
38
python-packages = ["dynamo"]
39
40
41
42
43
44
45
46
47
48
# Specify the Python source directory
python-source = "lib/bindings/python/src"

[tool.uv]
config-settings = { build-args = '--auditwheel repair --manylinux' }

[build-system]
requires = ["maturin>=1.0,<2.0", "patchelf"]
build-backend = "maturin"

49
50
51
52
53
[tool.codespell]
# note: pre-commit passes explicit lists of files here, which this skip file list doesn't override -
# this is only to allow you to run codespell interactively
# this also overrides the grpc_generated folder, since it is generated

54
55
# Ignore data files and auto-generated files
skip = "./.git,./.github,./lib/llm/tests/data,*.lock,*.sum"
56

57
58
# ignore allowed words used in code
ignore-words-list = "afterall,ser,ende"
59
60
# use the 'clear' dictionary for unambiguous spelling mistakes
builtin = "clear"
61
62
# use custom dictionary in addition to the built-in one
dictionary = "./codespell.txt"
63
64
65
66
67
68
69
70
71
72
73
74
75
76
# disable warnings about binary files and wrong encoding
quiet-level = 3

[tool.isort]
profile = "black"
use_parentheses = true
multi_line_output = 3
include_trailing_comma = true
force_grid_wrap = 0
ensure_newline_before_comments = true
line_length = 88
balanced_wrapping = true
indent = "    "
skip = ["build"]
Neelay Shah's avatar
Neelay Shah committed
77
known_first_party = ["dynamo"]
78
79
80

[tool.pytest.ini_options]
minversion = "8.0"
81
tmp_path_retention_policy = "failed"
Neelay Shah's avatar
Neelay Shah committed
82
83
84
85

# NOTE
# We ignore model.py explcitly here to avoid mypy errors with duplicate modules
# pytest overrides the default mypy exclude configuration and so we exclude here as well
86
87
88
89
90
91
92
93
94
addopts = [
    "-ra",
    "--showlocals",
    "--strict-markers",
    "--strict-config",
    "--mypy",
    "--ignore-glob=*model.py",
    # FIXME: Get relative/generic blob paths to work here
]
95
96
97
98
xfail_strict = true
log_cli_level = "INFO"
filterwarnings = [
  "error",
99
  "ignore:.*cuda*:DeprecationWarning", # Need this to avoid deprecation warnings from CUDA in tensorrt_llm.
100
101
  "ignore:.*pkg_resources.*:DeprecationWarning",
  "ignore:.*multipart.*:PendingDeprecationWarning"
102
]
103
104


105
106
# NOTE: Can also manually mark tests with @pytest.mark.asyncio
asyncio_mode = "auto"
Neelay Shah's avatar
Neelay Shah committed
107
markers = [
108
109
  "pre_merge: marks tests to run before merging",
  "nightly: marks tests to run nightly",
110
111
  "weekly: marks tests to run weekly",
  "gpu: marks tests to run on GPU"
Neelay Shah's avatar
Neelay Shah committed
112
]
113
114
115
116
117
118
119

# Linting/formatting
[tool.ruff]
# Same as Black.
line-length = 88
indent-width = 4

Blazej's avatar
Blazej committed
120
121
122
[tool.ruff.lint.extend-per-file-ignores]
"icp/tests/**/test_*.py" = ["F811", "F401"]

123
[tool.mypy]
Neelay Shah's avatar
Neelay Shah committed
124

125
126
# --disable-error-code: WAR large set of errors due to mypy not being run
#   previously. We can slowly enable sets of errors to fix over time.
Neelay Shah's avatar
Neelay Shah committed
127
128
# disable_error_code = []

129
# --explicit-package-bases: WAR errors about duplicate module names used
130
131
132
#   throughout the llm examples. For example, the common module in
#   tensorrt_llm and vllm are both named common.
explicit_package_bases = true
Neelay Shah's avatar
Neelay Shah committed
133

134
135
136
137
# --ignore-missing-imports: WAR too many errors when developing outside
#   of container environment with PYTHONPATH set and packages installed.
#   NOTE: Can possibly move mypy from pre-commit to a github action run only in
#   a container with the expected environment and PYTHONPATH setup.
Neelay Shah's avatar
Neelay Shah committed
138
139
ignore_missing_imports = true

140
141
142
143
check_untyped_defs = true

[[tool.mypy.overrides]]
# Skip mypy analysis on internal dependencies of vllm
144
module = ["vllm.*", "bentoml.*", "fs.*", "_bentoml_sdk.*"]
145
follow_imports = "skip"
146
147
148
149
ignore_missing_imports = true

# declare namespace packages
[tool.setuptools]
Neelay Shah's avatar
Neelay Shah committed
150
namespace-packages = ["dynamo", "dynamo.sdk"]