-
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathpyproject.toml
More file actions
149 lines (133 loc) · 4.68 KB
/
pyproject.toml
File metadata and controls
149 lines (133 loc) · 4.68 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
[project]
name = "token-goat"
version = "0.9.0"
description = "Token optimizer for Claude Code, Codex CLI, opencode, and openclaw on Windows, macOS, Linux, and WSL. Image shrink, re-read dedup, and compaction assist run automatically; CLI commands (symbol, read, section, semantic, map) replace full-file reads with surgical slices."
readme = "README.md"
requires-python = ">=3.11,<3.15"
authors = [{ name = "DFK Helper LLC" }]
license = { text = "PolyForm Noncommercial License 1.0.0" }
keywords = [
"claude-code",
"codex-cli",
"token-optimization",
"llm",
"context-window",
"hooks",
"windows",
"linux",
"macos",
"wsl",
"ai-tools",
]
classifiers = [
"Operating System :: MacOS",
"Operating System :: Microsoft :: Windows",
"Operating System :: POSIX :: Linux",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Topic :: Software Development :: Libraries :: Python Modules",
"Topic :: Utilities",
"Environment :: Plugins",
]
dependencies = [
"typer>=0.12.0,<1.0",
"tree-sitter>=0.23,<0.24",
"sqlite-vec>=0.1.5,<1.0",
"fastembed>=0.3.0,<1.0",
"Pillow>=10.4.0,<13.0",
"httpx>=0.27.0,<1.0",
"google-api-python-client>=2.100.0,<3.0",
"google-auth>=2.30.0,<3.0",
"google-auth-oauthlib>=1.2.0,<2.0",
"psutil>=6.0.0,<8.0",
"networkx>=3.0,<4.0",
"tomli-w>=1.0.0,<2.0",
"rich>=14.0.0,<16.0",
"tree-sitter-language-pack>=0.7,<2.0",
]
[project.urls]
Source = "https://github.com/DFKHelper/token-goat"
Changelog = "https://github.com/DFKHelper/token-goat/blob/main/CHANGELOG.md"
[project.scripts]
token-goat = "token_goat.cli:main"
# Windowless variant: GUI subsystem entry point used by hooks and the
# background worker. Same code, but Windows won't allocate a console for
# the launcher .exe — no flashing terminal windows on every hook fire.
# Both use main() so hook subcommands cannot propagate non-zero exits.
[project.gui-scripts]
token-goat-hook = "token_goat.cli:main"
token-goat-worker = "token_goat.cli:main"
[project.optional-dependencies]
dev = [
"pytest>=8.0.0",
"pytest-cov>=5.0.0",
"ruff>=0.6.0",
"mypy>=1.10.0",
"types-psutil>=6.0.0",
"hypothesis>=6.100.0",
]
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"
[tool.hatch.build.targets.wheel]
packages = ["src/token_goat"]
[tool.ruff]
line-length = 100
target-version = "py311"
[tool.ruff.lint]
select = ["E", "F", "W", "I", "B", "UP", "SIM"]
ignore = ["E501"]
[tool.pytest.ini_options]
testpaths = ["tests"]
pythonpath = ["tests"]
addopts = "-rfe --strict-markers -n auto --dist=loadscope --reruns 1 --reruns-delay 0.5"
timeout = 60
markers = [
"slow: integration tests that spawn real git repos or other slow subprocess work; opt in via `-m slow` or run the full suite with no -m filter (default)",
]
[tool.mypy]
python_version = "3.11"
warn_unused_ignores = false
# Tree-sitter language pack returns are typed as `object` and we unpack
# .name/.kind/.span/.start_byte by duck typing. Each language adapter trips
# the same attr-defined / arg-type errors; suppress at module scope.
[[tool.mypy.overrides]]
module = "token_goat.languages.*"
disable_error_code = ["attr-defined", "arg-type", "misc"]
# Fastembed's model object is a runtime duck type with .embed(); mypy can't see it.
[[tool.mypy.overrides]]
module = "token_goat.embeddings"
disable_error_code = ["attr-defined", "union-attr"]
# networkx graph is imported lazily and returned as `object`; callers use duck-typed .nodes/.edges.
[[tool.mypy.overrides]]
module = "token_goat.repomap"
disable_error_code = ["attr-defined"]
# Hook modules interchange HookResponse (TypedDict) with dict[str, Any] intentionally;
# the protocol is flexible by design and all conversions are safe at runtime.
[[tool.mypy.overrides]]
module = ["token_goat.hooks_common", "token_goat.hooks_read", "token_goat.hooks_cli"]
disable_error_code = ["assignment", "return-value", "arg-type"]
# Third-party libraries that don't ship type stubs.
[[tool.mypy.overrides]]
module = [
"sqlite_vec",
"googleapiclient.*",
"google_auth_oauthlib.*",
"networkx",
"networkx.*",
]
ignore_missing_imports = true
[dependency-groups]
dev = [
"pytest-timeout>=2.4.0",
"pytest-xdist>=3.8.0",
"pytest-randomly>=3.15.0",
"pytest-rerunfailures>=14.0",
# Required by tests/test_parser_malformed.py — property-based tests that
# feed pathological input to the tree-sitter language adapters. Without
# this dep, the file errors at collection time and pytest-rerunfailures
# spins on it, costing real seconds per suite run.
"hypothesis>=6.0.0",
]