Repository navigation
Expand file tree
/
Copy pathpyproject.toml
More file actions
98 lines (83 loc) · 2.81 KB
/
Copy pathpyproject.toml
File metadata and controls
98 lines (83 loc) · 2.81 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
[project]
name = "perplexity-agent"
version = "0.4.3"
description = "A simple, security-hardened MCP server exposing the Perplexity Search + Sonar APIs to AI agents (Claude Code, Hermes)."
readme = "README.md"
requires-python = ">=3.11"
license = { text = "MIT" }
authors = [{ name = "CryptoJones" }]
keywords = ["mcp", "perplexity", "sonar", "research", "agent", "llm"]
# Dependencies are pinned with compatible-release bounds; uv.lock fully locks them.
# (NSA recommendation: choose supported projects, pin dependencies, track vulns.)
dependencies = [
"mcp>=2.0.0,<3.0",
"httpx>=0.28.1,<0.29.0",
"pydantic>=2.13.0,<3.0.0",
"pydantic-settings>=2.14.2,<3.0.0",
]
[project.optional-dependencies]
dev = [
"pytest>=9.1.1",
"pytest-asyncio>=1.4.0",
"pytest-cov>=6.0.0",
"respx>=0.23.1",
"pip-audit>=2.10.1",
"mypy>=2.3.0",
"ruff>=0.16.0",
]
# Interactive terminal UI (`perplexity-agent tui`). Optional so the core MCP
# server install stays lean; httpx is already a core dependency.
tui = [
"textual>=8.2.8,<9.0.0",
"selectolax>=0.4.11,<1.1",
]
[project.scripts]
perplexity-agent = "perplexity_agent.__main__:main"
[project.urls]
Homepage = "https://codeberg.org/CryptoJones/PerplexityAgent"
Mirror = "https://github.com/CryptoJones/PerplexityAgent"
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"
[tool.hatch.build.targets.wheel]
packages = ["src/perplexity_agent"]
[tool.pytest.ini_options]
asyncio_mode = "auto"
testpaths = ["tests"]
[tool.coverage.run]
branch = true
source = ["perplexity_agent"]
[tool.coverage.report]
# CI gates on this. Entrypoint glue (__main__ HTTP wiring) is exercised manually,
# not in unit tests, so the bar is set below 100% deliberately.
fail_under = 85
show_missing = true
exclude_lines = [
"pragma: no cover",
"if __name__ == .__main__.:",
"raise NotImplementedError",
]
[tool.mypy]
python_version = "3.11"
strict = true
# MCPServer only recognizes a tool's Context parameter when it's annotated as the
# bare `Context` — its find_context_parameter() ignores `Context[...]` generic
# args, so parameterizing it (to satisfy disallow_any_generics) would silently
# break context injection. server.py keeps the bare form; relax that one flag here.
[[tool.mypy.overrides]]
module = "perplexity_agent.server"
disallow_any_generics = false
# selectolax (optional `tui` extra) ships no type stubs.
[[tool.mypy.overrides]]
module = "selectolax.*"
ignore_missing_imports = true
[tool.ruff]
line-length = 100
target-version = "py311"
[tool.ruff.lint]
select = ["E", "F", "I", "B", "UP", "S"]
# S101 (assert) is fine in tests; handled per-file below.
[tool.ruff.lint.per-file-ignores]
# S101 asserts, S105/S106 "hardcoded password" false-positives on test fixtures,
# SLF001 private-attr access in tests.
"tests/*" = ["S101", "S105", "S106", "SLF001"]