-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpyproject.toml
More file actions
193 lines (178 loc) · 7.25 KB
/
Copy pathpyproject.toml
File metadata and controls
193 lines (178 loc) · 7.25 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
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
[project]
name = "ai-cli-utils"
version = "0.8.0"
description = "Unified AI session manager for Claude Code and Gemini CLI"
readme = "README.md"
license = "MIT"
requires-python = ">=3.11"
authors = [
{ name = "AI CLI Utils Contributors" },
]
keywords = ["ai", "cli", "claude", "gemini", "tmux", "mosh", "developer-tools"]
classifiers = [
"Development Status :: 3 - Alpha",
"Environment :: Console",
"Intended Audience :: Developers",
"License :: OSI Approved :: MIT License",
"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 :: System :: Systems Administration",
"Topic :: Utilities",
"Typing :: Typed",
]
dependencies = [
"click>=8.1",
"nats-py>=2.9.0",
"circus>=0.18.0",
"libtmux>=0.30.0",
"watchdog>=4.0.0",
"pyyaml>=6.0",
"pillow>=12.3.0",
"portalocker>=2.0",
"psutil>=5.9",
"pydantic>=2.13.3",
# Windows has no system IANA timezone database; zoneinfo.ZoneInfo() raises
# ZoneInfoNotFoundError without it, breaking offset-aware datetime parsing
# in quota reset-time handling (AI-CLI-6ibt).
"tzdata>=2025.2; sys_platform == 'win32'",
]
[tool.uv]
# Tornado is supplied transitively by circus; retain a patched floor for that dependency.
constraint-dependencies = ["tornado>=6.5.7"]
[project.urls]
Homepage = "https://github.com/sergeiwallace/ai-cli-utils" # public-hygiene: allow
Repository = "https://github.com/sergeiwallace/ai-cli-utils" # public-hygiene: allow
Changelog = "https://github.com/sergeiwallace/ai-cli-utils/blob/main/CHANGELOG.md" # public-hygiene: allow
Issues = "https://github.com/sergeiwallace/ai-cli-utils/issues" # public-hygiene: allow
[project.scripts]
ai = "ai_cli.main:cli"
[tool.ai-cli]
task_prefix = "AI-CLI"
project_type = "tool"
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"
[tool.hatch.build.targets.wheel]
packages = ["src/ai_cli"]
artifacts = ["src/ai_cli/data/**"]
[tool.hatch.build.targets.sdist]
exclude = [".direnv", ".venv", ".worktrees"]
[project.optional-dependencies]
notify-win = ["plyer>=2.1"]
dev = [
"pytest>=8",
"pytest-cov>=5",
"pytest-xdist>=3",
"pytest-timeout>=2.4.0",
"ruff==0.16.5",
"pre-commit>=4",
]
# Optional, fleet-internal-only: structural containment for test-spawned
# processes. Sourced from a private repo, so it is deliberately NOT part of
# the "dev" extra above -- a public contributor must be able to
# `uv sync --extra dev` and run the full test suite without needing access
# to any private repository. See AI-CLI-qrkr.
internal-testkit = ["fleet-testkit"]
[dependency-groups]
dev = [
"pytest>=8",
"pytest-cov>=5",
"pytest-xdist>=3",
"ruff==0.16.5",
"pre-commit>=4",
"pytest-timeout>=2.4.0",
"pyright>=1.1.408",
"freezegun>=1.5",
"pytest-randomly>=4.1.0",
# Test-only: the LLM memory-merge tests mock google.genai.Client, and
# patch() needs the real module importable. Runtime keeps it optional —
# sync.py imports it lazily and degrades to a .conflict file without it.
"google-genai>=1.0",
]
# Optional, fleet-internal-only: see [project.optional-dependencies].internal-testkit above.
internal-testkit = ["fleet-testkit"]
[tool.pytest.ini_options]
testkit_enabled = false
# CORE-196: discard a passing test's tmp_path directory immediately, keeping only
# a failing one's -- the only case the directory is evidence. Complements (never
# substitutes for) conftest.py's `_make_tmp_path_deletable`: this policy controls
# WHETHER a delete is attempted, the fixture is what makes it succeed against
# git's read-only loose objects.
tmp_path_retention_policy = "failed"
pythonpath = ["src", "."]
testpaths = ["tests"]
addopts = "-n auto"
markers = [
"real_quota_scrape: test drives the real quota-scrape spawn functions (opts out of the conftest no-op; must mock subprocess.Popen itself)",
"real_tmux: test owns an isolated tmux socket and explicitly opts in to tmux subprocess calls",
"real_nats: test drives NATSClient.connect itself (opts out of the conftest connection block)",
]
[tool.uv.sources]
# Deliberately optional and fleet-internal-only -- see internal-testkit above. # public-hygiene: allow
fleet-testkit = { git = "https://github.com/sergeiwallace/ai-harness.git", rev = "1741cb32935f569dc47665c20102a16708e7d1fe", subdirectory = "packages/fleet-testkit" } # public-hygiene: allow
[tool.pyright]
pythonVersion = "3.11"
pythonPlatform = "Linux"
typeCheckingMode = "basic"
venvPath = "."
venv = ".venv"
include = ["src", "tests"]
extraPaths = ["src", "scripts"]
[tool.ruff]
line-length = 120
[tool.ruff.lint]
# Declared explicitly rather than inherited (BUG-006). These four prefixes were
# ruff's default select through 0.15.x, and are the rule set this repo has
# actually been linted against — the `ignore` entries below are all E7 codes,
# which only makes sense against this select. Ruff 0.16.0 redefined its default
# from these 59 rules to 413, silently importing 1075 findings from rule
# families (SIM, BLE, PLW, UP, S, I, …) the repo never opted into. Adopting any
# of those is deliberate, reviewed work — tracked separately, see AI-CLI-141 —
# not something a patch-level tool upgrade gets to decide.
select = [
# --- baseline (pre-0.16 default; keep) ---
"E4", # pycodestyle: imports
"E7", # pycodestyle: statement-level
"E9", # pycodestyle: runtime/IO errors
"F", # Pyflakes
# --- phase 1: mechanical hygiene, autofixable ---
"I", # isort
"UP", # pyupgrade
# --- phase 2: defect detection, cheap ---
"B", # flake8-bugbear
"C4", # flake8-comprehensions
"PIE", # flake8-pie
"RET", # flake8-return
"PLE", # Pylint errors (0 findings today; regression insurance)
# --- phase 3: Ruff-specific hygiene ---
"RUF", # incl. RUF100 unused-noqa
# --- phase 4: correctness-adjacent, small ---
"PTH", # flake8-use-pathlib (cross-platform paths)
"DTZ", # flake8-datetimez (naive datetimes)
"LOG", # flake8-logging
# --- phase 5a: one named rule, not its family ---
"PLW1510", # subprocess.run without explicit check= (real silent-failure class)
# --- phase 5b: named rules only, NOT their families ---
"SIM", # flake8-simplify (SIM117 excluded below)
"PT", # flake8-pytest-style
]
ignore = [
"E701", # multiple-statements-on-one-line (colon) — established compact style in main.py
"E702", # multiple-statements-on-one-line (semicolon) — established compact style in main.py
"E741", # ambiguous-variable-name — single-letter vars acceptable in comprehensions
"RUF001", # ambiguous-unicode-string — box-drawing/symbols in CLI output are intentional
"RUF002", # ambiguous-unicode-docstring — same
"RUF003", # ambiguous-unicode-comment — same
"SIM117", # multiple-with-statements — 375 findings, all stacked patch() in tests
]
[tool.ruff.lint.per-file-ignores]
"tests/**" = [
"RUF059", # unused unpacked variables in test setup
"SIM105", # contextlib.suppress rewrite adds no value in tests
"PT018", # composite assertions are readable here
"PT011", # broad pytest.raises accepted
]
"src/*/__init__.py" = ["F401"] # re-exports