[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"

[project]
name = "fakeredis"
version = "2.36.2"
description = "Python implementation of redis API, can be used for testing purposes."
authors = [
    { name = "Daniel Moran", email = "daniel@moransoftware.ca" },
    { name = "Bruce Merry", email = "bmerry@ska.ac.za" },
    { name = "James Saryerwinnie", email = "js@jamesls.com" },
]
requires-python = ">=3.7"
readme = "README.md"
license = "BSD-3-Clause"
maintainers = [{ name = "Daniel Moran", email = "daniel@moransoftware.ca" }]
keywords = [
    "redis",
    "RedisJson",
    "RedisBloom",
    "RedisTimeSeries",
    "testing",
    "redis-stack",
    "valkey",
    "dragonfly",
]
classifiers = [
    "Development Status :: 5 - Production/Stable",
    "Development Status :: 6 - Mature",
    "Intended Audience :: Developers",
    "License :: OSI Approved :: BSD License",
    "Operating System :: OS Independent",
    "Programming Language :: Python",
    "Programming Language :: Python :: 3.9",
    "Programming Language :: Python :: 3.10",
    "Programming Language :: Python :: 3.11",
    "Programming Language :: Python :: 3.12",
    "Programming Language :: Python :: 3.13",
    "Programming Language :: Python :: 3.14",
    "Programming Language :: Python :: 3.15",
    "Topic :: Software Development :: Libraries :: Python Modules",
]
dependencies = [
    "redis>=4 ; python_version < '3.8'",
    "redis<7.2 ; python_version < '3.10'",
    "redis>=4.3; python_version > '3.8'",
    "sortedcontainers>=2",
    "typing-extensions>=4.7 ; python_version < '3.11'",
]

[project.optional-dependencies]
lua = ["lupa>=2.1"]
json = ["jsonpath-ng>=1.6"]
bf = ["pyprobables>=0.6"]
cf = ["pyprobables>=0.6"]
probabilistic = ["pyprobables>=0.6"]
valkey = [
    "valkey>=6 ; python_version >= '3.8'",
]
vectorset = [
    "numpy>=2.4.0 ; python_version >= '3.11'",
    "jsonpath-ng>=1.6 ; python_version >= '3.11'",
]

[project.urls]
Homepage = "https://github.com/cunla/fakeredis-py"
Repository = "https://github.com/cunla/fakeredis-py"
Documentation = "https://fakeredis.moransoftware.ca/"
"Bug Tracker" = "https://github.com/cunla/fakeredis-py/issues"
Funding = "https://github.com/sponsors/cunla"

[dependency-groups]
dev = [
    "ruff>=0.15",
    "mypy>=1.15 ; python_version >= '3.10'",
    "pre-commit>=4.2 ; python_version >= '3.10'",
    "pyyaml>=6 ; python_version >= '3.10'",
]
test = [
    "coverage>=7.10 ; python_version >= '3.9' and python_version < '3.14'",
    "pytest>=8.4 ; python_version >= '3.9'",
    "hypothesis>=6.138 ; python_version >= '3.9'",
    "pytest-timeout>=2.4 ; python_version >= '3.9'",
    "pytest-asyncio>=1.1 ; python_version >= '3.9'",
    "pytest-cov>=6.3 ; python_version >= '3.9'",
    "pytest-mock>=3.15 ; python_version >= '3.9'",
    "pytest-html>=4.1 ; python_version >= '3.9'",
]
scripts = [
    "python-dotenv>=1.1 ; python_version >= '3.10'",
    "pygithub>=2.8 ; python_version >= '3.10'",
]
documentation = [
    "mkdocs>=1.6.1; python_version >= '3.10'",
    "mkdocs-material>=9.6.14; python_version >= '3.10'",
]

[tool.uv]
default-groups = [
    "dev",
    "test",
    "scripts",
]

[tool.hatch.build.targets.sdist]
include = [
    "fakeredis",
    "test",
]

[tool.hatch.build.targets.wheel]
include = [
    "fakeredis",
]

[tool.hatch.build.targets.wheel.force-include]
LICENSE = "fakeredis/LICENSE"

[tool.pytest.ini_options]
asyncio_default_fixture_loop_scope = "function"
markers = [
    "slow: marks tests as slow (deselect with '-m \"not slow\"')",
    "fake: select the fakeredis fixture variants (use '-m fake' to run the suite without a real server)",
    "fake_only: restrict a single test to the fakeredis fixture variants, skipping its real-server params",
    "real: select the real-server fixture variants (requires a Redis server on localhost:6390)",
    "disconnected",
    "supported_server_versions",
    "decode_responses",
    "unsupported_server_types",
    "resp2_only: run tests only with RESP2",
    "resp3_only: run tests only with RESP3",
    "load_lua_modules: run tests that load Lua modules",
    "tcp_server: run tests against a TCP server",
]
asyncio_mode = "strict"
generate_report_on_test = true

[tool.mypy]
packages = ['fakeredis', ]
strict = true
follow_imports = "silent"
ignore_missing_imports = true
scripts_are_modules = true
check_untyped_defs = true
exclude = [".venv", "test", "__pycache__"]


[tool.ruff]
line-length = 120
exclude = [
    '.venv',
    '__pycache__',
]
target-version = "py311"

[tool.ruff.format]
quote-style = "double"
indent-style = "space"
skip-magic-trailing-comma = false
line-ending = "auto"
