#
# st-messages-mta-out package
#
[build-system]
requires = ["uv_build>=0.10.0,<0.11.0"]
build-backend = "uv_build"

[project]
name = "st-messages-mta-out"
version = "0.9.0"
authors = [{ "name" = "ANCT", "email" = "suiteterritoriale@anct.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.14",
]
description = "A stateless outgoing MTA."
keywords = ["Python", "MTA", "SMTP"]
license = "MIT"
readme = "README.md"
requires-python = ">=3.14.6,<4.0"
dependencies = [
    "Jinja2==3.1.6"
]

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

[project.optional-dependencies]
dev = [
    "pytest==8.3.5",
    "pytest-cov==6.0.0",
    "fastapi==0.115.12",
    "uvicorn==0.34.1",
    "requests==2.32.3",
    "PyJWT==2.10.1",
    "aiosmtpd==1.4.4",
    "ruff==0.9.3",
    "pylint==3.3.4",
    "types-requests==2.32.0.20241016",
]

[tool.uv.build-backend]
module-root = ""
source-include = ["etc/**"]
source-exclude = ["tests/**"]

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


[tool.ruff.lint]
ignore = ["DJ001", "PLR2004"]
select = [
    "B", # flake8-bugbear
    "BLE", # flake8-blind-except
    "C4", # flake8-comprehensions
    "DJ", # flake8-django
    "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
    "F"  # pyflakes
]

[tool.ruff.lint.isort]
section-order = ["future","standard-library","django","third-party","first-party","local-folder"]
sections = { 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",
]
