-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpyproject.toml
More file actions
240 lines (221 loc) · 7.76 KB
/
pyproject.toml
File metadata and controls
240 lines (221 loc) · 7.76 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
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
[build-system]
requires = ["setuptools>=61", "wheel"]
build-backend = "setuptools.build_meta"
[project]
name = "labtrust-gym"
version = "0.2.0"
description = "Multi-agent environment for hospital lab automation (PettingZoo/Gym style) with trust skeleton; first instance: pathology lab (blood sciences lane)."
readme = "README.md"
license = { text = "Apache-2.0" }
requires-python = ">=3.11"
authors = [{ name = "LabTrust-Gym contributors" }]
maintainers = [{ name = "LabTrust-Gym contributors" }]
keywords = [
"gym",
"multi-agent",
"hospital-lab",
"trust",
"policy",
"simulation",
"pettingzoo",
"gymnasium",
]
classifiers = [
"Development Status :: 4 - Beta",
"Intended Audience :: Science/Research",
"License :: OSI Approved :: Apache Software License",
"Operating System :: OS Independent",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Topic :: Scientific/Engineering",
"Topic :: Scientific/Engineering :: Artificial Intelligence",
]
dependencies = [
"pyyaml>=6.0",
"pydantic>=2.0",
"jsonschema>=4.0",
"networkx>=3.0",
"numpy>=1.24",
"cryptography>=46.0.5",
"python-dotenv>=1.0",
]
[project.urls]
Homepage = "https://github.com/fraware/LabTrust-Gym"
Documentation = "https://fraware.github.io/LabTrust-Gym/"
Repository = "https://github.com/fraware/LabTrust-Gym"
"Bug Tracker" = "https://github.com/fraware/LabTrust-Gym/issues"
[project.optional-dependencies]
dev = [
"pytest>=7.0",
"pytest-timeout>=2.0",
"pytest-cov>=4.0",
"ruff>=0.1",
"mypy>=1.0",
"types-PyYAML>=6.0",
"types-jsonschema>=4.0",
"hypothesis>=6.0",
]
# PettingZoo Parallel API wrapper; install with: pip install -e ".[env]"
env = ["pettingzoo>=1.24", "gymnasium>=0.29"]
# .env loading is now a default dependency; [dotenv] kept for backward compatibility (no extra deps).
dotenv = []
# Enhanced CLI output (Rich formatting, progress); install with: pip install -e ".[cli]"
cli = ["rich>=13.0.0"]
# Plotting pipeline for study outputs; install with: pip install -e ".[plots]"
plots = ["matplotlib>=3.7", "pillow>=12.1.1"]
# Full dev/reuse: env + marl + docs + plots to minimize test skips; install with: pip install -e ".[full]"
full = [
"pettingzoo>=1.24",
"gymnasium>=0.29",
"matplotlib>=3.7",
"pillow>=12.1.1",
"stable-baselines3>=2.0",
"mkdocs>=1.5",
"mkdocstrings[python]>=0.24",
]
# PPO/MARL baselines; install with: pip install -e ".[marl]"
marl = ["stable-baselines3>=2.0", "gymnasium>=0.29"]
# HPO for PPO (run_ppo_optuna); install with: pip install -e ".[marl,marl_hpo]"
marl_hpo = ["optuna>=3.0"]
# Documentation site; install with: pip install -e ".[docs]"
docs = ["mkdocs>=1.5", "mkdocstrings[python]>=0.24"]
# Live OpenAI backend (Structured Outputs); install with: pip install -e ".[llm_openai]"
# Base install remains unchanged; no network calls without this extra.
llm_openai = ["openai>=1.40", "urllib3>=2.6.3"]
# Live Anthropic backend; install with: pip install -e ".[llm_anthropic]"
llm_anthropic = ["anthropic>=0.39", "urllib3>=2.6.3"]
# Prime Intellect Inference (OpenAI-compatible client to api.pinference.ai); pip install -e ".[llm_prime_intellect]"
llm_prime_intellect = ["openai>=1.40", "urllib3>=2.6.3"]
# Online serve mode (rate limiting, auth, etc.); stdlib-only by default; add deps here if needed
online = []
# OpenTelemetry OTLP export for LLM traces; install with: pip install -e ".[otel]"
otel = ["opentelemetry-api>=1.20", "opentelemetry-sdk>=1.20", "opentelemetry-exporter-otlp-proto-http>=1.20"]
# MAPF/TAPF solvers (CBS, ECBS, LNS, RHCR); WHCA remains default when not installed
mapf = []
# OR solvers (CP-SAT for ORScheduler when use_cp_sat in policy); optional
or_solver = ["ortools>=9.0"]
# Extension points: other packages may add entries to these groups.
# See docs/extension_development.md for contracts.
[project.entry-points."labtrust_gym.domains"]
[project.entry-points."labtrust_gym.coordination_methods"]
[project.entry-points."labtrust_gym.tasks"]
[project.entry-points."labtrust_gym.invariant_handlers"]
[project.entry-points."labtrust_gym.security_suite_providers"]
[project.entry-points."labtrust_gym.safety_case_providers"]
[project.entry-points."labtrust_gym.metrics_aggregators"]
[project.entry-points."labtrust_gym.benchmark_pack_loaders"]
[project.scripts]
labtrust = "labtrust_gym.cli.main:main"
[tool.setuptools.packages.find]
where = ["src"]
# Policy files (emits, schemas, zones, etc.). For release wheels, copy repo policy/ into src/labtrust_gym/policy before building.
[tool.setuptools.package-data]
labtrust_gym = ["policy/**"]
[tool.ruff]
target-version = "py311"
line-length = 120
[tool.ruff.lint]
select = ["E", "F", "I", "N", "W", "UP"]
ignore = [
"E501", # Line length 120: new code only; backlog incremental. See docs/reference/documentation_standards.md.
"E402", # Module level import not at top: intentional for lazy/conditional imports and sys.path setup.
"N802", # invalid-function-name: do_GET/do_POST etc. (stdlib BaseHTTPRequestHandler) only. See docs/reference/code_style_and_lint.md.
"N806", # non-lowercase-variable-in-function: constant-like names in function scope only. See docs/reference/code_style_and_lint.md.
"N818", # Exception name without Error suffix: existing exception names kept for API stability.
]
[tool.ruff.lint.per-file-ignores]
# Tests: allow unused variables (assertions/placeholders) and ambiguous names (e.g. loop var l).
"tests/**" = ["F841", "E741", "E731"]
[tool.ruff.format]
quote-style = "double"
[tool.mypy]
python_version = "3.11"
strict = true
warn_return_any = true
warn_unused_ignores = true
# Allow incremental cleanup: disable noisy codes that are widely present; re-enable as fixes land.
disable_error_code = [
"no-any-return",
"var-annotated",
"type-arg",
"attr-defined",
"assignment",
"arg-type",
"operator",
"index",
"return-value",
"union-attr",
"call-overload",
"list-item",
"type-var",
"unused-ignore",
"no-untyped-call",
"no-redef",
"misc",
"no-untyped-def",
"call-arg",
"comparison-overlap",
"truthy-function",
]
[[tool.mypy.overrides]]
module = [
"pettingzoo.*",
"pettingzoo",
]
ignore_missing_imports = true
[[tool.mypy.overrides]]
module = [
"opentelemetry.*",
"opentelemetry",
"z3",
"scipy.*",
"scipy",
"ortools.*",
"anthropic",
"networkx.*",
"networkx",
"tqdm",
"optuna.*",
"optuna",
]
ignore_missing_imports = true
[[tool.mypy.overrides]]
module = [
"rich",
"rich.*",
"openai",
"dotenv",
"python-dotenv",
]
ignore_missing_imports = true
[[tool.mypy.overrides]]
module = [
"matplotlib",
"matplotlib.*",
"gymnasium",
"gymnasium.*",
"stable_baselines3",
"stable_baselines3.*",
]
ignore_missing_imports = true
[tool.coverage.run]
source = ["src/labtrust_gym"]
branch = false
omit = ["*/tests/*", "*/test_*"]
[tool.coverage.report]
exclude_lines = ["pragma: no cover", "def __repr__", "raise NotImplementedError"]
# Coverage ratchet: PR-blocking. See docs/ci.md for cadence and target.
fail_under = 54
[tool.pytest.ini_options]
testpaths = ["tests"]
pythonpath = ["src", "."]
addopts = "-q --timeout=120"
markers = [
"metamorphic: metamorphic property tests (deterministic relations).",
"determinism: failure physics / determinism tests (seeded).",
"live: integration tests that call live APIs (require OPENAI_API_KEY, LABTRUST_RUN_LLM_LIVE=1).",
"security: security fuzz and property tests (injection points, no action outside allowed).",
"security_fuzz_stress: hypothesis-based security fuzz with higher max_examples (nightly); use --hypothesis-max-examples=500.",
"slow: long-running tests (golden suite, package-release, heavy CLI); exclude with -m 'not slow'.",
]