Skip to content

Commit 8c25a1c

Browse files
committed
Merge latest state
2 parents 0bb6db5 + bb00361 commit 8c25a1c

File tree

88 files changed

+8805
-2508
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

88 files changed

+8805
-2508
lines changed

.github/workflows/nightly.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,9 @@ jobs:
5757
publish:
5858
needs: [unit-tests, integration-tests, e2e-tests]
5959
runs-on: ubuntu-latest
60+
env:
61+
GUIDELLM_BUILD_TYPE: nightly
62+
GUIDELLM_BUILD_NUMBER: ${{ github.event.pull_request.number || github.run_number }}
6063
steps:
6164
- uses: actions/checkout@v4
6265
- name: Set up Python
@@ -68,4 +71,3 @@ jobs:
6871
with:
6972
publish_pypi: true
7073
publish_pypi_internal: true
71-
build_type: nightly

.github/workflows/release.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,9 @@ jobs:
5959
name: Build & Publish the distribution
6060
needs: [unit-tests, integration-tests, e2e-tests]
6161
runs-on: ubuntu-latest
62+
env:
63+
GUIDELLM_BUILD_TYPE: release
64+
GUIDELLM_BUILD_NUMBER: ${{ github.event.pull_request.number || github.run_number }}
6265
steps:
6366
- uses: actions/checkout@v4
6467
- name: Set up Python
@@ -70,4 +73,3 @@ jobs:
7073
with:
7174
publish_pypi: true
7275
publish_pypi_internal: true
73-
build_type: release

.github/workflows/staging.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,9 @@ jobs:
5858
name: Build & Publish the distribution
5959
needs: [unit-tests, integration-tests, e2e-tests]
6060
runs-on: ubuntu-latest
61+
env:
62+
GUIDELLM_BUILD_TYPE: release
63+
GUIDELLM_BUILD_NUMBER: ${{ github.event.pull_request.number || github.run_number }}
6164
steps:
6265
- uses: actions/checkout@v4
6366
- name: Set up Python
@@ -69,4 +72,3 @@ jobs:
6972
with:
7073
publish_pypi: false
7174
publish_pypi_internal: true
72-
build_type: release

.pre-commit-config.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,18 +18,21 @@ repos:
1818
# main dependencies
1919
click,
2020
datasets,
21+
ftfy,
2122
loguru,
2223
numpy,
2324
openai,
2425
pydantic,
2526
pydantic_settings,
2627
pyyaml,
2728
requests,
29+
rich,
2830
transformers,
2931

3032
# dev dependencies
3133
pytest,
3234
pydantic_settings,
35+
requests-mock,
3336

3437
# types
3538
types-click,

pyproject.toml

Lines changed: 23 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -27,27 +27,32 @@ urls = { homepage = "https://github.com/neuralmagic/guidellm" }
2727
dependencies = [
2828
"click",
2929
"datasets",
30+
"ftfy>=6.0.0",
3031
"loguru",
3132
"numpy",
3233
"openai",
3334
"pydantic>=2.0.0",
3435
"pydantic-settings>=2.0.0",
3536
"pyyaml>=6.0.0",
3637
"requests",
38+
"rich",
3739
"transformers",
3840
]
3941

4042
[project.optional-dependencies]
4143
dev = [
4244
# general and configurations
4345
"pre-commit~=3.5.0",
46+
"scipy~=1.10",
4447
"sphinx~=7.1.2",
4548
"tox~=4.16.0",
4649

4750
# testing
4851
"pytest~=8.2.2",
52+
"pytest-asyncio~=0.23.8",
4953
"pytest-cov~=5.0.0",
5054
"pytest-mock~=3.14.0",
55+
"pytest-rerunfailures~=14.0",
5156
"requests-mock~=1.12.1",
5257

5358
# code quality
@@ -83,7 +88,7 @@ profile = "black"
8388
files = ["src/guidellm", "tests"]
8489
python_version = '3.8'
8590
warn_redundant_casts = true
86-
warn_unused_ignores = true
91+
warn_unused_ignores = false
8792
show_error_codes = true
8893
namespace_packages = true
8994
exclude = ["venv", ".tox"]
@@ -92,22 +97,27 @@ exclude = ["venv", ".tox"]
9297
# Check: https://mypy.readthedocs.io/en/latest/config_file.html#import-discovery
9398
follow_imports = 'silent'
9499

95-
[[tool.mypy.overrides]]
96-
module = ["transformers.*", "datasets.*"]
97-
ignore_missing_imports=true
98-
99100

100101
[tool.ruff]
101102
line-length = 88
103+
indent-width = 4
102104
exclude = ["build", "dist", "env", ".venv"]
103-
lint.ignore = [
105+
106+
[tool.ruff.format]
107+
quote-style = "double"
108+
indent-style = "space"
109+
110+
[tool.ruff.lint]
111+
ignore = [
104112
"PLR0913",
105113
"TCH001",
106114
"COM812",
107115
"ISC001",
108116
"TCH002",
117+
"PLW1514", # allow Path.open without encoding
118+
109119
]
110-
lint.select = [
120+
select = [
111121
# Rules reference: https://docs.astral.sh/ruff/rules/
112122

113123
# Code Style / Formatting
@@ -127,11 +137,11 @@ lint.select = [
127137
"Q", # flake8-quotes: enforces consistent use of single or double quotes
128138
"TCH", # flake8-type-checking: enforces type checking practices and standards
129139
"TID", # flake8-tidy-imports: enforces tidy and well-organized imports
140+
"RUF022", # flake8-ruff: enforce sorting of __all__ in modules
130141

131142
# Code Structure / Complexity
132143
"C4", # flake8-comprehensions: improves readability and performance of list, set, and dict comprehensions
133144
"C90", # mccabe: checks for overly complex code using cyclomatic complexity
134-
"FBT", # flake8-boolean-trap: prevents the use of boolean traps in function arguments and calls
135145
"ISC", # flake8-implicit-str-concat: prevents implicit string concatenation
136146
"PIE", # flake8-pie: identifies and corrects common code inefficiencies and mistakes
137147
"R", # Refactor: suggests improvements to code structure and readability
@@ -164,7 +174,6 @@ lint.select = [
164174
"tests/**/*.py" = [
165175
"S101", # asserts allowed in tests
166176
"ARG", # Unused function args allowed in tests
167-
"FBT", # Booleans as positional arguments in tests, e.g. via @pytest.mark.parametrize()
168177
"PLR2004", # Magic value used in comparison
169178
"TCH002", # No import only type checking in tests
170179
"SLF001", # enable private member access in tests
@@ -173,8 +182,13 @@ lint.select = [
173182
"PT011", # allow generic exceptions in tests
174183
"N806", # allow uppercase variable names in tests
175184
"PGH003", # allow general ignores in tests
185+
"S106", # allow hardcoded passwords in tests
186+
"PLR0915", # allow complext statements in tests
176187
]
177188

189+
[tool.ruff.lint.isort]
190+
known-first-party = ["guidellm", "tests"]
191+
178192

179193
[tool.pytest.ini_options]
180194
addopts = '-s -vvv --cache-clear'

src/guidellm/__init__.py

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,15 @@
33
evaluating and benchmarking large language models (LLMs).
44
"""
55

6-
from .logger import configure_logger, logger # noqa: F401
6+
import os
7+
8+
import transformers # type: ignore # noqa: PGH003
9+
10+
from .config import settings
11+
from .logger import configure_logger, logger
12+
13+
__all__ = ["configure_logger", "logger", "settings"]
14+
15+
16+
os.environ["TOKENIZERS_PARALLELISM"] = "false" # Silence warnings for tokenizers
17+
transformers.logging.set_verbosity_error() # Silence warnings for transformers

0 commit comments

Comments
 (0)