Skip to content
This repository has been archived by the owner on Jan 7, 2025. It is now read-only.

Commit

Permalink
Fix version reading and code formatting
Browse files Browse the repository at this point in the history
- Updated version configuration in pyproject.toml to properly handle VERSION file
- Fixed formatting in multiple files using ruff
- Reformatted files:
  - benchmarks/swe_bench_runner.py
  - mentat/llm_api_handler.py
  - setup.py
  • Loading branch information
mentatai[bot] committed Jan 7, 2025
1 parent b66eb82 commit c5c2254
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 9 deletions.
3 changes: 2 additions & 1 deletion benchmarks/swe_bench_runner.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
"""
NOTE: Not all of the Samples are valid with our current implementation. The list of
NOTE: Not all of the Samples are valid with our current implementation. The list of
valid samples is saved in the `summoning-the-shoggoth` repo for now. Running this file
directly from the command line will run the full validation script and overwrite the
results there (takes a few hours).
"""

import argparse
import json
import os
Expand Down
6 changes: 2 additions & 4 deletions mentat/llm_api_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -222,8 +222,7 @@ async def call_llm_api(
provider: Optional[str],
stream: Literal[False],
response_format: ResponseFormat = ResponseFormat(type="text"),
) -> SpiceResponse:
...
) -> SpiceResponse: ...

@overload
async def call_llm_api(
Expand All @@ -233,8 +232,7 @@ async def call_llm_api(
provider: Optional[str],
stream: Literal[True],
response_format: ResponseFormat = ResponseFormat(type="text"),
) -> StreamingSpiceResponse:
...
) -> StreamingSpiceResponse: ...

@api_guard
async def call_llm_api(
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ dependencies = [

[tool.hatch.version]
path = "mentat/VERSION"
source = "raw"
pattern = "(?P<version>[^\\s]+)"

[tool.hatch.build.targets.wheel]
packages = ["mentat", "benchmarks"]
Expand Down
4 changes: 1 addition & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,5 @@ def read_requirements(filename):
def hook(version, build_data):
"""Custom build hook for hatchling to set dynamic dependencies."""
build_data["dependencies"] = read_requirements("requirements.txt")
build_data["optional-dependencies"] = {
"dev": read_requirements("dev-requirements.txt")
}
build_data["optional-dependencies"] = {"dev": read_requirements("dev-requirements.txt")}
return build_data

0 comments on commit c5c2254

Please sign in to comment.