-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathpyproject.toml
More file actions
166 lines (152 loc) · 4.26 KB
/
pyproject.toml
File metadata and controls
166 lines (152 loc) · 4.26 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
[build-system]
requires = ["hatchling>=1.27.0"]
build-backend = "hatchling.build"
[project]
name = "promptfoo"
version = "0.1.4"
description = "Python wrapper for the promptfoo CLI - LLM testing, red teaming, and security evaluation"
authors = [
{ name = "Ian Webster", email = "ian@promptfoo.dev" },
]
license = { text = "MIT" }
readme = "README.md"
keywords = ["llm", "testing", "security", "red-team", "ai", "evaluation", "promptfoo"]
classifiers = [
"Development Status :: 4 - Beta",
"Intended Audience :: Developers",
"Topic :: Security",
"Topic :: Software Development :: Testing",
"Topic :: Scientific/Engineering :: Artificial Intelligence",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
]
requires-python = ">=3.9"
dependencies = [
"posthog>=3.0.0",
"pyyaml>=6.0.0",
]
[project.optional-dependencies]
dev = [
"pytest>=8.4.0",
"mypy>=1.16.0",
"pyright>=1.1.400",
"ruff>=0.12.0",
"types-pyyaml>=6.0.0",
]
[project.scripts]
promptfoo = "promptfoo.cli:main"
[project.urls]
Repository = "https://github.com/promptfoo/promptfoo-python"
Homepage = "https://www.promptfoo.dev"
Documentation = "https://www.promptfoo.dev/docs"
[tool.hatch.build.targets.sdist]
exclude = [
"/.github",
"/.gitignore",
"/.python-version",
"/.release-please-manifest.json",
"/release-please-config.json",
"/renovate.json",
"/uv.lock",
"/tests",
"/CHANGELOG.md",
"/AGENTS.md",
"/CLAUDE.md",
]
[tool.hatch.build.targets.wheel]
packages = ["src/promptfoo"]
[tool.ruff]
line-length = 120
target-version = "py39"
[tool.ruff.lint]
extend-select = [
"I", # isort
"W", # pycodestyle warnings
"E", # pycodestyle errors
"Q", # flake8-quotes
"UP", # pyupgrade
"B", # flake8-bugbear
"C4", # flake8-comprehensions
"SIM", # flake8-simplify
]
ignore = [
"COM812", # Trailing comma (conflicts with formatter)
]
[tool.ruff.format]
quote-style = "double"
[tool.mypy]
python_version = "3.9"
# Enable strict mode for comprehensive type checking
strict = true
# Additional strictness beyond --strict
warn_unreachable = true
enable_error_code = [
"ignore-without-code",
"redundant-cast",
"truthy-bool",
"truthy-iterable",
"unused-awaitable",
]
# Output formatting
show_error_codes = true
show_column_numbers = true
pretty = true
# Error handling
warn_unused_ignores = true
[[tool.mypy.overrides]]
module = "posthog.*"
ignore_missing_imports = true
[tool.pyright]
pythonVersion = "3.9"
pythonPlatform = "All"
typeCheckingMode = "strict"
include = ["src/promptfoo"]
exclude = ["tests", "**/__pycache__"]
# Report all errors in strict mode
reportMissingImports = true
reportMissingTypeStubs = false # Disable for posthog which lacks full stubs
reportUnusedImport = true
reportUnusedClass = true
reportUnusedFunction = true
reportUnusedVariable = true
reportDuplicateImport = true
reportPrivateUsage = true
reportConstantRedefinition = true
reportIncompatibleMethodOverride = true
reportIncompatibleVariableOverride = true
reportInconsistentConstructor = true
reportOverlappingOverload = true
reportUninitializedInstanceVariable = true
reportCallInDefaultInitializer = true
reportUnnecessaryIsInstance = true
reportUnnecessaryCast = true
reportUnnecessaryComparison = true
reportUnnecessaryContains = true
reportImplicitStringConcatenation = false
reportUnusedCallResult = false
reportUnusedExpression = true
reportUnnecessaryTypeIgnoreComment = false # Allow type: ignore for mypy compatibility
reportMatchNotExhaustive = true
# Relax some strict checks for third-party libraries without full stubs
reportUnknownMemberType = false
reportUnknownArgumentType = false
reportUnknownVariableType = false
reportUnknownParameterType = false
[tool.pytest.ini_options]
testpaths = ["tests"]
python_files = ["test_*.py"]
python_classes = ["Test*"]
python_functions = ["test_*"]
addopts = [
"-v",
"--strict-markers",
]
markers = [
"smoke: smoke tests that run the full CLI (slow, requires Node.js)",
]