[project]
name = "cavaliba"
version = "4"
description = "www.cavaliba.com"
readme = "README.md"
requires-python = ">=3.12"
dependencies = [
    "babel>=2.18.0",
    "celery<5.7.0",
    "django<6.0.0",
    "django-redis>=6.0.0",
    "django-tinymce<3.7",
    "gunicorn>=25.1.0",
    "html2text>=2025.4.15",
    "mysqlclient>=2.2.8",
    "psycopg2>=2.9.11",
    "pyjwt>=2.12.1",
    "pyyaml<6.1",
    "requests>=2.32.5",
]

[tool.ruff]
line-length = 100
indent-width = 4
target-version = "py312"

exclude = [
    ".git",
    ".venv",
    "__pycache__",
    "build",
    "dist",
    "**/migrations/*.py",
    "**/app_template/*",
]

[tool.ruff.lint]
select = [
    "E",   # pycodestyle errors
    "W",   # pycodestyle warnings
    "F",   # pyflakes (unused imports, undefined names)
    "I",   # isort (import sorting)
    "B",   # flake8-bugbear (common bugs)
    "UP",  # pyupgrade (modern Python syntax)
    "DJ",  # flake8-django (Django-specific checks)
]
ignore = [
    "E501",  # line too long (handled by line-length above)
    "B008",  # do not perform function calls in default arguments
]

# Règles que --fix peut corriger automatiquement
fixable = ["ALL"]

# Allow unused variables when underscore-prefixed.
dummy-variable-rgx = "^(_+|(_+[a-zA-Z0-9_]*[a-zA-Z0-9]+?))$"


[tool.ruff.lint.per-file-ignores]
"*/migrations/*.py" = ["E501", "F401"]
"tests/*.py" = ["B", "F841"]

[tool.ruff.lint.isort]
#known-django = ["django"]
known-first-party = ["app_home", "app_user", "app_data", "app_sirene", "app_status", "app_ipam", "core"]
#section-order = ["future", "standard-library", "django", "third-party", "known-first-party", "local-folder"]



[tool.ruff.format]
# Like Black, use double quotes for strings.
quote-style = "double"

# Like Black, indent with spaces, rather than tabs.
indent-style = "space"

# Like Black, respect magic trailing commas.
skip-magic-trailing-comma = false

# Like Black, automatically detect the appropriate line ending.
line-ending = "auto"







[dependency-groups]
dev = [
    "django-debug-toolbar>=6.2.0",
    "mypy>=2.1.0",
    "ruff>=0.15.6",
]
