-
Notifications
You must be signed in to change notification settings - Fork 12
/
pyproject.toml
212 lines (177 loc) · 7.42 KB
/
pyproject.toml
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
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
[build-system]
requires = ["setuptools >= 61.0", "wheel", "build"]
build-backend = "setuptools.build_meta"
[tool.setuptools.packages.find]
where = ["src"]
include = ["*"]
[tool.setuptools.package-data]
guidellm = ["*"]
# ************************************************
# ********** Project Metadata **********
# ************************************************
[project]
name = "guidellm"
version = "0.1.0"
description = "Guidance platform for deploying and managing large language models."
readme = { file = "README.md", content-type = "text/markdown" }
requires-python = ">=3.8.0,<4.0"
license = { file = "LICENSE" }
authors = [ { name = "Neuralmagic, Inc." } ]
urls = { homepage = "https://github.com/neuralmagic/guidellm" }
dependencies = [
"click",
"datasets",
"ftfy>=6.0.0",
"loguru",
"numpy",
"openai",
"pydantic>=2.0.0",
"pydantic-settings>=2.0.0",
"pyyaml>=6.0.0",
"requests",
"rich",
"transformers",
]
[project.optional-dependencies]
dev = [
# general and configurations
"pre-commit~=3.5.0",
"scipy~=1.10",
"sphinx~=7.1.2",
"tox~=4.16.0",
# testing
"pytest~=8.2.2",
"pytest-asyncio~=0.23.8",
"pytest-cov~=5.0.0",
"pytest-mock~=3.14.0",
"pytest-rerunfailures~=14.0",
"requests-mock~=1.12.1",
# code quality
"mypy~=1.10.1",
"ruff~=0.5.2",
# docs quality
"mdformat~=0.7.17",
"mdformat-footnote~=0.1.1",
"mdformat-frontmatter~=2.0.8",
"mdformat-gfm~=0.3.6",
# type-checking
"types-click~=7.1.8",
"types-PyYAML~=6.0.1",
"types-requests~=2.32.0",
"types-toml",
]
[project.entry-points.console_scripts]
guidellm = "guidellm.main:generate_benchmark_report_cli"
guidellm-config = "guidellm.config:print_config"
# ************************************************
# ********** Code Quality Tools **********
# ************************************************
[tool.black]
line-length = 88
target-version = ['py38']
[tool.isort]
profile = "black"
[tool.mypy]
files = ["src/guidellm", "tests"]
python_version = '3.8'
warn_redundant_casts = true
warn_unused_ignores = false
show_error_codes = true
namespace_packages = true
exclude = ["venv", ".tox"]
# Silence "type import errors" as our 3rd-party libs does not have types
# Check: https://mypy.readthedocs.io/en/latest/config_file.html#import-discovery
follow_imports = 'silent'
[[tool.mypy.overrides]]
module = ["datasets.*"]
ignore_missing_imports=true
[tool.ruff]
line-length = 88
indent-width = 4
exclude = ["build", "dist", "env", ".venv"]
[tool.ruff.format]
quote-style = "double"
indent-style = "space"
[tool.ruff.lint]
ignore = [
"PLR0913",
"TCH001",
"COM812",
"ISC001",
"TCH002",
"PLW1514", # allow Path.open without encoding
"RET505", # allow `else` blocks
"RET506" # allow `else` blocks
]
select = [
# Rules reference: https://docs.astral.sh/ruff/rules/
# Code Style / Formatting
"E", # pycodestyle: checks adherence to PEP 8 conventions including spacing, indentation, and line length
"W", # pycodestyle: checks adherence to PEP 8 conventions including spacing, indentation, and line length
"A", # flake8-builtins: prevents shadowing of Python built-in names
"C", # Convention: ensures code adheres to specific style and formatting conventions
"COM", # flake8-commas: enforces the correct use of trailing commas
"ERA", # eradicate: detects commented-out code that should be removed
"I", # isort: ensures imports are sorted in a consistent manner
"ICN", # flake8-import-conventions: enforces import conventions for better readability
"N", # pep8-naming: enforces PEP 8 naming conventions for classes, functions, and variables
"NPY", # NumPy: enforces best practices for using the NumPy library
"PD", # pandas-vet: enforces best practices for using the pandas library
"PT", # flake8-pytest-style: enforces best practices and style conventions for pytest tests
"PTH", # flake8-use-pathlib: encourages the use of pathlib over os.path for file system operations
"Q", # flake8-quotes: enforces consistent use of single or double quotes
"TCH", # flake8-type-checking: enforces type checking practices and standards
"TID", # flake8-tidy-imports: enforces tidy and well-organized imports
"RUF022", # flake8-ruff: enforce sorting of __all__ in modules
# Code Structure / Complexity
"C4", # flake8-comprehensions: improves readability and performance of list, set, and dict comprehensions
"C90", # mccabe: checks for overly complex code using cyclomatic complexity
"ISC", # flake8-implicit-str-concat: prevents implicit string concatenation
"PIE", # flake8-pie: identifies and corrects common code inefficiencies and mistakes
"R", # Refactor: suggests improvements to code structure and readability
"SIM", # flake8-simplify: simplifies complex expressions and improves code readability
# Code Security / Bug Prevention
"ARG", # flake8-unused-arguments: detects unused function and method arguments
"ASYNC", # flake8-async: identifies incorrect or inefficient usage patterns in asynchronous code
"B", # flake8-bugbear: detects common programming mistakes and potential bugs
"BLE", # flake8-blind-except: prevents blind exceptions that catch all exceptions without handling
"E", # Error: detects and reports errors in the code
"F", # Pyflakes: detects unused imports, shadowed imports, undefined variables, and various formatting errors in string operations
"INP", # flake8-no-pep420: prevents implicit namespace packages by requiring __init__.py
"PGH", # pygrep-hooks: detects deprecated and dangerous code patterns
"PL", # Pylint: comprehensive source code analyzer for enforcing coding standards and detecting errors
"RSE", # flake8-raise: ensures exceptions are raised correctly
"S", # flake8-bandit: detects security issues and vulnerabilities in the code
"SLF", # flake8-self: prevents incorrect usage of the self argument in class methods
"T10", # flake8-debugger: detects the presence of debugging tools such as pdb
"T20", # flake8-print: detects print statements left in the code
"UP", # pyupgrade: automatically upgrades syntax for newer versions of Python
"W", # Warning: provides warnings about potential issues in the code
"YTT", # flake8-2020: identifies code that will break with future Python releases
# Code Documentation
"FIX", # flake8-fixme: detects FIXMEs and other temporary comments that should be resolved
]
[tool.ruff.lint.extend-per-file-ignores]
"tests/**/*.py" = [
"S101", # asserts allowed in tests
"ARG", # Unused function args allowed in tests
"PLR2004", # Magic value used in comparison
"TCH002", # No import only type checking in tests
"SLF001", # enable private member access in tests
"S105", # allow hardcoded passwords in tests
"S311", # allow standard pseudo-random generators in tests
"PT011", # allow generic exceptions in tests
"N806", # allow uppercase variable names in tests
"PGH003", # allow general ignores in tests
"S106", # allow hardcoded passwords in tests
"PLR0915", # allow complext statements in tests
]
[tool.ruff.lint.isort]
known-first-party = ["guidellm", "tests"]
[tool.pytest.ini_options]
addopts = '-s -vvv --cache-clear'
markers = [
"smoke: quick tests to check basic functionality",
"sanity: detailed tests to ensure major functions work correctly",
"regression: tests to ensure that new changes do not break existing functionality"
]