-
Notifications
You must be signed in to change notification settings - Fork 30
Expand file tree
/
Copy pathpyproject.toml
More file actions
137 lines (124 loc) · 5.17 KB
/
Copy pathpyproject.toml
File metadata and controls
137 lines (124 loc) · 5.17 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
[build-system]
requires = ["setuptools>=61.0"]
build-backend = "setuptools.build_meta"
[project]
name = "bcbench"
version = "0.11.0"
description = "Benchmarking tool for Business Central (AL) ecosystem, inspired by SWE-Bench"
readme = "README.md"
requires-python = ">=3.13,<3.14"
license = {text = "MIT"}
authors = [
{name = "Microsoft Corporation"}
]
classifiers = ["Private :: Do Not Upload"]
dependencies = [
"jsonschema>=4.0",
"python-dotenv>=1.2.2",
"requests>=2.0",
"unidiff>=0.7",
"typer>=0.9.0",
"typing-extensions>=4.0",
"pyyaml>=6.0",
"pydantic>=2.0",
"textual>=7.0",
"numpy>=2.3.5",
"scipy>=1.16.3",
"jinja2>=3.1.6",
]
[project.scripts]
bcbench = "bcbench.cli:app"
[[tool.uv.index]]
name = "microsoft-cfs"
url = "https://packagefeedproxy.microsoft.io/pypi/simple"
default = true
[tool.setuptools.packages.find]
where = ["src"]
[tool.setuptools.package-data]
bcbench = ["agent/*.yaml", "agent/pr_review/scripts/*.ps1"]
[tool.pytest.ini_options]
testpaths = ["tests"]
addopts = ["-v", "--strict-markers", "-m", "not e2e"]
markers = [
"integration",
"e2e",
]
collect_imported_tests = false
[tool.ruff]
target-version = "py313"
line-length = 200
[tool.ruff.lint]
extend-select = [
# Restore the pyflakes/pycodestyle correctness rules that ruff 0.16 dropped from
# its default set (E711/E712/E713/E714/E721/E731/E741, F403/F405/F406/F722, etc.).
"E4", # pycodestyle: import placement (E401/E402)
"E7", # pycodestyle: statement/comparison lints (== None, lambda assignment, ...)
"F", # pyflakes: undefined names, star-import hazards, unused imports
"PLE", # Pylint errors (includes __all__ validation)
"PLW", # Pylint warnings (includes subprocess.run check requirement)
"I", # isort (import sorting)
"UP", # pyupgrade (modernize Python code)
"B", # flake8-bugbear (find likely bugs)
"SIM", # flake8-simplify (simplify code)
"C4", # flake8-comprehensions (better list/dict comprehensions)
"RET", # flake8-return (simplify return statements)
"PTH", # flake8-use-pathlib (prefer pathlib over os.path)
"RUF", # Ruff-specific rules
"TID", # flake8-tidy-imports (ban relative imports + extensible banned-API list)
"LOG", # flake8-logging: catch deprecated logging.warn, misuse of exception(), etc.
"G", # flake8-logging-format: catch string concat / % formatting in log calls
"TRY", # tryceratops: better exception handling
"PT", # flake8-pytest-style: consistent pytest patterns (~30 test files)
"ANN", # flake8-annotations: enforce type hints (we prefer strong typing)
"T20", # flake8-print: prefer logger over print (we have a proper logger)
"FURB", # refurb: modern Python idioms (e.g. x or y over x if x else y)
"ISC", # implicit string concat (catches missing comma in lists of strings)
"ICN", # import conventions (np, pd, plt aliases)
"PYI", # type stubs (no-op now, guard for future)
"SLOT", # require __slots__ on str/tuple/namedtuple subclasses
"ASYNC", # async best practices (no-op now, guard for future)
"PERF", # perflint: avoid needless per-iteration overhead (prefer extend/comprehensions)
"RSE", # flake8-raise: drop redundant parentheses on bare exception raises
"PGH", # pygrep-hooks: require codes on noqa/type-ignore comments (PGH003/PGH004)
"S307", # flake8-bandit: ban eval (was PGH001, which ruff removed in favour of this rule)
"DTZ", # flake8-datetimez: require timezone-aware datetime usage
"NPY", # NumPy-specific correctness and modernization checks
"PIE", # flake8-pie: miscellaneous correctness and simplification checks
]
ignore = [
# Deliberate style choices with many intentional violations; everything else is fixed in-tree
# (targeted `# noqa` with a rationale is preferred over adding entries here).
"G004", # logging-f-string: f-strings are more readable; perf cost is negligible (143 sites)
"TRY003", # raise-vanilla-args: forces a custom exception class for every error message (96 sites)
]
[tool.ruff.lint.flake8-tidy-imports]
ban-relative-imports = "all"
[tool.ruff.lint.flake8-tidy-imports.banned-api]
# Force sandboxed rendering:
"jinja2.Template".msg = "Use jinja2.sandbox.SandboxedEnvironment instead; the bare Template is not sandboxed."
"jinja2.Environment".msg = "Use jinja2.sandbox.SandboxedEnvironment instead; the bare Environment is not sandboxed."
[tool.ruff.lint.per-file-ignores]
"tests/**" = ["ANN"]
"notebooks/**" = ["ANN", "T20"] # notebooks routinely print() for analysis output
"src/bcbench/commands/**" = ["T20"] # CLI commands print user-facing output
"tools/**" = ["T20"] # standalone CLI scripts
[dependency-groups]
analysis = [
"ipykernel>=7.1.0",
"nbformat>=5.10.4",
"pandas>=2.3.3",
"plotly>=6.5.0",
]
dev = [
"pytest>=9.0.3",
"pytest-cov>=7.0",
"ruff>=0.16.0",
"pre-commit>=4.3.0",
"ty>=0.0.33",
]
# `bcbench redteam` only, and not in default-groups: azure-ai-evaluation[redteam] pulls in ~76
# packages (pyrit, transformers, datasets, ...) that no other command needs.
redteam = [
"azure-ai-evaluation[redteam]>=1.18.2",
"azure-identity>=1.25.3",
]