Skip to content

Commit ba197db

Browse files
authored
Set up repository dependencies and structure (#1)
* Set up repository dependencies and structure * Remove type-checking
1 parent 684c676 commit ba197db

File tree

6 files changed

+831
-24
lines changed

6 files changed

+831
-24
lines changed

.github/workflows/ci.yaml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,5 @@ jobs:
3131
- name: Check formatting
3232
run: uv run ruff format --check
3333

34-
- name: Run type checking
35-
run: uv run mypy --strict .
36-
3734
- name: Run tests
3835
run: uv run pytest -v

pyproject.toml

Lines changed: 21 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,25 +4,36 @@ version = "0.1"
44
description = "Grants LLM the ability to glob, grep, and view files within a directory"
55
readme = "README.md"
66
authors = [{name = "Brett Harvey"}]
7-
license = "Apache-2.0"
7+
license = "MIT"
88
classifiers = []
99
requires-python = ">=3.9"
1010
dependencies = [
11-
"llm>=0.26"
11+
"llm>=0.26",
12+
"readonly-fs-tools>=0.2.0",
1213
]
1314

14-
[build-system]
15-
requires = ["setuptools"]
16-
build-backend = "setuptools.build_meta"
17-
1815
[project.urls]
1916
Homepage = "https://github.com/rbharvs/llm-tools-readonly-fs"
2017
Changelog = "https://github.com/rbharvs/llm-tools-readonly-fs/releases"
2118
Issues = "https://github.com/rbharvs/llm-tools-readonly-fs/issues"
2219
CI = "https://github.com/rbharvs/llm-tools-readonly-fs/actions"
2320

24-
[project.entry-points.llm]
25-
llm_tools_readonly_fs = "llm_tools_readonly_fs"
21+
[build-system]
22+
requires = ["uv_build>=0.6.6,<0.7"]
23+
build-backend = "uv_build"
24+
25+
[tool.ruff]
26+
src = ["src", "tests"]
2627

27-
[project.optional-dependencies]
28-
test = ["pytest", "llm-echo>=0.3a1"]
28+
[tool.ruff.lint]
29+
extend-select = ["I"]
30+
31+
[tool.ruff.lint.isort]
32+
combine-as-imports = true
33+
34+
[dependency-groups]
35+
dev = [
36+
"llm-echo>=0.3a1",
37+
"pytest>=8.4.1",
38+
"ruff>=0.12.0",
39+
]
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
from llm_tools_readonly_fs.llm_tools_readonly_fs import view
2+
3+
__all__ = ["view"]

llm_tools_readonly_fs.py renamed to src/llm_tools_readonly_fs/llm_tools_readonly_fs.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,9 @@
22

33

44
def view(input: str) -> str:
5-
"""
6-
Description of tool goes here.
7-
"""
85
return f"hello {input}"
96

107

118
@llm.hookimpl
12-
def register_tools(register):
9+
def register_tools(register) -> None:
1310
register(view)

tests/test_llm_tools_readonly_fs.py

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,15 @@
1-
import llm
21
import json
2+
3+
import llm
4+
35
from llm_tools_readonly_fs import view
46

57

6-
def test_tool():
8+
def test_tool() -> None:
79
model = llm.get_model("echo")
810
chain_response = model.chain(
911
json.dumps(
10-
{
11-
"tool_calls": [
12-
{"name": "view", "arguments": {"input": "pelican"}}
13-
]
14-
}
12+
{"tool_calls": [{"name": "view", "arguments": {"input": "pelican"}}]}
1513
),
1614
tools=[view],
1715
)

0 commit comments

Comments
 (0)