-
Notifications
You must be signed in to change notification settings - Fork 87
Expand file tree
/
Copy pathpyproject.toml
More file actions
175 lines (152 loc) · 4.57 KB
/
pyproject.toml
File metadata and controls
175 lines (152 loc) · 4.57 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
[project]
name = "inference-perf"
version = "0.5.0"
description = "A GenAI inference performance benchmarking tool."
authors = []
dependencies = [
"aiohttp>=3.11.11",
"pydantic>=2.10.6",
"numpy>=2.2.2",
"datasets>=3.3.2",
"transformers==4.57.6",
"google-cloud-storage>=3.1.0",
"pyyaml>=6.0.2",
"boto3>=1.39.0",
"uvloop>=0.21.0",
"tqdm>=4.67.1",
"aiofiles>=25.1.0",
"tiktoken>=0.12.0",
"rich>=13.0.0",
]
requires-python = ">=3.12"
readme = "README.md"
license = {text = "Apache-2.0"}
[project.scripts]
inference-perf = "inference_perf:main_cli"
[project.optional-dependencies]
analysis = [
"matplotlib>=3.9.0",
]
dev = [
"mypy>=1.14.1",
"ruff>=0.9.4",
"pre-commit>=4.1.0",
"pytest>=8.3.4",
"ipykernel>=6.29.5",
"typing-extensions>=4.15.0",
"hypothesis>=6.146.0",
"pytest-asyncio>=1.3.0",
"pytest-picked",
]
otel = [
"opentelemetry-api>=1.30.0",
"opentelemetry-sdk>=1.30.0",
"opentelemetry-instrumentation>=0.51b0",
"opentelemetry-instrumentation-aiohttp-client>=0.51b0",
"opentelemetry-semantic-conventions-ai>=0.5.0",
"opentelemetry-exporter-otlp-proto-grpc>=1.30.0",
]
[dependency-groups]
lint = [
"mypy>=1.14.1",
"ruff>=0.9.4",
"pre-commit>=4.1.0",
]
test = [
"pytest>=8.3.4",
"pytest-asyncio>=1.2.0",
"ipykernel>=6.29.5",
"pytest-cov>=7.0.0",
]
types = [
"types-PyYAML>=6.0.12.20241230",
"types-requests>=2.32.0.20250328",
"types-tqdm>=4.67.0.20250809",
"types-jmespath>=1.0.2.20250809",
]
[build-system]
requires = ["setuptools>=61"]
build-backend = "setuptools.build_meta"
[tool.pdm]
distribution = true
[tool.pdm.scripts]
format = "ruff format"
lint = "ruff check"
type-check = "mypy --strict ./inference_perf ./tests"
"check:cli-flags" = "python scripts/sync_cli_flags_doc.py --check"
"update:cli-flags" = "python scripts/sync_cli_flags_doc.py"
check = {composite = ["format", "lint"]}
validate = {composite = ["format", "lint", "type-check", "check:cli-flags"]}
setup = {shell = "pdm install && pre-commit install --config .pre-push-config.yaml && pre-commit install --config .pre-push-config.yaml --hook-type pre-push"}
"test" = "pytest tests"
"test:picked" = "pytest --picked"
"test:e2e" = "pytest e2e"
"test:e2e:docker" = "pdm run docker:e2e-test:run"
"check:cov" = "python scripts/check_coverage_regression.py"
"docker:e2e-test:build".cmd = "docker buildx b -f Dockerfile.e2e-test {args:-t inference-perf-e2e-test} ."
"docker:e2e-test:run".shell = "rm result && pdm run docker:e2e-test:build --iidfile result && docker run --rm -it $(< result)"
[tool.ruff]
# The GitHub editor is 127 chars wide
line-length = 127
indent-width = 4
[tool.ruff.lint]
# Enable Pyflakes (`F`) and a subset of the pycodestyle (`E`) codes by default.
# On top of the defaults (`E4`, E7`, `E9`, and `F`), enable flake8-bugbear (`B`)
# Unlike Flake8, Ruff doesn't enable pycodestyle warnings (`W`) or
# McCabe complexity (`C901`) by default.
select = ["E4", "E7", "E9", "F", "B"]
ignore = []
# Allow fix for all enabled rules (when `--fix`) is provided.
fixable = ["ALL"]
unfixable = []
[tool.ruff.format]
# Like Black, use double quotes for strings.
quote-style = "double"
# Like Black, indent with spaces, rather than tabs.
indent-style = "space"
# Like Black, respect magic trailing commas.
skip-magic-trailing-comma = false
# Like Black, automatically detect the appropriate line ending.
line-ending = "auto"
# Enable auto-formatting of code examples in docstrings. Markdown,
# reStructuredText code/literal blocks and doctests are all supported.
#
# This is currently disabled by default, but it is planned for this
# to be opt-out in the future.
docstring-code-format = false
# Set the line length limit used when formatting code snippets in
# docstrings.
#
# This only has an effect when the `docstring-code-format` setting is
# enabled.
docstring-code-line-length = "dynamic"
[tool.pytest.ini_options]
asyncio_mode = "auto"
asyncio_default_fixture_loop_scope = "session"
log_cli = true
log_cli_level = "INFO"
testpaths = ["."]
python_files = ["test_*.py"]
python_classes = ["Test*"]
python_functions = ["test_*"]
[tool.setuptools.packages.find]
where = ["."]
include = ["inference_perf*", "deploy*"]
[tool.mypy]
plugins = ["pydantic.mypy"]
[[tool.mypy.overrides]]
module = [
"datasets.*",
"matplotlib.*",
"boto3.*",
"botocore.*",
"opentelemetry.*",
"google.cloud.*",
]
ignore_missing_imports = true
[tool.coverage.run]
source = ["inference_perf"]
omit = ["tests/*", "**/__init__.py", "scripts/*", "scripts/**/*"]
[tool.coverage.report]
show_missing = true
skip_covered = true