Skip to content

Commit 3021c7d

Browse files
committed
Align lint checks with LSC
1 parent fc5f537 commit 3021c7d

81 files changed

Lines changed: 1050 additions & 941 deletions

File tree

Some content is hidden

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

Makefile

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,10 @@ update-deps: ## Check pyproject.toml for changes, update the lock file if needed
2323
uv sync --group dev
2424

2525
check-types: ## Checks type hints in sources
26-
uv run mypy --explicit-package-bases --disallow-untyped-calls --disallow-untyped-defs --disallow-incomplete-defs src/ lsc_agent_eval/src/ tests
26+
uv run mypy src/ lsc_agent_eval/src/ tests
2727

2828
black-check:
29-
uv run black src tests script lsc_agent_eval --check
29+
uv run black --check src tests script lsc_agent_eval
3030

3131
black-format:
3232
uv run black src tests script lsc_agent_eval
@@ -118,7 +118,7 @@ shellcheck: ## Run shellcheck
118118

119119
pylint:
120120
uv run pylint src
121-
uv run pylint --disable=R0801 lsc_agent_eval/src tests
121+
uv run pylint lsc_agent_eval/src tests
122122

123123
pyright:
124124
uv run pyright src lsc_agent_eval/src tests
@@ -130,4 +130,4 @@ ruff:
130130
uv run ruff check src tests script lsc_agent_eval
131131

132132
bandit: ## Security scanning with Bandit
133-
uv run bandit -r src/lightspeed_evaluation -ll
133+
uv run bandit -c pyproject.toml -r src/lightspeed_evaluation -ll

lsc_agent_eval/src/lsc_agent_eval/core/agent_goal_eval/evaluator.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
from ..utils.exceptions import AgentAPIError, JudgeModelError, ScriptExecutionError
77
from ..utils.prompt import ANSWER_CORRECTNESS_PROMPT, INTENT_DETECTION_PROMPT
88
from .tool_call_eval import compare_tool_calls
9-
from .utils import create_evaluation_results
9+
from .utils import EvalResultItem, create_evaluation_results
1010

1111
if TYPE_CHECKING:
1212
from ..utils.api_client import AgentHttpClient
@@ -42,12 +42,13 @@ def run_evaluation( # pylint: disable=too-many-arguments,too-many-positional-ar
4242
"""Run multiple evaluations based on configuration."""
4343
try:
4444
# Query the agent once
45-
api_input = {
45+
api_input: dict[str, str] = {
4646
"query": data_config.eval_query,
4747
"provider": agent_provider,
4848
"model": agent_model,
49-
"conversation_id": conversation_id,
5049
}
50+
if conversation_id is not None:
51+
api_input["conversation_id"] = conversation_id
5152

5253
if endpoint_type == "streaming":
5354
agent_response = self.agent_client.streaming_query_agent(api_input)
@@ -61,7 +62,7 @@ def run_evaluation( # pylint: disable=too-many-arguments,too-many-positional-ar
6162
tool_calls = agent_response.get("tool_calls", [])
6263

6364
# Run all evaluations
64-
evaluation_results = []
65+
evaluation_results: list[EvalResultItem] = []
6566
for eval_type in data_config.eval_types:
6667
try:
6768
success = self._evaluate_single_type(

lsc_agent_eval/src/lsc_agent_eval/core/agent_goal_eval/results.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
import json
44
import logging
5-
from datetime import datetime
5+
from datetime import UTC, datetime
66
from pathlib import Path
77

88
import pandas as pd
@@ -32,7 +32,7 @@ def save_results(self, result_dir: str) -> None:
3232
output_dir = Path(result_dir)
3333
output_dir.mkdir(parents=True, exist_ok=True)
3434

35-
timestamp = datetime.now().strftime("%Y%m%d_%H%M%S")
35+
timestamp = datetime.now(UTC).strftime("%Y%m%d_%H%M%S")
3636
csv_file = output_dir / f"agent_goal_eval_results_{timestamp}.csv"
3737
json_file = output_dir / f"agent_goal_eval_summary_{timestamp}.json"
3838

pyproject.toml

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ dev = [
6666
"pytest-cov>=6.0.0,<=6.2.1",
6767
"pytest-mock==3.15.1",
6868
"pytest-timeout==2.4.0",
69+
"types-PyYAML>=6.0.0",
6970
]
7071

7172
[project.scripts]
@@ -75,32 +76,39 @@ generate_answers = "generate_answers.generate_answers:main"
7576
# Note: torch[cpu] variant configuration removed for uv compatibility
7677
# Modern PyTorch versions are available on PyPI directly
7778

78-
[tool.isort]
79-
src_paths = ["src", "tests"]
80-
8179
[tool.black]
8280
line-length = 88
8381

8482
[tool.pydocstyle]
8583
convention = "google"
8684

8785
[tool.mypy]
88-
disable_error_code = ["union-attr", "return-value", "arg-type", "import-untyped"]
89-
ignore_missing_imports = true
9086
plugins = ["pydantic.mypy"]
87+
explicit_package_bases = true
88+
disallow_untyped_calls = true
89+
disallow_untyped_defs = true
90+
disallow_incomplete_defs = true
91+
ignore_missing_imports = true
9192

9293
[tool.pydantic-mypy]
9394
init_forbid_extra = true
9495
init_typed = true
9596
warn_required_dynamic_aliases = true
9697

9798
[tool.pylint.MASTER]
99+
source-roots = ["src", "script", "tests"]
98100
load-plugins = ["pylint_pydantic"]
99101
init-hook = "import sys; sys.path.append('.')"
102+
[tool.pylint."MESSAGES CONTROL"]
103+
disable = ["R0801"]
104+
105+
[tool.pyright]
106+
extraPaths = ["./src"]
100107

101108
[tool.ruff]
109+
line-length = 88
102110
[tool.ruff.lint]
103-
extend-select = ["TID251"]
111+
extend-select = ["TID251", "UP006", "UP007", "UP010", "UP017", "UP035", "RUF100", "B009", "B010", "DTZ005", "D202", "I001", "PLR1733"]
104112
[tool.ruff.lint.flake8-tidy-imports.banned-api]
105113
unittest = { msg = "use pytest instead of unittest" }
106114
"unittest.mock" = { msg = "use pytest-mock instead of unittest.mock" }

requirements-all-extras.txt

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -117,13 +117,13 @@ googleapis-common-protos==1.75.0
117117
# grpcio-status
118118
greenlet==3.5.1 ; platform_machine == 'AMD64' or platform_machine == 'WIN32' or platform_machine == 'aarch64' or platform_machine == 'amd64' or platform_machine == 'ppc64le' or platform_machine == 'win32' or platform_machine == 'x86_64'
119119
# via sqlalchemy
120-
grpcio==1.80.0
120+
grpcio==1.81.0
121121
# via
122122
# deepeval
123123
# google-ai-generativelanguage
124124
# google-api-core
125125
# grpcio-status
126-
grpcio-status==1.80.0
126+
grpcio-status==1.81.0
127127
# via google-api-core
128128
h11==0.16.0
129129
# via httpcore
@@ -148,7 +148,7 @@ huggingface-hub==1.16.1
148148
# sentence-transformers
149149
# tokenizers
150150
# transformers
151-
idna==3.16
151+
idna==3.17
152152
# via
153153
# anyio
154154
# httpx
@@ -210,7 +210,7 @@ langchain-huggingface==1.2.2
210210
# via langchain
211211
langchain-openai==1.1.10
212212
# via ragas
213-
langchain-protocol==0.0.15
213+
langchain-protocol==0.0.16
214214
# via langchain-core
215215
langgraph==1.1.10
216216
# via langchain
@@ -222,7 +222,7 @@ langgraph-prebuilt==1.0.13
222222
# via langgraph
223223
langgraph-sdk==0.3.15
224224
# via langgraph
225-
langsmith==0.8.5
225+
langsmith==0.8.8
226226
# via
227227
# langchain-community
228228
# langchain-core
@@ -338,7 +338,7 @@ proto-plus==1.28.0
338338
# via
339339
# google-ai-generativelanguage
340340
# google-api-core
341-
protobuf==6.33.6
341+
protobuf==7.35.0
342342
# via
343343
# google-ai-generativelanguage
344344
# google-api-core
@@ -455,7 +455,7 @@ rich==14.3.4
455455
# typer
456456
rouge-score==0.1.2
457457
# via lightspeed-evaluation
458-
rpds-py==0.30.0
458+
rpds-py==2026.5.1
459459
# via
460460
# jsonschema
461461
# referencing
@@ -477,7 +477,7 @@ seaborn==0.13.2
477477
# via lightspeed-evaluation
478478
sentence-transformers==5.2.3
479479
# via lightspeed-evaluation
480-
sentry-sdk==2.60.0
480+
sentry-sdk==2.61.1
481481
# via deepeval
482482
setuptools==82.0.1
483483
# via
@@ -534,7 +534,7 @@ tqdm==4.67.1
534534
# transformers
535535
transformers==5.9.0
536536
# via sentence-transformers
537-
typer==0.26.1
537+
typer==0.26.5
538538
# via
539539
# deepeval
540540
# huggingface-hub
@@ -578,6 +578,8 @@ uuid-utils==0.16.0
578578
# via
579579
# langchain-core
580580
# langsmith
581+
websockets==16.0
582+
# via langsmith
581583
wheel==0.47.0
582584
# via deepeval
583585
xxhash==3.7.0

requirements-local-embeddings.txt

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -113,13 +113,13 @@ googleapis-common-protos==1.75.0
113113
# grpcio-status
114114
greenlet==3.5.1 ; platform_machine == 'AMD64' or platform_machine == 'WIN32' or platform_machine == 'aarch64' or platform_machine == 'amd64' or platform_machine == 'ppc64le' or platform_machine == 'win32' or platform_machine == 'x86_64'
115115
# via sqlalchemy
116-
grpcio==1.80.0
116+
grpcio==1.81.0
117117
# via
118118
# deepeval
119119
# google-ai-generativelanguage
120120
# google-api-core
121121
# grpcio-status
122-
grpcio-status==1.80.0
122+
grpcio-status==1.81.0
123123
# via google-api-core
124124
h11==0.16.0
125125
# via httpcore
@@ -144,7 +144,7 @@ huggingface-hub==1.16.1
144144
# sentence-transformers
145145
# tokenizers
146146
# transformers
147-
idna==3.16
147+
idna==3.17
148148
# via
149149
# anyio
150150
# httpx
@@ -204,7 +204,7 @@ langchain-huggingface==1.2.2
204204
# via langchain
205205
langchain-openai==1.1.10
206206
# via ragas
207-
langchain-protocol==0.0.15
207+
langchain-protocol==0.0.16
208208
# via langchain-core
209209
langgraph==1.1.10
210210
# via langchain
@@ -216,7 +216,7 @@ langgraph-prebuilt==1.0.13
216216
# via langgraph
217217
langgraph-sdk==0.3.15
218218
# via langgraph
219-
langsmith==0.8.5
219+
langsmith==0.8.8
220220
# via
221221
# langchain-community
222222
# langchain-core
@@ -324,7 +324,7 @@ proto-plus==1.28.0
324324
# via
325325
# google-ai-generativelanguage
326326
# google-api-core
327-
protobuf==6.33.6
327+
protobuf==7.35.0
328328
# via
329329
# google-ai-generativelanguage
330330
# google-api-core
@@ -435,7 +435,7 @@ rich==14.3.4
435435
# instructor
436436
# ragas
437437
# typer
438-
rpds-py==0.30.0
438+
rpds-py==2026.5.1
439439
# via
440440
# jsonschema
441441
# referencing
@@ -455,7 +455,7 @@ seaborn==0.13.2
455455
# via lightspeed-evaluation
456456
sentence-transformers==5.2.3
457457
# via lightspeed-evaluation
458-
sentry-sdk==2.60.0
458+
sentry-sdk==2.61.1
459459
# via deepeval
460460
setuptools==82.0.1
461461
# via
@@ -508,7 +508,7 @@ tqdm==4.67.1
508508
# transformers
509509
transformers==5.9.0
510510
# via sentence-transformers
511-
typer==0.26.1
511+
typer==0.26.5
512512
# via
513513
# deepeval
514514
# huggingface-hub
@@ -552,6 +552,8 @@ uuid-utils==0.16.0
552552
# via
553553
# langchain-core
554554
# langsmith
555+
websockets==16.0
556+
# via langsmith
555557
wheel==0.47.0
556558
# via deepeval
557559
xxhash==3.7.0

requirements-nlp-metrics.txt

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -115,13 +115,13 @@ googleapis-common-protos==1.75.0
115115
# grpcio-status
116116
greenlet==3.5.1 ; platform_machine == 'AMD64' or platform_machine == 'WIN32' or platform_machine == 'aarch64' or platform_machine == 'amd64' or platform_machine == 'ppc64le' or platform_machine == 'win32' or platform_machine == 'x86_64'
117117
# via sqlalchemy
118-
grpcio==1.80.0
118+
grpcio==1.81.0
119119
# via
120120
# deepeval
121121
# google-ai-generativelanguage
122122
# google-api-core
123123
# grpcio-status
124-
grpcio-status==1.80.0
124+
grpcio-status==1.81.0
125125
# via google-api-core
126126
h11==0.16.0
127127
# via httpcore
@@ -144,7 +144,7 @@ huggingface-hub==1.16.1
144144
# datasets
145145
# langchain-huggingface
146146
# tokenizers
147-
idna==3.16
147+
idna==3.17
148148
# via
149149
# anyio
150150
# httpx
@@ -203,7 +203,7 @@ langchain-huggingface==1.2.2
203203
# via langchain
204204
langchain-openai==1.1.10
205205
# via ragas
206-
langchain-protocol==0.0.15
206+
langchain-protocol==0.0.16
207207
# via langchain-core
208208
langgraph==1.1.10
209209
# via langchain
@@ -215,7 +215,7 @@ langgraph-prebuilt==1.0.13
215215
# via langgraph
216216
langgraph-sdk==0.3.15
217217
# via langgraph
218-
langsmith==0.8.5
218+
langsmith==0.8.8
219219
# via
220220
# langchain-community
221221
# langchain-core
@@ -323,7 +323,7 @@ proto-plus==1.28.0
323323
# via
324324
# google-ai-generativelanguage
325325
# google-api-core
326-
protobuf==6.33.6
326+
protobuf==7.35.0
327327
# via
328328
# google-ai-generativelanguage
329329
# google-api-core
@@ -438,7 +438,7 @@ rich==14.3.4
438438
# typer
439439
rouge-score==0.1.2
440440
# via lightspeed-evaluation
441-
rpds-py==0.30.0
441+
rpds-py==2026.5.1
442442
# via
443443
# jsonschema
444444
# referencing
@@ -452,7 +452,7 @@ scipy==1.16.2
452452
# scikit-network
453453
seaborn==0.13.2
454454
# via lightspeed-evaluation
455-
sentry-sdk==2.60.0
455+
sentry-sdk==2.61.1
456456
# via deepeval
457457
setuptools==82.0.1
458458
# via deepeval
@@ -498,7 +498,7 @@ tqdm==4.67.1
498498
# nltk
499499
# openai
500500
# ragas
501-
typer==0.26.1
501+
typer==0.26.5
502502
# via
503503
# deepeval
504504
# huggingface-hub
@@ -539,6 +539,8 @@ uuid-utils==0.16.0
539539
# via
540540
# langchain-core
541541
# langsmith
542+
websockets==16.0
543+
# via langsmith
542544
wheel==0.47.0
543545
# via deepeval
544546
xxhash==3.7.0

0 commit comments

Comments
 (0)