-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathpyproject.toml
More file actions
149 lines (128 loc) · 4.74 KB
/
pyproject.toml
File metadata and controls
149 lines (128 loc) · 4.74 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
# ============================================================================
# DigiScript Server - Python Project Configuration
# ============================================================================
# This file consolidates configuration for all Python development tools.
# Dependencies are dynamically read from requirements.txt files.
# ============================================================================
[build-system]
requires = ["setuptools>=61.0"]
build-backend = "setuptools.build_meta"
[project]
name = "digiscript-server"
version = "0.24.2"
description = "DigiScript server - Digital script management for theatrical shows"
readme = "../README.md"
requires-python = ">=3.13"
# Dependencies are dynamically loaded from requirements.txt
dynamic = ["dependencies", "optional-dependencies"]
[tool.setuptools.dynamic]
dependencies = {file = ["requirements.txt"]}
optional-dependencies.test = {file = ["test_requirements.txt"]}
# ============================================================================
# PYTEST CONFIGURATION
# ============================================================================
[tool.pytest.ini_options]
# Add the server directory to Python path so imports work correctly
# This allows running `pytest` directly instead of `python -m pytest`
pythonpath = ["."]
# Test discovery patterns
testpaths = ["test"]
python_files = ["test_*.py"]
python_classes = ["Test*"]
python_functions = ["test_*"]
# Asyncio configuration for pytest-asyncio
asyncio_mode = "auto"
asyncio_default_fixture_loop_scope = "function"
# Output options
addopts = [
"-v", # Verbose output
"--tb=short", # Shorter traceback format
"--strict-markers", # Ensure all markers are defined
]
# Markers
markers = [
"asyncio: mark test as async",
]
# ============================================================================
# RUFF CONFIGURATION
# ============================================================================
# Ruff replaces black, isort, and pylint with a single, fast tool
# https://docs.astral.sh/ruff/
[tool.ruff]
# Same line length as black (88)
line-length = 88
target-version = "py313"
[tool.ruff.format]
# Use black-compatible formatting
quote-style = "double"
indent-style = "space"
skip-magic-trailing-comma = false
line-ending = "auto"
# Docstring formatting
docstring-code-format = false
docstring-code-line-length = "dynamic"
[tool.ruff.lint]
# Enable pycodestyle (E, W), Pyflakes (F), isort (I), and pylint-like rules (PL)
# Note: We only enable rules that match the original black/isort/pylint behavior
select = [
"E", # pycodestyle errors
"W", # pycodestyle warnings
"F", # Pyflakes
"I", # isort
"PL", # Pylint
]
# Ignore rules that match pylint's disabled checks
ignore = [
# Line length in comments (black doesn't enforce this)
"E501", # Line too long
# Documentation (pylint: missing-*-docstring)
"D100", # Missing docstring in public module
"D101", # Missing docstring in public class
"D102", # Missing docstring in public method
"D103", # Missing docstring in public function
"D104", # Missing docstring in public package
"D105", # Missing docstring in magic method
"D107", # Missing docstring in __init__
# Complexity rules (pylint: too-many-*)
"PLR0911", # Too many return statements
"PLR0912", # Too many branches
"PLR0913", # Too many arguments
"PLR0915", # Too many statements
"PLR0917", # Too many positional arguments
"PLR2004", # Magic value used in comparison
# Design (pylint: too-few-public-methods)
"PLR6301", # Method could be a function
# Other pylint equivalents
"PLE0604", # Invalid object in __all__
"PLW2901", # Redefined loop variable
"PLR1714", # Consider merging isinstance calls
"SIM102", # Use single if instead of nested
"SIM108", # Use ternary operator
"SIM114", # Combine if branches
"SIM115", # Use context manager
"SIM117", # Use single with statement
# Broad exceptions (pylint: broad-exception-*)
"BLE001", # Blind except Exception
"TRY002", # Create exception with error message
"TRY003", # Long exception messages
"EM101", # Exception string literal
"EM102", # Exception f-string
# Fixme comments
"FIX002", # Line contains TODO
"TD002", # Missing TODO author
"TD003", # Missing TODO link
]
[tool.ruff.lint.isort]
# Match isort configuration
known-first-party = ["digi_server", "models", "controllers", "utils", "schemas", "rbac", "registry"]
force-single-line = false
lines-after-imports = 2
[tool.ruff.lint.pylint]
# Match pylint design limits
max-args = 15
max-locals = 20
max-returns = 20
max-branches = 20
max-statements = 50
max-public-methods = 20
max-positional-args = 15