#
# drive package
#
[build-system]
requires = ["uv_build>=0.10.7,<0.11.0"]
build-backend = "uv_build"

[project]
name = "drive"
version = "0.17.0"
authors = [{ "name" = "DINUM", "email" = "dev@mail.numerique.gouv.fr" }]
classifiers = [
    "Development Status :: 5 - Production/Stable",
    "Framework :: Django",
    "Framework :: Django :: 5",
    "Intended Audience :: Developers",
    "License :: OSI Approved :: MIT License",
    "Natural Language :: English",
    "Programming Language :: Python :: 3",
    "Programming Language :: Python :: 3.13",
]
description = "An application managing files in a workspace."
keywords = ["Django", "Contacts", "Templates", "RBAC"]
license = "MIT"
requires-python = "~=3.13.0"
dependencies = [
    "boto3==1.42.59",
    "Brotli==1.2.0",
    "dj-database-url==3.1.2",
    "celery[redis]==5.6.2",
    "defusedxml==0.7.1",
    "django==5.2.13",
    "django-configurations==2.5.1",
    "django-cors-headers==4.9.0",
    "django-countries==8.2.0",
    "django-filter==25.2",
    "django-lasuite[all]==0.0.24",
    "django-ltree==0.6.0",
    "django-parler==2.3",
    "django-pydantic-field==0.5.4",
    "django-redis==6.0.0",
    "django-storages[s3]==1.14.6",
    "django-timezone-field>=5.1",
    "djangorestframework==3.16.1",
    "djangorestframework-api-key==3.1.0",
    "dockerflow==2026.1.26",
    "drf_spectacular==0.29.0",
    "drf-standardized-errors==0.15.0",
    "easy_thumbnails==2.10.1",
    "factory_boy==3.3.3",
    "gunicorn==25.1.0",
    "jsonschema==4.26.0",
    "markdown==3.10.2",
    "mozilla-django-oidc<5.0.0",
    "nested-multipart-parser==1.6.0",
    "posthog==7.9.4",
    "psycopg[binary]==3.3.3",
    "pydantic==2.12.5",
    "PyJWT==2.12.0",
    "python-magic==0.4.27",
    "redis<6.0.0",
    "requests==2.33.0",
    "sentry-sdk==2.53.0",
    "url-normalize==2.2.1",
    "whitenoise==6.12.0",
]

[project.urls]
"Bug Tracker" = "https://github.com/suitenumerique/drive/issues/new"
"Changelog" = "https://github.com/suitenumerique/drive/blob/main/CHANGELOG.md"
"Homepage" = "https://github.com/suitenumerique/drive"
"Repository" = "https://github.com/suitenumerique/drive"

[project.optional-dependencies]
dev = [
    "django-debug-toolbar==6.2.0",
    "django-extensions==4.1",
    "drf-spectacular-sidecar==2026.3.1",
    "freezegun==1.5.5",
    "ipdb==0.13.13",
    "ipython==9.10.0",
    "pyfakefs==6.1.3",
    "pylint-django==2.7.0",
    "pylint==4.0.5",
    "pytest-cov==7.0.0",
    "pytest-django==4.12.0",
    "pytest==9.0.3",
    "pytest-icdiff==0.9",
    "pytest-xdist==3.8.0",
    "responses==0.26.0",
    "ruff==0.15.4",
    "types-requests==2.32.4.20260107",
]

[tool.uv]
constraint-dependencies = [
    # Pin pillow above the version vulnerable to CVE-2026-40192
    # (FITS GZIP decompression bomb). Pulled transitively via
    # easy_thumbnails, which has no upper bound on pillow.
    "pillow>=12.2.0",
]

[tool.uv.build-backend]
module-root = ""
source-exclude = [
    "**/tests/**",
    "**/test_*.py",
    "**/tests.py",
]

[tool.ruff]
exclude = [
    ".git",
    ".venv",
    "build",
    "venv",
    "__pycache__",
    "*/migrations/*",
]
line-length = 100


[tool.ruff.lint]
ignore = ["DJ001", "PLR2004"]
select = [
    "B", # flake8-bugbear
    "BLE", # flake8-blind-except
    "C4", # flake8-comprehensions
    "DJ", # flake8-django
    "F",  # Pyflakes
    "I", # isort
    "PLC", # pylint-convention
    "PLE", # pylint-error
    "PLR", # pylint-refactoring
    "PLW", # pylint-warning
    "RUF100", # Ruff unused-noqa
    "RUF200", # Ruff check pyproject.toml
    "S", # flake8-bandit
    "SLF", # flake8-self
    "T20", # flake8-print
]

[tool.ruff.lint.isort]
section-order = ["future","standard-library","django","third-party","drive","first-party","local-folder"]
sections = { drive=["core", "wopi"], django=["django"] }
extra-standard-library = ["tomllib"]

[tool.ruff.lint.per-file-ignores]
"**/tests/*" = ["S", "SLF"]

[tool.pytest.ini_options]
addopts = [
    "-v",
    "--cov-report",
    "term-missing",
    # Allow test files to have the same name in different directories.
    "--import-mode=importlib",
]
python_files = [
    "test_*.py",
    "tests.py",
]
