From c5c2254e8c4cc5da494232dfe55bf0363ed541cf Mon Sep 17 00:00:00 2001 From: mentatai <162378962+mentatai@users.noreply.github.com> Date: Tue, 7 Jan 2025 22:50:21 +0000 Subject: [PATCH] Fix version reading and code formatting - 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 --- benchmarks/swe_bench_runner.py | 3 ++- mentat/llm_api_handler.py | 6 ++---- pyproject.toml | 2 +- setup.py | 4 +--- 4 files changed, 6 insertions(+), 9 deletions(-) diff --git a/benchmarks/swe_bench_runner.py b/benchmarks/swe_bench_runner.py index bd21fd4a0..389926bfe 100644 --- a/benchmarks/swe_bench_runner.py +++ b/benchmarks/swe_bench_runner.py @@ -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 diff --git a/mentat/llm_api_handler.py b/mentat/llm_api_handler.py index 98cdbecc3..41cce658e 100644 --- a/mentat/llm_api_handler.py +++ b/mentat/llm_api_handler.py @@ -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( @@ -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( diff --git a/pyproject.toml b/pyproject.toml index 11579548d..c62b7c007 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -18,7 +18,7 @@ dependencies = [ [tool.hatch.version] path = "mentat/VERSION" -source = "raw" +pattern = "(?P[^\\s]+)" [tool.hatch.build.targets.wheel] packages = ["mentat", "benchmarks"] diff --git a/setup.py b/setup.py index d9693ca94..dae5a30b5 100644 --- a/setup.py +++ b/setup.py @@ -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