-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathpyproject.toml
More file actions
161 lines (143 loc) · 4.69 KB
/
Copy pathpyproject.toml
File metadata and controls
161 lines (143 loc) · 4.69 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
[build-system]
requires = ["hatchling", "hatch-vcs"]
build-backend = "hatchling.build"
[project]
name = "pyonyphe"
# Derived from the Git tag by hatch-vcs: tagging v3.0.1 builds 3.0.1, and
# v3.1.0rc1 builds a real pre-release. Never hardcode it here again.
dynamic = ["version"]
description = "Python client and CLI for the ONYPHE Cyber Defense Search Engine"
readme = "README.md"
requires-python = ">=3.10"
license = "MIT"
license-files = ["LICENSE"]
authors = [{ name = "Sebastien Larinier", email = "slarinier@gmail.com" }]
keywords = ["onyphe", "osint", "cti", "threat-intelligence", "asm", "search-engine"]
classifiers = [
"Development Status :: 5 - Production/Stable",
"Intended Audience :: Information Technology",
"Topic :: Security",
"Topic :: Internet",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Programming Language :: Python :: 3.14",
"Typing :: Typed",
]
dependencies = [
"httpx>=0.28",
"pydantic>=2.11",
"python-dotenv>=1.1",
"tomli>=2.0; python_version < '3.11'",
]
[project.optional-dependencies]
# Only `cli.py` imports typer and rich, so they do not belong to the library.
# Declaring them at runtime imposed rich>=14 on every consumer, which collides
# with pins such as censys==2.0.9 (rich<11) and made pyonyphe unresolvable in
# projects that merely import the client. typer is here too because it pulls
# rich in on its own.
cli = [
"rich>=14.0",
"typer>=0.16",
]
# SDK v2: `FastMCP` became `MCPServer` and the import paths moved, so the
# major is pinned rather than left open.
mcp = ["mcp>=2,<3"]
[project.urls]
Homepage = "https://github.com/onyphe/pyonyphe"
Repository = "https://github.com/onyphe/pyonyphe"
Issues = "https://github.com/onyphe/pyonyphe/issues"
Changelog = "https://github.com/onyphe/pyonyphe/blob/master/CHANGELOG.md"
[project.scripts]
pyonyphe = "pyonyphe.cli:main"
pyonyphe-mcp = "pyonyphe.mcp_server:main"
[dependency-groups]
dev = [
"pytest>=8.3",
"pytest-asyncio>=0.25",
"pytest-cov>=6.0",
"respx>=0.22",
"ruff>=0.12",
"ty>=0.0.50",
"zizmor>=1.28",
"pre-commit>=4.0",
"twine>=6.1",
# The MCP extra, so the server is importable in the test suite.
"mcp>=2,<3",
# The CLI extra, so the cli tests still run from a bare dev install.
"rich>=14.0",
"typer>=0.16",
# Not needed at runtime on 3.11+, but ty analyses against 3.10 and has to
# be able to resolve the fallback import in config.py.
"tomli>=2.0",
]
[tool.hatch.version]
source = "vcs"
[tool.hatch.build.targets.wheel]
packages = ["src/pyonyphe", "src/onyphe"]
[tool.hatch.build.targets.sdist]
include = ["src", "tests", "docs", "README.md", "LICENSE", "CHANGELOG.md"]
# ---------------------------------------------------------------------------
# ruff — lint + format
# ---------------------------------------------------------------------------
[tool.ruff]
line-length = 100
target-version = "py310"
src = ["src", "tests"]
[tool.ruff.lint]
select = [
"E", # pycodestyle errors
"W", # pycodestyle warnings
"F", # pyflakes
"I", # isort
"N", # pep8-naming
"UP", # pyupgrade
"B", # flake8-bugbear
"C4", # flake8-comprehensions
"SIM", # flake8-simplify
"TID", # flake8-tidy-imports
"PTH", # flake8-use-pathlib
"RUF", # ruff-specific
"ANN", # flake8-annotations
"S", # flake8-bandit
]
ignore = [
"ANN401", # allow typing.Any where the ONYPHE payload is genuinely untyped
"S101", # assert is fine in tests
]
[tool.ruff.lint.per-file-ignores]
"tests/**" = ["ANN", "S105", "S106"]
[tool.ruff.lint.isort]
known-first-party = ["pyonyphe"]
# ---------------------------------------------------------------------------
# ty — type checking (Astral)
# ---------------------------------------------------------------------------
[tool.ty.environment]
python-version = "3.10"
python = ".venv"
[tool.ty.src]
include = ["src", "tests"]
[tool.ty.terminal]
error-on-warning = true
# ---------------------------------------------------------------------------
# pytest
# ---------------------------------------------------------------------------
[tool.pytest.ini_options]
minversion = "8.0"
testpaths = ["tests"]
addopts = "--strict-markers --strict-config"
asyncio_mode = "auto"
markers = [
"integration: hits the real ONYPHE API, needs ONYPHE_API_KEY and burns credits (deselect with -m 'not integration')",
]
[tool.coverage.run]
source = ["src/pyonyphe"]
branch = true
[tool.coverage.report]
exclude_also = [
"if TYPE_CHECKING:",
"raise NotImplementedError",
"@overload",
]