|
1 | 1 | [build-system] |
2 | | -requires = [ "setuptools >= 61.0", "wheel", "build",] |
| 2 | +requires = ["setuptools >= 61.0", "wheel", "build"] |
3 | 3 | build-backend = "setuptools.build_meta" |
4 | 4 |
|
| 5 | + |
| 6 | +[tool.setuptools.packages.find] |
| 7 | +where = ["src"] |
| 8 | +include = ["*"] |
| 9 | + |
| 10 | +[tool.setuptools.package-data] |
| 11 | +"guidellm.data" = ["*.gz"] |
| 12 | + |
| 13 | + |
| 14 | +# ************************************************ |
| 15 | +# ********** Project Metadata ********** |
| 16 | +# ************************************************ |
| 17 | + |
5 | 18 | [project] |
6 | | -name = "guidellm_dev" |
7 | | -version = "0.2.0.dev0" |
| 19 | +name = "guidellm" |
| 20 | +version = "0.2.0" |
8 | 21 | description = "Guidance platform for deploying and managing large language models." |
| 22 | +readme = { file = "README.md", content-type = "text/markdown" } |
9 | 23 | requires-python = ">=3.9.0,<4.0" |
10 | | -dependencies = [ "click", "datasets", "ftfy>=6.0.0", "httpx[http2]<1.0.0", "loguru", "numpy", "pillow", "protobuf", "pydantic>=2.0.0", "pydantic-settings>=2.0.0", "pyyaml>=6.0.0", "requests", "rich", "transformers",] |
11 | | -[[project.authors]] |
12 | | -name = "Neuralmagic, Inc." |
| 24 | +license = { file = "LICENSE" } |
| 25 | +authors = [ { name = "Neuralmagic, Inc." } ] |
| 26 | +urls = { homepage = "https://github.com/neuralmagic/guidellm" } |
| 27 | +dependencies = [ |
| 28 | + "click", |
| 29 | + "datasets", |
| 30 | + "ftfy>=6.0.0", |
| 31 | + "httpx[http2]<1.0.0", |
| 32 | + "loguru", |
| 33 | + "numpy", |
| 34 | + "pillow", |
| 35 | + "protobuf", |
| 36 | + "pydantic>=2.0.0", |
| 37 | + "pydantic-settings>=2.0.0", |
| 38 | + "pyyaml>=6.0.0", |
| 39 | + "requests", |
| 40 | + "rich", |
| 41 | + "transformers", |
| 42 | +] |
| 43 | + |
| 44 | +[project.optional-dependencies] |
| 45 | +dev = [ |
| 46 | + # general and configurations |
| 47 | + "pre-commit~=3.5.0", |
| 48 | + "scipy~=1.10", |
| 49 | + "sphinx~=7.1.2", |
| 50 | + "tox~=4.16.0", |
| 51 | + |
| 52 | + # testing |
| 53 | + "lorem~=0.1.1", |
| 54 | + "pytest~=8.2.2", |
| 55 | + "pytest-asyncio~=0.23.8", |
| 56 | + "pytest-cov~=5.0.0", |
| 57 | + "pytest-mock~=3.14.0", |
| 58 | + "pytest-rerunfailures~=14.0", |
| 59 | + "requests-mock~=1.12.1", |
| 60 | + "respx~=0.22.0", |
| 61 | + |
| 62 | + # code quality |
| 63 | + "mypy~=1.10.1", |
| 64 | + "ruff~=0.5.2", |
| 65 | + |
| 66 | + # docs quality |
| 67 | + "mdformat~=0.7.17", |
| 68 | + "mdformat-footnote~=0.1.1", |
| 69 | + "mdformat-frontmatter~=2.0.8", |
| 70 | + "mdformat-gfm~=0.3.6", |
| 71 | + |
| 72 | + # type-checking |
| 73 | + "types-click~=7.1.8", |
| 74 | + "types-PyYAML~=6.0.1", |
| 75 | + "types-requests~=2.32.0", |
| 76 | + "types-toml", |
| 77 | +] |
| 78 | + |
| 79 | + |
| 80 | +[project.entry-points.console_scripts] |
| 81 | +guidellm = "guidellm.__main__:cli" |
| 82 | + |
| 83 | + |
| 84 | +# ************************************************ |
| 85 | +# ********** Code Quality Tools ********** |
| 86 | +# ************************************************ |
| 87 | + |
13 | 88 |
|
14 | 89 | [tool.isort] |
15 | 90 | profile = "black" |
16 | 91 |
|
| 92 | + |
17 | 93 | [tool.mypy] |
18 | | -files = [ "src/guidellm", "tests",] |
19 | | -python_version = "3.9" |
| 94 | +files = ["src/guidellm", "tests"] |
| 95 | +python_version = '3.9' |
20 | 96 | warn_redundant_casts = true |
21 | 97 | warn_unused_ignores = false |
22 | 98 | show_error_codes = true |
23 | 99 | namespace_packages = true |
24 | | -exclude = [ "venv", ".tox",] |
25 | | -follow_imports = "silent" |
| 100 | +exclude = ["venv", ".tox"] |
| 101 | + |
| 102 | +# Silence "type import errors" as our 3rd-party libs does not have types |
| 103 | +# Check: https://mypy.readthedocs.io/en/latest/config_file.html#import-discovery |
| 104 | +follow_imports = 'silent' |
| 105 | + |
26 | 106 | [[tool.mypy.overrides]] |
27 | | -module = [ "datasets.*",] |
28 | | -ignore_missing_imports = true |
| 107 | +module = ["datasets.*"] |
| 108 | +ignore_missing_imports=true |
| 109 | + |
29 | 110 |
|
30 | 111 | [tool.ruff] |
31 | 112 | line-length = 88 |
32 | 113 | indent-width = 4 |
33 | | -exclude = [ "build", "dist", "env", ".venv",] |
34 | | - |
35 | | -[project.readme] |
36 | | -file = "README.md" |
37 | | -content-type = "text/markdown" |
38 | | - |
39 | | -[project.license] |
40 | | -file = "LICENSE" |
41 | | - |
42 | | -[project.urls] |
43 | | -homepage = "https://github.com/neuralmagic/guidellm" |
44 | | - |
45 | | -[project.optional-dependencies] |
46 | | -dev = [ "pre-commit~=3.5.0", "scipy~=1.10", "sphinx~=7.1.2", "tox~=4.16.0", "lorem~=0.1.1", "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", "respx~=0.22.0", "mypy~=1.10.1", "ruff~=0.5.2", "mdformat~=0.7.17", "mdformat-footnote~=0.1.1", "mdformat-frontmatter~=2.0.8", "mdformat-gfm~=0.3.6", "types-click~=7.1.8", "types-PyYAML~=6.0.1", "types-requests~=2.32.0", "types-toml",] |
47 | | - |
48 | | -[tool.setuptools.package-data] |
49 | | -"guidellm.data" = [ "*.gz",] |
| 114 | +exclude = ["build", "dist", "env", ".venv"] |
50 | 115 |
|
51 | 116 | [tool.ruff.format] |
52 | 117 | quote-style = "double" |
53 | 118 | indent-style = "space" |
54 | 119 |
|
55 | 120 | [tool.ruff.lint] |
56 | | -ignore = [ "PLR0913", "TCH001", "COM812", "ISC001", "TCH002", "PLW1514", "RET505", "RET506", "PD011",] |
57 | | -select = [ "E", "W", "A", "C", "COM", "ERA", "I", "ICN", "N", "NPY", "PD", "PT", "PTH", "Q", "TCH", "TID", "RUF022", "C4", "C90", "ISC", "PIE", "R", "SIM", "ARG", "ASYNC", "B", "BLE", "E", "F", "INP", "PGH", "PL", "RSE", "S", "SLF", "T10", "T20", "UP", "W", "YTT", "FIX",] |
58 | | - |
59 | | -[tool.pytest.ini_options] |
60 | | -addopts = "-s -vvv --cache-clear" |
61 | | -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",] |
62 | | - |
63 | | -[project.entry-points.console_scripts] |
64 | | -guidellm = "guidellm.__main__:cli" |
65 | | - |
66 | | -[tool.setuptools.packages.find] |
67 | | -where = [ "src",] |
68 | | -include = [ "*",] |
| 121 | +ignore = [ |
| 122 | + "PLR0913", |
| 123 | + "TCH001", |
| 124 | + "COM812", |
| 125 | + "ISC001", |
| 126 | + "TCH002", |
| 127 | + "PLW1514", # allow Path.open without encoding |
| 128 | + "RET505", # allow `else` blocks |
| 129 | + "RET506", # allow `else` blocks |
| 130 | + "PD011", # ignore .values usage since ruff assumes it's a Pandas DataFrame |
| 131 | +] |
| 132 | +select = [ |
| 133 | + # Rules reference: https://docs.astral.sh/ruff/rules/ |
| 134 | + |
| 135 | + # Code Style / Formatting |
| 136 | + "E", # pycodestyle: checks adherence to PEP 8 conventions including spacing, indentation, and line length |
| 137 | + "W", # pycodestyle: checks adherence to PEP 8 conventions including spacing, indentation, and line length |
| 138 | + "A", # flake8-builtins: prevents shadowing of Python built-in names |
| 139 | + "C", # Convention: ensures code adheres to specific style and formatting conventions |
| 140 | + "COM", # flake8-commas: enforces the correct use of trailing commas |
| 141 | + "ERA", # eradicate: detects commented-out code that should be removed |
| 142 | + "I", # isort: ensures imports are sorted in a consistent manner |
| 143 | + "ICN", # flake8-import-conventions: enforces import conventions for better readability |
| 144 | + "N", # pep8-naming: enforces PEP 8 naming conventions for classes, functions, and variables |
| 145 | + "NPY", # NumPy: enforces best practices for using the NumPy library |
| 146 | + "PD", # pandas-vet: enforces best practices for using the pandas library |
| 147 | + "PT", # flake8-pytest-style: enforces best practices and style conventions for pytest tests |
| 148 | + "PTH", # flake8-use-pathlib: encourages the use of pathlib over os.path for file system operations |
| 149 | + "Q", # flake8-quotes: enforces consistent use of single or double quotes |
| 150 | + "TCH", # flake8-type-checking: enforces type checking practices and standards |
| 151 | + "TID", # flake8-tidy-imports: enforces tidy and well-organized imports |
| 152 | + "RUF022", # flake8-ruff: enforce sorting of __all__ in modules |
| 153 | + |
| 154 | + # Code Structure / Complexity |
| 155 | + "C4", # flake8-comprehensions: improves readability and performance of list, set, and dict comprehensions |
| 156 | + "C90", # mccabe: checks for overly complex code using cyclomatic complexity |
| 157 | + "ISC", # flake8-implicit-str-concat: prevents implicit string concatenation |
| 158 | + "PIE", # flake8-pie: identifies and corrects common code inefficiencies and mistakes |
| 159 | + "R", # Refactor: suggests improvements to code structure and readability |
| 160 | + "SIM", # flake8-simplify: simplifies complex expressions and improves code readability |
| 161 | + |
| 162 | + # Code Security / Bug Prevention |
| 163 | + "ARG", # flake8-unused-arguments: detects unused function and method arguments |
| 164 | + "ASYNC", # flake8-async: identifies incorrect or inefficient usage patterns in asynchronous code |
| 165 | + "B", # flake8-bugbear: detects common programming mistakes and potential bugs |
| 166 | + "BLE", # flake8-blind-except: prevents blind exceptions that catch all exceptions without handling |
| 167 | + "E", # Error: detects and reports errors in the code |
| 168 | + "F", # Pyflakes: detects unused imports, shadowed imports, undefined variables, and various formatting errors in string operations |
| 169 | + "INP", # flake8-no-pep420: prevents implicit namespace packages by requiring __init__.py |
| 170 | + "PGH", # pygrep-hooks: detects deprecated and dangerous code patterns |
| 171 | + "PL", # Pylint: comprehensive source code analyzer for enforcing coding standards and detecting errors |
| 172 | + "RSE", # flake8-raise: ensures exceptions are raised correctly |
| 173 | + "S", # flake8-bandit: detects security issues and vulnerabilities in the code |
| 174 | + "SLF", # flake8-self: prevents incorrect usage of the self argument in class methods |
| 175 | + "T10", # flake8-debugger: detects the presence of debugging tools such as pdb |
| 176 | + "T20", # flake8-print: detects print statements left in the code |
| 177 | + "UP", # pyupgrade: automatically upgrades syntax for newer versions of Python |
| 178 | + "W", # Warning: provides warnings about potential issues in the code |
| 179 | + "YTT", # flake8-2020: identifies code that will break with future Python releases |
| 180 | + |
| 181 | + # Code Documentation |
| 182 | + "FIX", # flake8-fixme: detects FIXMEs and other temporary comments that should be resolved |
| 183 | +] |
69 | 184 |
|
70 | 185 | [tool.ruff.lint.extend-per-file-ignores] |
71 | | -"tests/**/*.py" = [ "S101", "ARG", "PLR2004", "TCH002", "SLF001", "S105", "S311", "PT011", "N806", "PGH003", "S106", "PLR0915",] |
| 186 | +"tests/**/*.py" = [ |
| 187 | + "S101", # asserts allowed in tests |
| 188 | + "ARG", # Unused function args allowed in tests |
| 189 | + "PLR2004", # Magic value used in comparison |
| 190 | + "TCH002", # No import only type checking in tests |
| 191 | + "SLF001", # enable private member access in tests |
| 192 | + "S105", # allow hardcoded passwords in tests |
| 193 | + "S311", # allow standard pseudo-random generators in tests |
| 194 | + "PT011", # allow generic exceptions in tests |
| 195 | + "N806", # allow uppercase variable names in tests |
| 196 | + "PGH003", # allow general ignores in tests |
| 197 | + "S106", # allow hardcoded passwords in tests |
| 198 | + "PLR0915", # allow complext statements in tests |
| 199 | +] |
72 | 200 |
|
73 | 201 | [tool.ruff.lint.isort] |
74 | | -known-first-party = [ "guidellm", "tests",] |
| 202 | +known-first-party = ["guidellm", "tests"] |
| 203 | + |
| 204 | + |
| 205 | +[tool.pytest.ini_options] |
| 206 | +addopts = '-s -vvv --cache-clear' |
| 207 | +markers = [ |
| 208 | + "smoke: quick tests to check basic functionality", |
| 209 | + "sanity: detailed tests to ensure major functions work correctly", |
| 210 | + "regression: tests to ensure that new changes do not break existing functionality" |
| 211 | +] |
0 commit comments