|
| 1 | +# ============================================================================ |
| 2 | +# DigiScript Server - Python Project Configuration |
| 3 | +# ============================================================================ |
| 4 | +# This file consolidates configuration for all Python development tools. |
| 5 | +# Dependencies are dynamically read from requirements.txt files. |
| 6 | +# ============================================================================ |
| 7 | + |
| 8 | +[build-system] |
| 9 | +requires = ["setuptools>=61.0"] |
| 10 | +build-backend = "setuptools.build_meta" |
| 11 | + |
| 12 | +[project] |
| 13 | +name = "digiscript-server" |
| 14 | +version = "0.1.0" |
| 15 | +description = "DigiScript server - Digital script management for theatrical shows" |
| 16 | +readme = "../README.md" |
| 17 | +requires-python = ">=3.13" |
| 18 | +# Dependencies are dynamically loaded from requirements.txt |
| 19 | +dynamic = ["dependencies", "optional-dependencies"] |
| 20 | + |
| 21 | +[tool.setuptools.dynamic] |
| 22 | +dependencies = {file = ["requirements.txt"]} |
| 23 | +optional-dependencies.test = {file = ["test_requirements.txt"]} |
| 24 | + |
| 25 | +# ============================================================================ |
| 26 | +# PYTEST CONFIGURATION |
| 27 | +# ============================================================================ |
| 28 | +[tool.pytest.ini_options] |
| 29 | +# Add the server directory to Python path so imports work correctly |
| 30 | +# This allows running `pytest` directly instead of `python -m pytest` |
| 31 | +pythonpath = ["."] |
| 32 | + |
| 33 | +# Test discovery patterns |
| 34 | +testpaths = ["test"] |
| 35 | +python_files = ["test_*.py"] |
| 36 | +python_classes = ["Test*"] |
| 37 | +python_functions = ["test_*"] |
| 38 | + |
| 39 | +# Asyncio configuration for pytest-asyncio |
| 40 | +asyncio_mode = "auto" |
| 41 | +asyncio_default_fixture_loop_scope = "function" |
| 42 | + |
| 43 | +# Output options |
| 44 | +addopts = [ |
| 45 | + "-v", # Verbose output |
| 46 | + "--tb=short", # Shorter traceback format |
| 47 | + "--strict-markers", # Ensure all markers are defined |
| 48 | +] |
| 49 | + |
| 50 | +# Markers |
| 51 | +markers = [ |
| 52 | + "asyncio: mark test as async", |
| 53 | +] |
| 54 | + |
| 55 | +# ============================================================================ |
| 56 | +# BLACK CONFIGURATION |
| 57 | +# ============================================================================ |
| 58 | +[tool.black] |
| 59 | +# Use Black's default line-length of 88 to match existing codebase formatting |
| 60 | +line-length = 88 |
| 61 | +target-version = ['py313'] |
| 62 | +include = '\.pyi?$' |
| 63 | +extend-exclude = ''' |
| 64 | +/( |
| 65 | + # Exclude alembic migrations |
| 66 | + | alembic_config/versions |
| 67 | +)/ |
| 68 | +''' |
| 69 | + |
| 70 | +# ============================================================================ |
| 71 | +# ISORT CONFIGURATION |
| 72 | +# ============================================================================ |
| 73 | +[tool.isort] |
| 74 | +profile = "black" |
| 75 | +# Match Black's line length of 88 |
| 76 | +line_length = 88 |
| 77 | +skip_gitignore = true |
| 78 | +extend_skip = ["alembic_config/versions"] |
| 79 | +known_first_party = ["digi_server", "models", "controllers", "utils", "schemas", "rbac", "registry"] |
| 80 | + |
| 81 | +# ============================================================================ |
| 82 | +# PYLINT CONFIGURATION |
| 83 | +# ============================================================================ |
| 84 | +[tool.pylint.main] |
| 85 | +# Add current directory to path for imports |
| 86 | +init-hook = "from pylint.config import find_default_config_files; import sys; sys.path.append(next(find_default_config_files()).parent.as_posix())" |
| 87 | + |
| 88 | +# Ignore patterns |
| 89 | +ignore-paths = [ |
| 90 | + "^alembic_config/.*$", |
| 91 | + "^test/.*$", |
| 92 | +] |
| 93 | + |
| 94 | +[tool.pylint."messages control"] |
| 95 | +disable = [ |
| 96 | + "logging-fstring-interpolation", |
| 97 | + "missing-module-docstring", |
| 98 | + "missing-class-docstring", |
| 99 | + "missing-function-docstring", |
| 100 | + "too-few-public-methods", |
| 101 | + "duplicate-code", |
| 102 | + "too-many-return-statements", |
| 103 | + "too-many-branches", |
| 104 | + "too-many-statements", |
| 105 | + "unnecessary-lambda", |
| 106 | + "too-many-locals", |
| 107 | + "too-many-nested-blocks", |
| 108 | + "too-many-arguments", |
| 109 | + "unnecessary-dunder-call", |
| 110 | + "broad-exception-raised", |
| 111 | + "broad-exception-caught", |
| 112 | + "fixme", |
| 113 | +] |
| 114 | + |
| 115 | +[tool.pylint.format] |
| 116 | +# Note: Pylint's max-line-length is 120 but Black enforces 88 |
| 117 | +# This is intentional - Pylint checks logic, Black formats code |
| 118 | +max-line-length = 120 |
| 119 | + |
| 120 | +[tool.pylint.design] |
| 121 | +max-args = 15 |
| 122 | +max-locals = 20 |
| 123 | +max-returns = 20 |
| 124 | +max-branches = 20 |
| 125 | +max-statements = 50 |
| 126 | +max-attributes = 20 |
| 127 | +max-positional-arguments = 15 |
0 commit comments