-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpyproject.toml
More file actions
137 lines (122 loc) · 4.05 KB
/
Copy pathpyproject.toml
File metadata and controls
137 lines (122 loc) · 4.05 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
[project]
name = "regrails"
version = "0.4.0"
description = "Codify US federal regulations (FERPA + Title IV) into machine-readable rules with verbatim-text faithfulness gates, risk-tiered AI guardrails, and an MCP server. Proof-of-concept."
readme = "README.md"
requires-python = ">=3.12"
license = { text = "Apache-2.0" }
authors = [{ name = "Allen Byrd", email = "allen@allenfbyrd.com" }]
keywords = [
"ferpa",
"policy-as-code",
"regulation-as-code",
"ai-governance",
"compliance",
"guardrails",
"higher-education",
"edtech",
]
classifiers = [
"Development Status :: 3 - Alpha",
"Intended Audience :: Developers",
"Intended Audience :: Education",
"Intended Audience :: Legal Industry",
"License :: OSI Approved :: Apache Software License",
"Operating System :: OS Independent",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Topic :: Software Development :: Libraries :: Python Modules",
"Typing :: Typed",
]
dependencies = [
"pydantic>=2.9.0",
"typer>=0.15.0",
"httpx>=0.27.0",
"pyyaml>=6.0.0",
"mcp[cli]>=1.10.0",
]
[project.optional-dependencies]
dev = [
"pytest>=8.0.0",
"pytest-cov>=5.0.0",
"ruff>=0.7.0",
"mypy>=1.13.0",
"types-pyyaml>=6.0.0",
]
bench = [
"huggingface-hub>=0.24",
]
[project.scripts]
regrails = "regrails.cli.main:app"
regrails-mcp = "regrails.mcp_server:serve"
[project.urls]
Homepage = "https://github.com/Polycentric-Labs/regrails"
Repository = "https://github.com/Polycentric-Labs/regrails"
Issues = "https://github.com/Polycentric-Labs/regrails/issues"
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"
[tool.hatch.build.targets.wheel]
packages = ["src/regrails"]
[tool.hatch.build.targets.wheel.force-include]
"data/cfr" = "regrails/data/cfr"
"data/encoded" = "regrails/data/encoded"
[tool.pytest.ini_options]
testpaths = ["tests"]
python_files = ["test_*.py"]
addopts = ["-ra", "--strict-markers", "--strict-config", "-m", "not live"]
markers = ["live: exercises live LLM APIs; excluded from the default run and CI"]
[tool.coverage.run]
source = ["src/regrails"]
branch = true
[tool.coverage.report]
exclude_lines = [
"pragma: no cover",
"raise NotImplementedError",
"if __name__ == .__main__.:",
"if TYPE_CHECKING:",
]
[tool.ruff]
line-length = 110
target-version = "py312"
src = ["src", "tests"]
[tool.ruff.lint]
select = ["E", "F", "W", "I", "B", "UP", "S", "A", "C4", "DTZ", "T20", "RET", "SIM"]
# S101: allow assert. UP042: `class X(str, Enum)` is the deliberate Evidentia pattern
# for grep-friendly, JSON-stable string enums (StrEnum would change repr semantics).
ignore = ["S101", "UP042"]
[tool.ruff.lint.per-file-ignores]
# B008: Typer's idiomatic pattern is `typer.Option(...)` in defaults — false positive
"src/regrails/cli/*" = ["B008"]
# A002: Pydantic models routinely use `id` as a field name — not a builtin shadow concern
"src/regrails/models.py" = ["A002"]
# E501: these modules embed long doc/HTML template lines
"src/regrails/report.py" = ["E501"]
"src/regrails/bench/report.py" = ["E501"]
# T201: the demo's job IS to print the decision table to stdout
"src/regrails/demo.py" = ["T201"]
# T201: scripts are CLIs that legitimately print status to stdout
"scripts/*" = ["T201"]
# S105/S106: hard-coded "secrets" in test fixtures are obviously fake; SIM117: nested
# context managers in pytest patterns are clearer than combined
"tests/*" = ["S105", "S106", "SIM117"]
[tool.mypy]
python_version = "3.12"
strict = true
warn_unused_configs = true
disallow_untyped_defs = true
no_implicit_optional = true
warn_redundant_casts = true
warn_unused_ignores = true
warn_return_any = true
files = ["src/regrails", "tests"]
[[tool.mypy.overrides]]
module = "tests.*"
disallow_untyped_defs = false
[[tool.mypy.overrides]]
# web/api/{decide,verify,reply}.py are standalone Vercel functions, imported via
# sys.path shims in their tests; mypy resolves them by bare module name and can't
# locate them. The modules themselves are type-checked directly (MYPYPATH=src)
# during the web build.
module = ["decide", "verify", "reply"]
ignore_missing_imports = true