-
Notifications
You must be signed in to change notification settings - Fork 49
Expand file tree
/
Copy pathpyproject.toml
More file actions
179 lines (156 loc) · 5.88 KB
/
Copy pathpyproject.toml
File metadata and controls
179 lines (156 loc) · 5.88 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
[build-system]
requires = ["hatchling>=1.30.1", "hatch-vcs>=0.5.0", "setuptools-scm>=10"]
build-backend = "hatchling.build"
[project]
name = "RAMPART"
description = "A pytest-native safety testing framework for agentic AI applications"
dynamic = ["readme", "version"]
license = "MIT"
requires-python = ">=3.11"
authors = [
{ name = "Microsoft AI Red Team", email = "airedteam@microsoft.com" },
]
keywords = ["ai", "red-teaming", "safety", "security", "testing", "pytest", "agentic"]
classifiers = [
"Development Status :: 3 - Alpha",
"Framework :: Pytest",
"Intended Audience :: Developers",
"Operating System :: OS Independent",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Programming Language :: Python :: 3.14",
"Topic :: Security",
"Topic :: Software Development :: Testing",
]
dependencies = [
"jinja2>=3.1.6",
"pydantic>=2.13.4",
"pyrit==0.13.0",
"pytest>=9.0.3",
"pytest-asyncio>=1.3.0",
"pyyaml>=6.0.3",
"typing-extensions>=4.16; python_version < '3.12'",
]
[project.optional-dependencies]
onedrive = [
"msgraph-sdk>=1.57.0",
"azure-identity>=1.25.3"
]
[project.urls]
Homepage = "https://github.com/microsoft/RAMPART"
Repository = "https://github.com/microsoft/RAMPART"
Issues = "https://github.com/microsoft/RAMPART/issues"
[project.entry-points.pytest11]
rampart = "rampart.pytest_plugin.plugin"
[dependency-groups]
dev = [
"hatch-vcs>=0.5.0",
"hatchling>=1.30.1",
"pre-commit>=4.5.1",
"pytest-cov>=6.1.0",
"pytest-xdist[psutil]>=3.8.0",
"ruff>=0.16.0",
"ty>=0.0.56",
]
docs = [
"mkdocs>=1.6",
"mkdocs-material>=9.5",
"mkdocs-git-revision-date-localized-plugin>=1.5.2",
"mkdocstrings[python]>=1.0.4",
]
[tool.hatch.metadata.hooks.custom]
path = "scripts/hatch_build.py"
[tool.hatch.version]
source = "vcs"
[tool.hatch.version.raw-options]
version_scheme = "semver-pep440-release-branch"
local_scheme = "no-local-version"
[tool.hatch.build.targets.wheel]
packages = ["rampart"]
[tool.coverage.run]
source = ["rampart"]
omit = ["tests/*"]
[tool.coverage.report]
fail_under = 80
show_missing = true
skip_empty = true
[tool.pytest.ini_options]
pythonpath = ["scripts"]
asyncio_mode = "auto"
asyncio_default_fixture_loop_scope = "session"
markers = [
"harm(*categories): categorize test by harm type",
"trial(n=, threshold=): statistical repetition of a test",
"slow: marks tests that spawn subprocess pytest runs; deselect with -m 'not slow'",
]
filterwarnings = [
"ignore:.*invalid escape sequence:DeprecationWarning:.*confusables.*",
"ignore:.*invalid escape sequence:SyntaxWarning:.*confusables.*",
]
[tool.ruff.format]
exclude = [
"docs/**/*.md",
]
[tool.ruff.lint]
select = ["ALL"]
preview = true
ignore = [
"missing-trailing-comma", # May conflict with formatting, see https://docs.astral.sh/ruff/formatter/#conflicting-lint-rules
"docstring-extraneous-exception", # Allow extraneous exceptions in docstrings to deliberately document the caller-visible contract, even if they propagate from a delegated callee.
]
[tool.ruff.lint.per-file-ignores]
"scripts/hatch_build.py" = [
"implicit-namespace-package", # Top-level build hook
]
"tests/**" = [
"any-type", # no type annotations needed
"assert", # assert is pytest's API
"blind-except", # catching Exception in tests
"blocking-path-method-in-async-function", # pathlib in async tests
"builtin-open", # micro-optimizations / style
"compare-to-empty-string", # explicit `== ""` is intentional in assertions
"docstring-missing-exception", # docstring style doesn't add value for tests
"docstring-missing-returns",
"f-string-in-exception", # exception message style
"hardcoded-temp-file", # /tmp usage
"import-outside-top-level", # imports inside functions for isolation
"import-private-name", # importing private names is fine
"magic-value-comparison", # magic values in assertions are fine
"manual-list-comprehension",
"missing-return-type-private-function",
"missing-return-type-undocumented-public-function",
"missing-type-function-argument",
"no-self-use", # allow pytest fixtures in tests
"private-member-access", # testing private members is valid
"pytest-assert-in-except",
"pytest-composite-assertion", # assertion style
"raise-vanilla-args",
"raise-within-try", # raise in try blocks
"raw-string-in-exception",
"too-many-statements-in-try-clause", # try clause contains >5 statements
"undocumented-public-class",
"undocumented-public-init", # no docstrings needed
"undocumented-public-method",
"undocumented-public-module",
"undocumented-public-package",
"unnecessary-iterable-allocation-for-first-element",
"unused-function-argument",
"unused-method-argument", # unused args (fixtures, stubs)
]
[tool.ruff.lint.flake8-copyright]
notice-rgx = "Copyright \\(c\\) Microsoft Corporation\\.\\s*\\n.*Licensed under the MIT license"
[tool.ruff.lint.isort]
known-first-party = ["rampart"]
[tool.ruff.lint.pydocstyle]
convention = "google"
[tool.ruff.lint.pylint]
max-args = 10
[tool.ty.environment]
python-version = "3.11"
extra-paths = ["scripts"]
[tool.ty.src]
include = ["rampart", "tests", "scripts"]
[tool.uv.sources]
pyrit = { git = "https://github.com/microsoft/PyRIT", rev = "6dc8b94139757390286bbce7d53c1f7e58e66e29" } # v0.13.0