[project] name = "cachelib" version = "0.17.0" description = "A collection of cache libraries in the same API interface." readme = "README.md" license = "BSD-3-Clause" license-files = ["LICENSE.txt"] maintainers = [{ name = "Pallets Ecosystem", email = "contact@palletsprojects.com" }] classifiers = [ "Development Status :: 5 - Production/Stable", "Intended Audience :: Developers", "Operating System :: OS Independent", "Programming Language :: Python", "Typing :: Typed", ] requires-python = ">=3.11" [project.urls] Donate = "https://palletsprojects.com/donate" Documentation = "https://cachelib.readthedocs.io" Changes = "https://cachelib.readthedocs.io/page/changes/" Source = "https://github.com/pallets-eco/cachelib/" Chat = "https://discord.gg/pallets" [project.optional-dependencies] dynamodb = [ "boto3>=1.43.4", ] memcached = [ "pylibmc>=1.6.3", ] mongodb = [ "pymongo>=4.11", ] redis = [ "redis>=6.0.0", ] valkey = [ "valkey>=6.1.0", ] uwsgi = [ "uwsgi>=2.0.28", ] [dependency-groups] dev = [ "ruff", "tox", "tox-uv", ] docs = [ "sphinx", # Theme "pallets-sphinx-themes", # Extensions "sphinxcontrib-log-cabinet", "sphinx-tabs", "sphinx_copybutton", # Check Spelling "pyenchant", "sphinxcontrib-spelling", ] docs-auto = [ "sphinx-autobuild", ] gha-update = [ "gha-update ; python_full_version >= '3.12'", ] pre-commit = [ "pre-commit", "pre-commit-uv", ] tests = [ "boto3>=1.43.4", "pylibmc>=1.6.3", "python-memcached>=1.62", "pymongo>=4.11", "pytest", "pytest-xprocess", "redis>=6.0.0", "valkey>=6.1.0", "uwsgi>=2.0.28", ] typing = [ "mypy", "pyright", "boto3-stubs[dynamodb]", ] [build-system] requires = ["flit_core<4"] build-backend = "flit_core.buildapi" [tool.flit.sdist] include = [ "docs/", "tests/", "CHANGES.rst", "uv.lock" ] exclude = [ "docs/_build/", ] [tool.uv] default-groups = ["dev", "pre-commit", "tests", "typing"] [tool.pytest.ini_options] addopts = "--strict-markers" testpaths = ["tests"] filterwarnings = [ "error", "default::pytest.PytestUnraisableExceptionWarning", # pylibmc C ext on py3.13+ ] markers = [ "network: mark a test which requires net access (deselect with '-m \"not network\"')", ] [tool.coverage.run] branch = true source = ["cachelib", "tests"] [tool.coverage.paths] source = ["src", "*/site-packages"] [tool.coverage.report] exclude_also = [ "if t.TYPE_CHECKING", "raise NotImplementedError", ": \\.{3}", ] [tool.mypy] python_version = "3.11" files = ["src"] show_error_codes = true pretty = true strict = true [tool.pyright] pythonVersion = "3.11" include = ["src"] typeCheckingMode = "standard" [tool.ruff] src = ["src"] fix = true show-fixes = true output-format = "full" [tool.ruff.lint] select = [ "B", # flake8-bugbear "E", # pycodestyle error "F", # pyflakes "I", # isort "UP", # pyupgrade "W", # pycodestyle warning ] [tool.ruff.lint.isort] force-single-line = true order-by-type = false [tool.tox] env_list = [ "py3.15", "py3.14", "py3.13", "py3.12", "py3.11", "style", "typing", "docs", ] [tool.tox.env_run_base] description = "pytest on latest dependency versions" runner = "uv-venv-lock-runner" package = "wheel" wheel_build_env = ".pkg" constrain_package_deps = true use_frozen_constraints = true dependency_groups = ["tests"] pass_env = ["CI"] set_env = { TMPDIR = "{env_tmp_dir}" } commands = [ [ "pytest", "-v", "-rs", "--tb=short", "--capture=tee-sys", "--basetemp={env_tmp_dir}", { replace = "posargs", default = [], extend = true }, ], [ "uwsgi", "--python", "{env_bin_dir}/pytest", "--pyargv", "-v -rs --tb=short --capture=tee-sys --basetemp={env_tmp_dir} {posargs} -kUwsgi", "--cache2", "name=default,items=100", "--master", ], ["python", "{envtmpdir}/return_pytest_exit_code.py"], ] [tool.tox.env.style] description = "run all pre-commit hooks on all files" dependency_groups = ["pre-commit"] skip_install = true commands = [["pre-commit", "run", "--all-files"]] [tool.tox.env.typing] description = "run static type checkers" dependency_groups = ["tests", "typing"] commands = [ ["mypy"], ] [tool.tox.docs] docs_dir = "{tox_root}{/}docs" build_dir = "{[tool.tox.docs]docs_dir}{/}_build" sphinx_args = ["--show-traceback", "--fail-on-warning", "--keep-going", "--fresh-env"] [tool.tox.env.docs] description = "build docs" dependency_groups = ["docs"] commands = [[ "sphinx-build", { replace = "ref", of = ["tool", "tox", "docs", "sphinx_args"], extend = true }, { replace = "posargs", default = [], extend = true }, "--builder", "dirhtml", "{[tool.tox.docs]docs_dir}", "{[tool.tox.docs]build_dir}{/}dirhtml", ]] [tool.tox.env.docs-auto] description = "continuously rebuild docs and start a local server" dependency_groups = ["docs", "docs-auto"] package = "editable" commands = [[ "sphinx-autobuild", { replace = "ref", of = ["tool", "tox", "docs", "sphinx_args"], extend = true }, { replace = "posargs", default = [], extend = true }, "--builder", "dirhtml", "--watch", "src", "{[tool.tox.docs]docs_dir}", "{[tool.tox.docs]build_dir}{/}live", ]] [tool.tox.env.docs-lint] description = "check docs spelling and links" dependency_groups = ["docs"] commands = [ [ "sphinx-build", { replace = "ref", of = ["tool", "tox", "docs", "sphinx_args"], extend = true }, { replace = "posargs", default = [], extend = true }, "--builder", "spelling", "{[tool.tox.docs]docs_dir}", "{[tool.tox.docs]build_dir}{/}spell", ], [ "sphinx-build", { replace = "ref", of = ["tool", "tox", "docs", "sphinx_args"], extend = true }, { replace = "posargs", default = [], extend = true }, "--builder", "linkcheck", "{[tool.tox.docs]docs_dir}", "{[tool.tox.docs]build_dir}{/}links", ], ] [tool.tox.env.update-actions] description = "update GitHub Actions pins" labels = ["update"] dependency_groups = ["gha-update"] skip_install = true commands = [["gha-update"]] [tool.tox.env.update-pre_commit] description = "update pre-commit pins" labels = ["update"] dependency_groups = ["pre-commit"] skip_install = true commands = [["pre-commit", "autoupdate", "--freeze", "-j4"]] [tool.tox.env.update-requirements] description = "update uv lock" labels = ["update"] dependency_groups = [] no_default_groups = true skip_install = true commands = [["uv", "lock", "--exclude-newer", "1 week", {replace = "posargs", default = ["-U"], extend = true}]]