-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpyproject.toml
More file actions
130 lines (120 loc) · 5.19 KB
/
Copy pathpyproject.toml
File metadata and controls
130 lines (120 loc) · 5.19 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
[tool.poetry]
name = "ghosthunter"
version = "1.0.8"
description = "Investigate WHY your cloud costs spiked — dual-model (Claude Opus + Sonnet) root-cause analysis for GCP and AWS."
authors = ["MatrixGard <avinash@matrixgard.com>"]
maintainers = ["MatrixGard <avinash@matrixgard.com>"]
license = "AGPL-3.0-or-later"
readme = "README.md"
homepage = "https://github.com/avinash-matrixgard/ghosthunter"
repository = "https://github.com/avinash-matrixgard/ghosthunter"
documentation = "https://github.com/avinash-matrixgard/ghosthunter#readme"
keywords = [
"finops",
"cloud-cost",
"cost-optimization",
"root-cause-analysis",
"gcp",
"aws",
"anthropic",
"claude",
"llm",
"devops",
"sre",
]
classifiers = [
"Development Status :: 5 - Production/Stable",
"Environment :: Console",
"Intended Audience :: System Administrators",
"Intended Audience :: Developers",
"License :: OSI Approved :: GNU Affero General Public License v3 or later (AGPLv3+)",
"Operating System :: POSIX :: Linux",
"Operating System :: MacOS :: MacOS X",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Topic :: System :: Systems Administration",
"Topic :: System :: Monitoring",
"Topic :: Security",
]
packages = [{include = "ghosthunter", from = "src"}]
[tool.poetry.urls]
"Bug Tracker" = "https://github.com/avinash-matrixgard/ghosthunter/issues"
"Changelog" = "https://github.com/avinash-matrixgard/ghosthunter/blob/main/CHANGELOG.md"
"Security Policy" = "https://github.com/avinash-matrixgard/ghosthunter/blob/main/SECURITY.md"
[tool.poetry.dependencies]
python = "^3.12"
# Lower bounds reflect what the code was developed against; upper bounds
# left open so editable installs don't downgrade newer versions already
# in the venv. Typer <0.15 + Click >=8.3 is a broken pairing (Click 8.3
# dropped the positional `ctx` arg from Parameter.make_metavar which
# Typer 0.12 still assumed) — pin typer >=0.15 to pick up the fix.
anthropic = ">=0.40.0"
typer = {extras = ["all"], version = ">=0.15.0"}
rich = ">=13.7.0"
# GCP is the default active-mode provider. Optional in practice — advisor
# mode (the default) doesn't import google-cloud-* so installs without
# them work for paranoid-mode users.
google-cloud-bigquery = {version = "^3.25.0", optional = true}
google-cloud-logging = {version = "^3.10.0", optional = true}
# AWS active mode needs boto3. Advisor mode with CE CSVs does NOT —
# that's why boto3 is an extra, not a hard dependency.
boto3 = {version = "^1.34.0", optional = true}
pydantic = "^2.7.0"
tomli = "^2.0.0"
tomli-w = "^1.0.0"
# prompt_toolkit powers the chat REPL (src/ghosthunter/chat_io.py) and
# the advisor mode prompt session. Required at import time, not optional.
prompt_toolkit = "^3.0.0"
[tool.poetry.extras]
# `pip install ghosthunter[gcp]` pulls in GCP active-mode deps.
gcp = ["google-cloud-bigquery", "google-cloud-logging"]
# `pip install ghosthunter[aws]` pulls in boto3 for AWS active mode.
aws = ["boto3"]
# `pip install ghosthunter[all]` — both providers' active modes.
all = ["google-cloud-bigquery", "google-cloud-logging", "boto3"]
[tool.poetry.group.dev.dependencies]
# pytest >= 9.0.3 fixes GHSA-6w46-j5rx-g56g (tmpdir handling vuln,
# medium severity, dev-only). Pre-9.0.3 versions fail pip-audit CI.
pytest = "^9.0.3"
# pytest-asyncio < 1.0 has incompatible collector hooks for pytest 9
# (`'Package' object has no attribute 'obj'`). 1.0+ adds proper support.
pytest-asyncio = "^1.0.0"
ruff = "^0.4.0"
[tool.poetry.scripts]
ghosthunter = "ghosthunter.cli:app"
[tool.pytest.ini_options]
# Confine test discovery to the canonical tests/ directory. Without
# this, pytest walks subdirectories like ``ghosthunter/`` (which users
# sometimes create when cloning the repo as a submodule / fresh
# checkout alongside this one) and fails with "import file mismatch"
# collection errors for the duplicated test modules.
testpaths = ["tests"]
# Keep asyncio explicit so pytest-asyncio doesn't warn on default-mode
# deprecations between releases.
asyncio_mode = "strict"
[tool.ruff]
target-version = "py312"
line-length = 100
[tool.ruff.lint]
# Default rule set is fine; we add small targeted ignores for accepted
# Python patterns the default rules over-flag.
select = ["E", "F", "W", "I"]
# E501 = line-too-long: handled by formatter, allow-long for now.
# E203 = whitespace before ':' — incompatible with PEP 8 + Black/ruff format.
ignore = ["E501", "E203"]
[tool.ruff.lint.per-file-ignores]
# Tests use accepted shortcuts:
# E402 (module-level import not at top): test fixtures sometimes
# declare classes inline before importing the system-under-test.
# E701 (multiple statements on one line): inline `class X: pass`
# exception-stub style is the readable test pattern.
# E731 (lambda): one-line monkeypatch fixtures are clearer as lambdas.
"tests/*.py" = ["E402", "E701", "E731"]
# investigator.py and a few providers use a deliberate import-after-const
# pattern (constants and try/except optional-imports interleaved with
# imports). Permitted there only.
"src/ghosthunter/investigator.py" = ["E402"]
[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"