[project]
name = "sse-starlette"
version = "3.4.1"
description = "SSE plugin for Starlette"
readme = "README.md"
license = "BSD-3-Clause"
requires-python = ">=3.10"
authors = [
    { name = "sysid", email = "sysid@gmx.de" },
]
classifiers = [
    "Development Status :: 5 - Production/Stable",
    "Environment :: Web Environment",
    "Intended Audience :: Developers",
    "Operating System :: OS Independent",
    "Programming Language :: Python :: 3",
    "Programming Language :: Python :: 3.10",
    "Programming Language :: Python :: 3.11",
    "Programming Language :: Python :: 3.12",
    "Programming Language :: Python :: 3.13",
    "Topic :: Internet :: WWW/HTTP",
]
dependencies = [
    "starlette>=0.49.1",
    "anyio>=4.7.0",
]

[project.optional-dependencies]
examples = [
    "uvicorn>=0.34.0",
    "fastapi>=0.115.12",
    "pydantic>=2",
]
examples-db = [
    "sqlalchemy[asyncio]>=2.0.41",
    "aiosqlite>=0.21.0",
]
uvicorn = [
    "uvicorn>=0.34.0",
]
granian = [
    "granian>=2.3.1",
]
daphne = [
    "daphne>=4.2.0",
]

[dependency-groups]
dev = [
    "asgi-lifespan>=2.1.0",
    "httpx>=0.28.1",
    "pre-commit>=4.5.0",
    "pytest>=8.3.4",
    "pytest-asyncio>=0.25.0",
    "pytest-cov>=6.0.0",
    "ruff>=0.14.0",
    "testcontainers>=4.9.0",
    "ty>=0.0.19",
    "uvicorn>=0.34.0",
]
experimentation = [
    "portend>=3.2.1",
    "psutil>=7.0.0",
    "tenacity>=9.0.0",
]

[project.urls]
Source = "https://github.com/sysid/sse-starlette"

[build-system]
requires = ["setuptools"]
build-backend = "setuptools.build_meta"

[tool.setuptools.packages.find]
include = ["sse_starlette*"]

[tool.bumpversion]
current_version = "3.4.1"
commit = true
tag = false
message = "Bump version to {new_version}"

[tool.bumpversion.file_patterns]
"sse_starlette/__init__.py" = [
    {search = "__version__ = '{current_version}'", replace = "__version__ = '{new_version}'"},
]
"VERSION" = [
    {search = "{current_version}", replace = "{new_version}"},
]
"pyproject.toml" = [
    {search = "version = {current_version}", replace = "version = {new_version}"},
]

[[tool.bumpversion.files]]
filename = "VERSION"

[[tool.bumpversion.files]]
filename = "pyproject.toml"

[[tool.bumpversion.files]]
filename = "sse_starlette/__init__.py"

[tool.pytest.ini_options]
markers = [
    "integration: marks tests as integration tests",
    "experimentation: marks tests as experimental tests, not to be run in CICD"
]
asyncio_mode = "auto"
asyncio_default_fixture_loop_scope = "function"
filterwarnings = [
    # testcontainers internal deprecation warning (triggered at import time by their own code)
    "ignore:The @wait_container_is_ready decorator is deprecated:DeprecationWarning",
]

[tool.ty.environment]
python-version = "3.12"

[tool.coverage.run]
source = ["sse_starlette"]
omit = [
    "tests/*",
    "**/__main__.py",
    "**/.venv/*",
    "**/site-packages/*",
]
branch = true

[tool.coverage.report]
show_missing = true
skip_covered = true
fail_under = 85

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

[tool.ruff.lint]
select = ["E4", "E7", "E9", "F"]
fixable = ["ALL"]

[tool.ruff.format]
quote-style = "double"
indent-style = "space"
