Skip to content

Commit 7f2fbeb

Browse files
authored
Various Small Tooling Fixes/Features (#239)
## Summary <!-- Include a short paragraph of the changes introduced in this PR. If this PR requires additional context or rationale, explain why the changes are necessary. --> Miscellaneous selection of small tooling changes. ## Details <!-- Provide a detailed list of all changes introduced in this pull request. --> - [x] Add dependency-groups `dev` group for tools that automatically install development packages - [x] Add pylock for synchronizing package versions across maintainers - [x] Match tox python version matrix to 3.9-3.12 - [x] Drop the broken PR `build` job - [x] Drop mypy from pre-commit checks ## Test Plan <!-- List the steps needed to test this PR. --> - TODO ## Related Issues <!-- Link any relevant issues that this PR addresses. --> - TODO --- - [x] "I certify that all code in this PR is my own, except as noted below." ## Use of AI - [ ] Includes AI-assisted code completion - [ ] Includes code generated by an AI application - [ ] Includes AI-generated tests (NOTE: AI written tests should have a docstring that includes `## WRITTEN BY AI ##`) --------- Signed-off-by: Samuel Monson <smonson@redhat.com>
1 parent ec328c1 commit 7f2fbeb

File tree

9 files changed

+3386
-93
lines changed

9 files changed

+3386
-93
lines changed

.github/workflows/development.yml

Lines changed: 0 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -180,59 +180,6 @@ jobs:
180180
- name: Run integration tests
181181
run: npm run test:integration
182182

183-
build:
184-
# Only build if the PR branch is local
185-
if: github.event.pull_request.head.repo.full_name == github.repository
186-
runs-on: ubuntu-latest
187-
strategy:
188-
matrix:
189-
python: ["3.9"]
190-
steps:
191-
- name: Checkout code
192-
uses: actions/checkout@v4
193-
with:
194-
fetch-depth: 0
195-
- name: Set up Python
196-
uses: actions/setup-python@v5
197-
with:
198-
python-version: ${{ matrix.python }}
199-
- name: Install dependencies
200-
run: pip install tox
201-
- name: Build the package
202-
run: |
203-
export GUIDELLM_BUILD_TYPE=dev
204-
export GUIDELLM_BUILD_ITERATION=${{ github.event.pull_request.number }}
205-
tox -e build
206-
- name: Upload build artifacts
207-
id: artifact-upload
208-
uses: actions/upload-artifact@v4
209-
with:
210-
name: build-artifacts
211-
path: dist/*
212-
compression-level: 6
213-
if-no-files-found: error
214-
retention-days: 30
215-
- name: Generate GitHub App token
216-
id: app-token
217-
uses: actions/create-github-app-token@v1
218-
with:
219-
app-id: ${{ secrets.GH_NM_REDHAT_AUTOMATION_APP_ID }}
220-
private-key: ${{ secrets.GH_NM_REDHAT_AUTOMATION_APP_PRIVATE_KEY }}
221-
- name: Comment Install instructions
222-
uses: actions/github-script@v7
223-
with:
224-
github-token: ${{ steps.app-token.outputs.token }}
225-
script: |
226-
github.rest.issues.createComment({
227-
issue_number: context.issue.number,
228-
owner: context.repo.owner,
229-
repo: context.repo.repo,
230-
body: `📦 **Build Artifacts Available**
231-
The build artifacts (\`.whl\` and \`.tar.gz\`) have been successfully generated and are available for download: ${{ steps.artifact-upload.outputs.artifact-url }}.
232-
They will be retained for **up to 30 days**.
233-
`
234-
})
235-
236183
ui-pr-preview:
237184
needs: [ui-quality-checks, ui-precommit-checks, ui-unit-tests, ui-integration-tests]
238185
permissions:

.pre-commit-config.yaml

Lines changed: 6 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,16 @@
11
repos:
22
- repo: https://github.com/pre-commit/pre-commit-hooks
3-
rev: v4.6.0
3+
rev: v6.0.0
44
hooks:
55
- id: trailing-whitespace
66
exclude: ^tests/?.*/assets/.+
77
- id: end-of-file-fixer
88
exclude: ^tests/?.*/assets/.+
9+
- repo: https://github.com/pdm-project/pdm
10+
rev: 2.25.6
11+
hooks:
12+
- id: pdm-lock-check
13+
name: check lock file matches pyproject
914
- repo: https://github.com/astral-sh/ruff-pre-commit
1015
rev: v0.11.7
1116
hooks:
@@ -14,35 +19,3 @@ repos:
1419
args: [ --fix, --show-fixes ]
1520
- id: ruff-format
1621
name: run formatter
17-
- repo: https://github.com/pre-commit/mirrors-mypy
18-
rev: v1.15.0
19-
hooks:
20-
- id: mypy
21-
args: [--check-untyped-defs]
22-
additional_dependencies:
23-
[
24-
# main dependencies
25-
click,
26-
datasets,
27-
ftfy,
28-
loguru,
29-
numpy,
30-
pillow,
31-
pydantic,
32-
pydantic_settings,
33-
pyyaml,
34-
respx,
35-
rich,
36-
setuptools,
37-
setuptools-git-versioning,
38-
transformers,
39-
40-
# dev dependencies
41-
pytest,
42-
pydantic_settings,
43-
44-
# types
45-
types-PyYAML,
46-
types-requests,
47-
types-toml,
48-
]

pdm.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
[lock]
2+
format = "pylock"

pylock.toml

Lines changed: 3366 additions & 0 deletions
Large diffs are not rendered by default.

pyproject.toml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@ include = ["*"]
1010
[tool.setuptools.package-data]
1111
"guidellm.data" = ["*.gz"]
1212

13+
[tool.pdm]
14+
distribution = true
15+
1316

1417
# ************************************************
1518
# ********** Project Metadata **********
@@ -100,6 +103,10 @@ dev = [
100103
"mkdocs-linkcheck~=1.0.6",
101104
]
102105

106+
# For PEP 735 compliant tools
107+
[dependency-groups]
108+
dev = [ "guidellm[dev]" ]
109+
103110
[project.urls]
104111
homepage = "https://github.com/vllm-project/guidellm"
105112
source = "https://github.com/vllm-project/guidellm"

src/guidellm/utils/cli.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ def __init__(self, *types: click.ParamType):
3535
self.types = types
3636
self.name = "".join(t.name for t in types)
3737

38-
def convert(self, value, param, ctx):
38+
def convert(self, value, param, ctx): # noqa: RET503
3939
fails = []
4040
for t in self.types:
4141
try:

tests/unit/preprocess/test_dataset.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -133,8 +133,6 @@ def test_process_dataset_non_empty(
133133
mock_save_to_file,
134134
tokenizer_mock,
135135
):
136-
from guidellm.preprocess.dataset import process_dataset
137-
138136
mock_dataset = [{"prompt": "Hello"}, {"prompt": "How are you?"}]
139137
mock_load_dataset.return_value = (mock_dataset, {"prompt_column": "prompt"})
140138
mock_check_processor.return_value = tokenizer_mock

tests/unit/test_cli.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22
Unit tests for CLI functionality, specifically the version flag.
33
"""
44

5+
import importlib.metadata
6+
import re
7+
58
import pytest
69
from click.testing import CliRunner
710

@@ -26,7 +29,6 @@ def test_version_flag_displays_actual_version():
2629
result = runner.invoke(cli, ["--version"])
2730

2831
assert result.exit_code == 0
29-
import re
3032

3133
version_pattern = r"guidellm version: \d+\.\d+"
3234
assert re.search(version_pattern, result.output)
@@ -84,8 +86,6 @@ def test_version_flag_case_sensitivity():
8486
@pytest.mark.integration
8587
def test_version_integration_with_actual_version():
8688
"""Integration test to verify version matches importlib.metadata."""
87-
import importlib.metadata
88-
8989
try:
9090
actual_version = importlib.metadata.version("guidellm")
9191

tox.ini

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tox]
22
min_version = 4.0
3-
env_list = py38,py39,py310,py311,py312
3+
env_list = py3{9,10,11,12,13}
44

55

66
[testenv]

0 commit comments

Comments
 (0)