-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpyproject.toml
More file actions
162 lines (148 loc) · 4.98 KB
/
Copy pathpyproject.toml
File metadata and controls
162 lines (148 loc) · 4.98 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
[build-system]
requires = ["setuptools>=69.0", "wheel"]
build-backend = "setuptools.build_meta"
[project]
name = "accellens"
version = "0.1.3-alpha"
description = "Accellens AI Accessibility Compliance Platform"
readme = "README.md"
requires-python = ">=3.13"
license = { text = "MIT" }
authors = [
{ name = "Tridention", email = "info@tridention.com" }
]
classifiers = [
"Development Status :: 4 - Beta",
"Intended Audience :: Developers",
"Programming Language :: Python :: 3.13",
"Typing :: Typed",
]
dependencies = [
"fastapi>=0.135.3",
"uvicorn[standard]>=0.44.0",
"pydantic>=2.13.0",
"prometheus-client>=0.25.0",
"opentelemetry-sdk>=1.41.0",
"opentelemetry-exporter-otlp-proto-grpc>=1.41.0",
"opentelemetry-instrumentation-fastapi>=0.46b0",
"opentelemetry-instrumentation-celery>=0.46b0",
"filelock>=3.25.2",
]
[project.optional-dependencies]
dev = [
"ruff>=0.9.0",
"mypy>=1.19.1",
"pytest>=9.0.3",
"pytest-cov>=7.0.0",
"pytest-asyncio>=1.3.0",
"pytest-mock>=3.14.0",
"pytest-xdist>=3.6.0",
"aiofiles>=23.2.1",
"pre-commit>=4.4.0",
"detect-secrets>=1.5.0",
"bandit[toml]>=1.7.0",
"types-requests>=2.31.0",
"types-PyYAML>=6.0.12",
"types-passlib>=1.7.6",
]
[tool.ruff.lint]
# Enable Pyflakes (F), pycodestyle (E, W), isort (I), and more
select = ["F", "E", "W", "I", "N", "UP", "B", "A", "C4", "T20", "RET", "SIM", "ARG", "PTH", "PL", "RUF"]
ignore = [
"E501", # Line length handled by formatter
"PLR2004", # Magic value used in comparison
"E402", # Module level import not at top of file
"N802", # Function name should be lowercase (keeping for legacy reasons, consider fixing)
"N803", # Argument name should be lowercase (keeping for legacy reasons, consider fixing)
"N806", # Variable in function should be lowercase (keeping for legacy reasons, consider fixing)
"PLR0913", # Too many arguments to function call
"COM812", # Conflicts with formatter
"ISC001", # Conflicts with formatter
# Broad ignores for existing codebase state (Complexity & Style)
"PLC0415", # import should be at top-level (used for optional deps/circular)
"PLR0911", # Too many return statements
"PLR0912", # Too many branches
"PLR0915", # Too many statements
"PTH", # Use pathlib (codebase uses os.path heavily)
"ARG001", # Unused function argument
"ARG002", # Unused method argument
"A002", # Builtin shadowing (format, id, etc)
"RUF012", # Mutable class attributes
"SIM", # Simplify rules (restore broad ignore)
"PT", # Pytest style rules
"B904", # Raise from error
"B017", # Assert blind exception
"PLW2901", # Loop variable overwrite
]
[tool.ruff]
# Target version for the project
target-version = "py313"
line-length = 120
exclude = [
".git",
"__pycache__",
".venv",
"venv",
".mypy_cache",
".pytest_cache",
"build",
"dist",
]
[tool.ruff.lint.per-file-ignores]
"scripts/**/*.py" = ["T201", "RUF012", "ARG001", "PLC0415", "PLR0912", "PLR0915", "SIM102", "PTH123", "RUF001"] # Allow print, mutable class attributes, unused args, imports, complexity, nested ifs, paths, ambiguous chars in scripts
"**/tests/**/*.py" = ["S101", "S105", "S106", "PLR2004", "T201", "ARG", "PLC0415", "PTH123", "RUF012", "PLR0912", "PLR0915", "SIM102"] # Allow assert, magic values, print, various noise in tests
"**/{fastapi,app}/**/*.py" = ["B008"] # Allow B008 (function call in default arg) for FastAPI Depends
[tool.ruff.lint.isort]
known-first-party = ["accellens"]
known-third-party = ["fastapi", "pydantic", "sqlalchemy", "celery"]
[tool.ruff.format]
quote-style = "double"
indent-style = "space"
skip-magic-trailing-comma = false
line-ending = "auto"
[tool.uv]
managed = true
package = false
# Mypy configuration is in apps/services/pyproject.toml
# This avoids conflicts when mypy is run from different directories
[tool.pytest.ini_options]
testpaths = ["tests"]
python_files = ["test_*.py", "*_test.py"]
python_classes = ["Test*"]
python_functions = ["test_*"]
asyncio_mode = "auto"
asyncio_default_fixture_loop_scope = "function"
pythonpath = ["apps/services"]
addopts = [
"--strict-markers",
"--strict-config",
]
# Parallel execution: use auto-detect for local, 2 workers for CI
# Can be overridden with -n flag: pytest -n auto (local) or pytest -n 2 (CI)
# For CI, set PYTEST_XDIST_WORKERS env var or use -n flag
markers = [
"unit: Unit tests",
"integration: Integration tests",
"contract: Contract tests (Gateway <-> Services)",
"e2e: End-to-end tests",
"security: Security regression tests (RBAC, tenancy, hardening)",
]
[tool.coverage.run]
source = ["apps/services"]
omit = [
"*/tests/*",
"*/test_*.py",
"*/__pycache__/*",
"*/venv/*",
"*/.venv/*",
]
[tool.coverage.report]
exclude_lines = [
"pragma: no cover",
"def __repr__",
"raise AssertionError",
"raise NotImplementedError",
"if __name__ == .__main__.:",
"if TYPE_CHECKING:",
"@abstractmethod",
]