Script 'mail_helper' called by obssrc
Hello community,
here is the log from the commit of package python-cachelib for openSUSE:Factory
checked in at 2026-03-27 16:51:19
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-cachelib (Old)
and /work/SRC/openSUSE:Factory/.python-cachelib.new.8177 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-cachelib"
Fri Mar 27 16:51:19 2026 rev:8 rq:1343144 version:0.13.0
Changes:
--------
--- /work/SRC/openSUSE:Factory/python-cachelib/python-cachelib.changes
2025-04-10 22:00:00.426501112 +0200
+++
/work/SRC/openSUSE:Factory/.python-cachelib.new.8177/python-cachelib.changes
2026-03-27 16:54:01.710803677 +0100
@@ -1,0 +2,13 @@
+Fri Mar 27 09:43:54 UTC 2026 - Dirk Müller <[email protected]>
+
+- update to 0.13.0:
+ * default hashlib.md5 may not be available in FIPS builds. We
+ now do not access it at import time on FileSystemCache``so
+ developers have time to change the default. ``hashlib.md5
+ will be lazy loaded when a new default is not provided
+ * RedisCache now supports callables as keys
+ * Added MongoDB as a cache backend
+ * Drop python 3.7 support
+ * Add python 3.11 support
+
+-------------------------------------------------------------------
Old:
----
cachelib-0.10.2.tar.gz
New:
----
cachelib-0.13.0.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ python-cachelib.spec ++++++
--- /var/tmp/diff_new_pack.IYxkv6/_old 2026-03-27 16:54:02.470835493 +0100
+++ /var/tmp/diff_new_pack.IYxkv6/_new 2026-03-27 16:54:02.474835661 +0100
@@ -1,7 +1,7 @@
#
# spec file for package python-cachelib
#
-# Copyright (c) 2025 SUSE LLC
+# Copyright (c) 2026 SUSE LLC and contributors
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@@ -18,7 +18,7 @@
%{?sle15_python_module_pythons}
Name: python-cachelib
-Version: 0.10.2
+Version: 0.13.0
Release: 0
Summary: A collection of cache libraries in the same API interface
License: BSD-3-Clause
@@ -61,6 +61,8 @@
%python_expand %fdupes %{buildroot}%{$python_sitelib}
%check
+# need running mongodb
+rm tests/test_mongodb_cache.py
# set up working directory
export BASETEMP=$(mktemp -d -t cachelib_test.XXXXXX)
trap "rm -rf ${BASETEMP}" EXIT
++++++ cachelib-0.10.2.tar.gz -> cachelib-0.13.0.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/cachelib-0.10.2/.github/workflows/lock.yaml
new/cachelib-0.13.0/.github/workflows/lock.yaml
--- old/cachelib-0.10.2/.github/workflows/lock.yaml 2022-08-14
13:15:26.000000000 +0200
+++ new/cachelib-0.13.0/.github/workflows/lock.yaml 1970-01-01
01:00:00.000000000 +0100
@@ -1,15 +0,0 @@
-name: 'Lock threads'
-
-on:
- schedule:
- - cron: '0 0 * * *'
-
-jobs:
- lock:
- runs-on: ubuntu-latest
- steps:
- - uses: dessant/lock-threads@v2
- with:
- github-token: ${{ github.token }}
- issue-lock-inactive-days: 14
- pr-lock-inactive-days: 14
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/cachelib-0.10.2/.github/workflows/tests.yaml
new/cachelib-0.13.0/.github/workflows/tests.yaml
--- old/cachelib-0.10.2/.github/workflows/tests.yaml 2023-01-31
20:10:03.000000000 +0100
+++ new/cachelib-0.13.0/.github/workflows/tests.yaml 2024-02-11
17:03:28.000000000 +0100
@@ -24,24 +24,17 @@
fail-fast: false
matrix:
include:
- - {name: Linux, python: '3.9', os: ubuntu-latest, tox: py39}
- - {name: Mac, python: '3.9', os: macos-latest, tox: py39}
+ - {name: Linux, python: '3.11', os: ubuntu-latest, tox: py311}
- {name: '3.8', python: '3.8', os: ubuntu-latest, tox: py38}
- - {name: '3.7', python: '3.7', os: ubuntu-latest, tox: py37}
+ - {name: '3.9', python: '3.9', os: ubuntu-latest, tox: py39}
- {name: '3.10', python: '3.10', os: ubuntu-latest, tox: py310}
- - {name: Typing, python: '3.9', os: ubuntu-latest, tox: typing}
+ - {name: '3.11', python: '3.11', os: ubuntu-latest, tox: py311}
+ - {name: Typing, python: '3.12', os: ubuntu-latest, tox: typing}
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python }}
- - name: install external dependencies Mac
- if: matrix.os == 'macos-latest'
- run: brew install libmemcached memcached redis
- - name: Setup Docker on macOS
- if: matrix.os == 'macos-latest'
- uses: docker-practice/actions-setup-docker@master
- timeout-minutes: 12
- name: install external dependencies Linux
if: matrix.os == 'ubuntu-latest'
run: |
@@ -49,6 +42,10 @@
sudo apt-get install libmemcached-dev memcached redis-server
- name: setup dynamodb-local
uses: rrainn/[email protected]
+ - name: Start MongoDB
+ uses: wbari/[email protected]
+ with:
+ mongoDBVersion: 'latest'
- name: update pip
run: |
pip install -U wheel
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/cachelib-0.10.2/.gitignore
new/cachelib-0.13.0/.gitignore
--- old/cachelib-0.10.2/.gitignore 2023-01-31 20:10:03.000000000 +0100
+++ new/cachelib-0.13.0/.gitignore 2024-02-11 17:03:08.000000000 +0100
@@ -23,3 +23,9 @@
.xprocess
.vscode
.python-version
+/.idea/.gitignore
+/.idea/cachelib.iml
+/.idea/misc.xml
+/.idea/modules.xml
+/.idea/inspectionProfiles/profiles_settings.xml
+/.idea/vcs.xml
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/cachelib-0.10.2/.pre-commit-config.yaml
new/cachelib-0.13.0/.pre-commit-config.yaml
--- old/cachelib-0.10.2/.pre-commit-config.yaml 2023-01-31 20:10:03.000000000
+0100
+++ new/cachelib-0.13.0/.pre-commit-config.yaml 2024-04-13 15:51:06.000000000
+0200
@@ -2,28 +2,28 @@
autoupdate_schedule: monthly
repos:
- repo: https://github.com/asottile/pyupgrade
- rev: v3.3.0
+ rev: v3.15.2
hooks:
- id: pyupgrade
args: ["--py37-plus"]
- - repo: https://github.com/asottile/reorder_python_imports
- rev: v3.9.0
+ - repo: https://github.com/asottile/reorder-python-imports
+ rev: v3.12.0
hooks:
- id: reorder-python-imports
args: ["--application-directories", "src"]
- repo: https://github.com/psf/black
- rev: 22.10.0
+ rev: 24.3.0
hooks:
- id: black
- repo: https://github.com/PyCQA/flake8
- rev: 6.0.0
+ rev: 7.0.0
hooks:
- id: flake8
additional_dependencies:
- flake8-bugbear
- flake8-implicit-str-concat
- repo: https://github.com/pre-commit/pre-commit-hooks
- rev: v4.4.0
+ rev: v4.5.0
hooks:
- id: fix-byte-order-marker
- id: trailing-whitespace
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/cachelib-0.10.2/.readthedocs.yaml
new/cachelib-0.13.0/.readthedocs.yaml
--- old/cachelib-0.10.2/.readthedocs.yaml 2022-08-14 13:15:26.000000000
+0200
+++ new/cachelib-0.13.0/.readthedocs.yaml 2024-02-11 17:03:08.000000000
+0100
@@ -1,4 +1,8 @@
version: 2
+build:
+ os: ubuntu-22.04
+ tools:
+ python: "3.10"
python:
install:
- requirements: requirements/docs.txt
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/cachelib-0.10.2/CHANGES.rst
new/cachelib-0.13.0/CHANGES.rst
--- old/cachelib-0.10.2/CHANGES.rst 2023-01-31 20:12:34.000000000 +0100
+++ new/cachelib-0.13.0/CHANGES.rst 2024-04-13 16:11:04.000000000 +0200
@@ -1,3 +1,32 @@
+Version 0.13.0
+--------------
+
+Released 2024-04-13
+
+- default ``hashlib.md5`` may not be available in FIPS builds. We
+ now do not access it at import time on ``FileSystemCache``so developers
+ have time to change the default.
+ ``hashlib.md5`` will be lazy loaded when a new default is not provided
+
+
+Version 0.12.0
+--------------
+
+Released 2024-02-11
+
+- ``RedisCache`` now supports callables as keys
+- Added ``MongoDB`` as a cache backend
+
+
+Version 0.11.0
+--------------
+
+Released 2024-02-10
+
+- Drop python 3.7 support
+- Add python 3.11 support
+
+
Version 0.10.2
--------------
@@ -9,7 +38,7 @@
Version 0.10.1
--------------
-Unreleased
+Released 2023-01-22
- Fix logging pollution due to ``DynamoDB`` logging handler
@@ -22,7 +51,6 @@
- Improve error message when ``FileSystemCache`` methods are called with
non-str keys. :pr:`170`
- Added ``DynamoDb`` as a cache backend :pr:`209`
-
Version 0.9.0
-------------
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/cachelib-0.10.2/PKG-INFO new/cachelib-0.13.0/PKG-INFO
--- old/cachelib-0.10.2/PKG-INFO 2023-01-31 20:48:07.377733200 +0100
+++ new/cachelib-0.13.0/PKG-INFO 2024-04-13 16:16:09.636856800 +0200
@@ -1,6 +1,6 @@
Metadata-Version: 2.1
Name: cachelib
-Version: 0.10.2
+Version: 0.13.0
Summary: A collection of cache libraries in the same API interface.
Home-page: https://github.com/pallets-eco/cachelib/
Maintainer: Pallets
@@ -13,13 +13,12 @@
Project-URL: Issue Tracker, https://github.com/pallets-eco/cachelib/issues/
Project-URL: Twitter, https://twitter.com/PalletsTeam
Project-URL: Chat, https://discord.gg/pallets
-Platform: UNKNOWN
Classifier: Development Status :: 5 - Production/Stable
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: BSD License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python
-Requires-Python: >=3.7
+Requires-Python: >=3.8
Description-Content-Type: text/x-rst
License-File: LICENSE.rst
@@ -63,5 +62,3 @@
- Issue Tracker: https://github.com/pallets/cachelib/issues/
- Twitter: https://twitter.com/PalletsTeam
- Chat: https://discord.gg/pallets
-
-
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/cachelib-0.10.2/docs/index.rst
new/cachelib-0.13.0/docs/index.rst
--- old/cachelib-0.10.2/docs/index.rst 2023-01-31 20:10:03.000000000 +0100
+++ new/cachelib-0.13.0/docs/index.rst 2024-02-11 17:03:28.000000000 +0100
@@ -14,6 +14,7 @@
memcached
uwsgi
dynamodb
+ mongodb
.. toctree::
:maxdepth: 2
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/cachelib-0.10.2/docs/mongodb.rst
new/cachelib-0.13.0/docs/mongodb.rst
--- old/cachelib-0.10.2/docs/mongodb.rst 1970-01-01 01:00:00.000000000
+0100
+++ new/cachelib-0.13.0/docs/mongodb.rst 2024-02-11 17:03:28.000000000
+0100
@@ -0,0 +1,7 @@
+MongoDb Backend
+===============
+
+.. automodule:: cachelib.mongodb
+ :members:
+ :undoc-members:
+ :show-inheritance:
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/cachelib-0.10.2/requirements/dev.txt
new/cachelib-0.13.0/requirements/dev.txt
--- old/cachelib-0.10.2/requirements/dev.txt 2023-01-31 20:11:41.000000000
+0100
+++ new/cachelib-0.13.0/requirements/dev.txt 2024-04-13 16:00:33.000000000
+0200
@@ -1,185 +1,180 @@
#
-# This file is autogenerated by pip-compile with Python 3.9
+# This file is autogenerated by pip-compile with Python 3.11
# by the following command:
#
# pip-compile requirements/dev.in
#
-alabaster==0.7.12
+alabaster==0.7.16
# via sphinx
-async-timeout==4.0.2
- # via redis
-attrs==21.2.0
- # via pytest
-babel==2.9.1
+babel==2.14.0
# via sphinx
-backports-entry-points-selectable==1.1.0
- # via virtualenv
-boto3==1.26.54
- # via -r requirements/tests.in
-botocore==1.29.54
+boto3==1.34.39
+ # via -r tests.in
+botocore==1.34.39
# via
# boto3
# s3transfer
-build==0.8.0
+build==1.0.3
# via pip-tools
-certifi==2022.12.7
+cachetools==5.3.2
+ # via tox
+certifi==2024.2.2
# via requests
-cfgv==3.3.1
+cffi==1.16.0
+ # via cryptography
+cfgv==3.4.0
# via pre-commit
-charset-normalizer==2.0.7
+chardet==5.2.0
+ # via tox
+charset-normalizer==3.3.2
# via requests
-click==8.0.3
+click==8.1.7
# via pip-tools
-distlib==0.3.3
+colorama==0.4.6
+ # via tox
+cryptography==42.0.4
+ # via
+ # types-pyopenssl
+ # types-redis
+distlib==0.3.8
# via virtualenv
-docutils==0.17.1
+dnspython==2.5.0
+ # via pymongo
+docutils==0.20.1
# via
# sphinx
# sphinx-tabs
-exceptiongroup==1.1.0
- # via pytest
-filelock==3.3.2
+filelock==3.13.1
# via
# tox
# virtualenv
-identify==2.3.3
+identify==2.5.34
# via pre-commit
-idna==3.3
+idna==3.7
# via requests
-imagesize==1.2.0
+imagesize==1.4.1
# via sphinx
-importlib-metadata==6.0.0
- # via sphinx
-iniconfig==1.1.1
+iniconfig==2.0.0
# via pytest
-jinja2==3.0.2
- # via
- # sphinx
- # sphinx-tabs
+jinja2==3.1.3
+ # via sphinx
jmespath==1.0.1
# via
# boto3
# botocore
-markupsafe==2.0.1
+markupsafe==2.1.5
# via jinja2
-mypy==0.991
- # via -r requirements/typing.in
-mypy-extensions==0.4.3
+mypy==1.9.0
+ # via -r typing.in
+mypy-extensions==1.0.0
# via mypy
-nodeenv==1.6.0
+nodeenv==1.8.0
# via pre-commit
-packaging==21.3
+packaging==23.2
# via
# build
# pallets-sphinx-themes
+ # pyproject-api
# pytest
# sphinx
# tox
-pallets-sphinx-themes==2.0.3
- # via -r requirements/docs.in
-pep517==0.12.0
- # via build
-pip-tools==6.12.1
- # via -r requirements/dev.in
-platformdirs==2.4.0
- # via virtualenv
-pluggy==1.0.0
+pallets-sphinx-themes==2.1.1
+ # via -r docs.in
+pip-tools==7.4.1
+ # via -r dev.in
+platformdirs==4.2.0
# via
- # pytest
# tox
-pre-commit==2.21.0
- # via -r requirements/dev.in
-psutil==5.8.0
- # via pytest-xprocess
-py==1.10.0
+ # virtualenv
+pluggy==1.4.0
# via
- # pytest-xprocess
+ # pytest
# tox
-pygments==2.10.0
+pre-commit==3.7.0
+ # via -r dev.in
+psutil==5.9.8
+ # via pytest-xprocess
+pycparser==2.21
+ # via cffi
+pygments==2.17.2
# via
# sphinx
# sphinx-tabs
pylibmc==1.6.3
- # via -r requirements/tests.in
-pyparsing==2.4.7
- # via packaging
-pytest==7.2.0
+ # via -r tests.in
+pymongo==4.6.1
+ # via -r tests.in
+pyproject-api==1.6.1
+ # via tox
+pyproject-hooks==1.0.0
# via
- # -r requirements/tests.in
+ # build
+ # pip-tools
+pytest==8.0.0
+ # via
+ # -r tests.in
# pytest-xprocess
-pytest-xprocess==0.22.2
- # via -r requirements/tests.in
+pytest-xprocess==0.23.0
+ # via -r tests.in
python-dateutil==2.8.2
# via botocore
-pytz==2021.3
- # via babel
-pyyaml==6.0
+pyyaml==6.0.1
# via pre-commit
-redis==4.4.0
- # via -r requirements/tests.in
-requests==2.26.0
+redis==5.0.1
+ # via -r tests.in
+requests==2.31.0
# via sphinx
-s3transfer==0.6.0
+s3transfer==0.10.0
# via boto3
six==1.16.0
- # via
- # python-dateutil
- # tox
- # virtualenv
-snowballstemmer==2.1.0
+ # via python-dateutil
+snowballstemmer==2.2.0
# via sphinx
-sphinx==5.1.1
+sphinx==7.2.6
# via
- # -r requirements/docs.in
+ # -r docs.in
# pallets-sphinx-themes
# sphinx-issues
# sphinx-tabs
# sphinxcontrib-log-cabinet
-sphinx-issues==3.0.1
- # via -r requirements/docs.in
-sphinx-tabs==3.4.0
- # via -r requirements/docs.in
-sphinxcontrib-applehelp==1.0.2
+sphinx-issues==4.0.0
+ # via -r docs.in
+sphinx-tabs==3.4.5
+ # via -r docs.in
+sphinxcontrib-applehelp==1.0.8
# via sphinx
-sphinxcontrib-devhelp==1.0.2
+sphinxcontrib-devhelp==1.0.6
# via sphinx
-sphinxcontrib-htmlhelp==2.0.0
+sphinxcontrib-htmlhelp==2.0.5
# via sphinx
sphinxcontrib-jsmath==1.0.1
# via sphinx
sphinxcontrib-log-cabinet==1.0.1
- # via -r requirements/docs.in
-sphinxcontrib-qthelp==1.0.3
+ # via -r docs.in
+sphinxcontrib-qthelp==1.0.7
# via sphinx
-sphinxcontrib-serializinghtml==1.1.5
+sphinxcontrib-serializinghtml==1.1.10
# via sphinx
-tomli==2.0.1
- # via
- # build
- # mypy
- # pep517
- # pytest
- # tox
-tox==3.28.0
- # via -r requirements/dev.in
-types-redis==4.4.0.0
- # via -r requirements/typing.in
-typing-extensions==3.10.0.2
+tox==4.12.1
+ # via -r dev.in
+types-pyopenssl==24.0.0.20240130
+ # via types-redis
+types-redis==4.6.0.20240311
+ # via -r typing.in
+typing-extensions==4.9.0
# via mypy
-urllib3==1.26.7
+urllib3==2.0.7
# via
# botocore
# requests
-uwsgi==2.0.21
- # via -r requirements/tests.in
-virtualenv==20.10.0
+uwsgi==2.0.24
+ # via -r tests.in
+virtualenv==20.25.0
# via
# pre-commit
# tox
-wheel==0.38.1
+wheel==0.42.0
# via pip-tools
-zipp==3.11.0
- # via importlib-metadata
# The following packages are considered to be unsafe in a requirements file:
# pip
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/cachelib-0.10.2/requirements/docs.txt
new/cachelib-0.13.0/requirements/docs.txt
--- old/cachelib-0.10.2/requirements/docs.txt 2023-01-31 20:11:41.000000000
+0100
+++ new/cachelib-0.13.0/requirements/docs.txt 2024-04-13 15:51:06.000000000
+0200
@@ -1,5 +1,5 @@
#
-# This file is autogenerated by pip-compile with Python 3.9
+# This file is autogenerated by pip-compile with Python 3.11
# by the following command:
#
# pip-compile requirements/docs.in
@@ -8,33 +8,29 @@
# via sphinx
babel==2.9.1
# via sphinx
-certifi==2022.12.7
+certifi==2023.7.22
# via requests
charset-normalizer==2.0.7
# via requests
-docutils==0.17.1
+docutils==0.18.1
# via
# sphinx
# sphinx-tabs
-idna==3.3
+idna==3.7
# via requests
-imagesize==1.2.0
+imagesize==1.4.1
# via sphinx
-importlib-metadata==6.0.0
+jinja2==3.1.3
# via sphinx
-jinja2==3.0.2
- # via
- # sphinx
- # sphinx-tabs
markupsafe==2.0.1
# via jinja2
packaging==21.2
# via
# pallets-sphinx-themes
# sphinx
-pallets-sphinx-themes==2.0.3
- # via -r requirements/docs.in
-pygments==2.10.0
+pallets-sphinx-themes==2.1.1
+ # via -r docs.in
+pygments==2.15.0
# via
# sphinx
# sphinx-tabs
@@ -42,21 +38,21 @@
# via packaging
pytz==2021.3
# via babel
-requests==2.26.0
+requests==2.31.0
# via sphinx
snowballstemmer==2.1.0
# via sphinx
-sphinx==5.1.1
+sphinx==7.2.6
# via
- # -r requirements/docs.in
+ # -r docs.in
# pallets-sphinx-themes
# sphinx-issues
# sphinx-tabs
# sphinxcontrib-log-cabinet
-sphinx-issues==3.0.1
- # via -r requirements/docs.in
-sphinx-tabs==3.4.0
- # via -r requirements/docs.in
+sphinx-issues==4.0.0
+ # via -r docs.in
+sphinx-tabs==3.4.5
+ # via -r docs.in
sphinxcontrib-applehelp==1.0.2
# via sphinx
sphinxcontrib-devhelp==1.0.2
@@ -66,12 +62,10 @@
sphinxcontrib-jsmath==1.0.1
# via sphinx
sphinxcontrib-log-cabinet==1.0.1
- # via -r requirements/docs.in
+ # via -r docs.in
sphinxcontrib-qthelp==1.0.3
# via sphinx
-sphinxcontrib-serializinghtml==1.1.5
+sphinxcontrib-serializinghtml==1.1.10
# via sphinx
-urllib3==1.26.7
+urllib3==1.26.18
# via requests
-zipp==3.11.0
- # via importlib-metadata
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/cachelib-0.10.2/requirements/tests.in
new/cachelib-0.13.0/requirements/tests.in
--- old/cachelib-0.10.2/requirements/tests.in 2023-01-31 20:10:03.000000000
+0100
+++ new/cachelib-0.13.0/requirements/tests.in 2024-02-11 17:03:28.000000000
+0100
@@ -4,3 +4,4 @@
uwsgi
pytest-xprocess
boto3
+pymongo
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/cachelib-0.10.2/requirements/tests.txt
new/cachelib-0.13.0/requirements/tests.txt
--- old/cachelib-0.10.2/requirements/tests.txt 2023-01-31 20:11:41.000000000
+0100
+++ new/cachelib-0.13.0/requirements/tests.txt 2024-02-11 17:03:28.000000000
+0100
@@ -1,56 +1,48 @@
#
-# This file is autogenerated by pip-compile with Python 3.9
+# This file is autogenerated by pip-compile with Python 3.11
# by the following command:
#
# pip-compile requirements/tests.in
#
-async-timeout==4.0.2
- # via redis
-attrs==21.2.0
- # via pytest
-boto3==1.26.45
+boto3==1.34.39
# via -r requirements/tests.in
-botocore==1.29.45
+botocore==1.34.39
# via
# boto3
# s3transfer
-exceptiongroup==1.1.0
- # via pytest
-iniconfig==1.1.1
+dnspython==2.5.0
+ # via pymongo
+iniconfig==2.0.0
# via pytest
jmespath==1.0.1
# via
# boto3
# botocore
-packaging==21.3
+packaging==23.2
# via pytest
-pluggy==1.0.0
+pluggy==1.4.0
# via pytest
-psutil==5.8.0
- # via pytest-xprocess
-py==1.10.0
+psutil==5.9.8
# via pytest-xprocess
pylibmc==1.6.3
# via -r requirements/tests.in
-pyparsing==2.4.7
- # via packaging
-pytest==7.2.0
+pymongo==4.6.1
+ # via -r requirements/tests.in
+pytest==8.0.0
# via
# -r requirements/tests.in
# pytest-xprocess
-pytest-xprocess==0.22.2
+pytest-xprocess==0.23.0
# via -r requirements/tests.in
python-dateutil==2.8.2
# via botocore
-redis==4.4.0
+redis==5.0.1
# via -r requirements/tests.in
-s3transfer==0.6.0
+s3transfer==0.10.0
# via boto3
six==1.16.0
# via python-dateutil
-tomli==2.0.1
- # via pytest
-urllib3==1.26.13
+urllib3
# via botocore
-uwsgi==2.0.21
+uwsgi==2.0.24
# via -r requirements/tests.in
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/cachelib-0.10.2/requirements/typing.txt
new/cachelib-0.13.0/requirements/typing.txt
--- old/cachelib-0.10.2/requirements/typing.txt 2023-01-31 20:11:41.000000000
+0100
+++ new/cachelib-0.13.0/requirements/typing.txt 2024-04-13 16:00:33.000000000
+0200
@@ -1,16 +1,24 @@
#
-# This file is autogenerated by pip-compile with Python 3.9
+# This file is autogenerated by pip-compile with Python 3.11
# by the following command:
#
# pip-compile requirements/typing.in
#
-mypy==0.991
- # via -r requirements/typing.in
-mypy-extensions==0.4.3
+cffi==1.15.1
+ # via cryptography
+cryptography==42.0.4
+ # via
+ # types-pyopenssl
+ # types-redis
+mypy==1.9.0
+ # via -r typing.in
+mypy-extensions==1.0.0
# via mypy
-tomli==2.0.1
- # via mypy
-types-redis==4.4.0.0
- # via -r requirements/typing.in
-typing-extensions==3.10.0.2
+pycparser==2.21
+ # via cffi
+types-pyopenssl==23.0.0.2
+ # via types-redis
+types-redis==4.6.0.20240311
+ # via -r typing.in
+typing-extensions==4.9.0
# via mypy
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/cachelib-0.10.2/setup.cfg
new/cachelib-0.13.0/setup.cfg
--- old/cachelib-0.10.2/setup.cfg 2023-01-31 20:48:07.378322100 +0100
+++ new/cachelib-0.13.0/setup.cfg 2024-04-13 16:16:09.637476000 +0200
@@ -28,7 +28,7 @@
packages = find:
package_dir = = src
include_package_data = true
-python_requires = >= 3.7
+python_requires = >= 3.8
[options.packages.find]
where = src
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/cachelib-0.10.2/src/cachelib/__init__.py
new/cachelib-0.13.0/src/cachelib/__init__.py
--- old/cachelib-0.10.2/src/cachelib/__init__.py 2023-01-31
20:12:28.000000000 +0100
+++ new/cachelib-0.13.0/src/cachelib/__init__.py 2024-04-13
16:01:46.000000000 +0200
@@ -3,6 +3,7 @@
from cachelib.dynamodb import DynamoDbCache
from cachelib.file import FileSystemCache
from cachelib.memcached import MemcachedCache
+from cachelib.mongodb import MongoDbCache
from cachelib.redis import RedisCache
from cachelib.simple import SimpleCache
from cachelib.uwsgi import UWSGICache
@@ -16,5 +17,6 @@
"RedisCache",
"UWSGICache",
"DynamoDbCache",
+ "MongoDbCache",
]
-__version__ = "0.10.2"
+__version__ = "0.13.0"
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/cachelib-0.10.2/src/cachelib/base.py
new/cachelib-0.13.0/src/cachelib/base.py
--- old/cachelib-0.10.2/src/cachelib/base.py 2023-01-31 20:10:03.000000000
+0100
+++ new/cachelib-0.13.0/src/cachelib/base.py 2024-02-11 17:03:28.000000000
+0100
@@ -102,7 +102,7 @@
:param timeout: the cache timeout for the key in seconds (if not
specified, it uses the default timeout). A timeout of
0 indicates that the cache never expires.
- :returns: A list containing all keys sucessfuly set
+ :returns: A list containing all keys successfully set
:rtype: boolean
"""
set_keys = []
@@ -116,7 +116,7 @@
:param keys: The function accepts multiple keys as positional
arguments.
- :returns: A list containing all sucessfuly deleted keys
+ :returns: A list containing all successfully deleted keys
:rtype: boolean
"""
deleted_keys = []
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/cachelib-0.10.2/src/cachelib/dynamodb.py
new/cachelib-0.13.0/src/cachelib/dynamodb.py
--- old/cachelib-0.10.2/src/cachelib/dynamodb.py 2023-01-31
20:12:43.000000000 +0100
+++ new/cachelib-0.13.0/src/cachelib/dynamodb.py 2024-02-11
17:03:08.000000000 +0100
@@ -145,7 +145,6 @@
:return: True if the key existed and was deleted
"""
try:
-
self._table.delete_item(
Key={self._key_field: self.key_prefix + key},
ConditionExpression=self._attr(self._key_field).exists(),
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/cachelib-0.10.2/src/cachelib/file.py
new/cachelib-0.13.0/src/cachelib/file.py
--- old/cachelib-0.10.2/src/cachelib/file.py 2023-01-31 20:10:03.000000000
+0100
+++ new/cachelib-0.13.0/src/cachelib/file.py 2024-04-13 16:02:35.000000000
+0200
@@ -1,4 +1,5 @@
import errno
+import hashlib
import logging
import os
import platform
@@ -7,7 +8,6 @@
import tempfile
import typing as _t
from contextlib import contextmanager
-from hashlib import md5
from pathlib import Path
from time import sleep
from time import time
@@ -16,6 +16,14 @@
from cachelib.serializers import FileSystemSerializer
+def _lazy_md5(string: bytes = b"") -> _t.Any:
+ """Don't access ``hashlib.md5`` until runtime. FIPS builds may not include
+ md5, in which case the import and use as a default would fail before the
+ developer can configure something else.
+ """
+ return hashlib.md5(string)
+
+
class FileSystemCache(BaseCache):
"""A cache that stores the items on the file system. This cache depends
on being the only user of the `cache_dir`. Make absolutely sure that
@@ -32,12 +40,16 @@
:param mode: the file mode wanted for the cache files, default 0600
:param hash_method: Default hashlib.md5. The hash method used to
generate the filename for cached results.
+ Default is lazy loaded and can be overriden by
+ seeting `_default_hash_method`
"""
#: used for temporary files by the FileSystemCache
_fs_transaction_suffix = ".__wz_cache"
#: keep amount of files in a cache element
_fs_count_file = "__wz_cache_count"
+ #: default file name hashing method
+ _default_hash_method = staticmethod(_lazy_md5)
serializer = FileSystemSerializer()
@@ -47,12 +59,15 @@
threshold: int = 500,
default_timeout: int = 300,
mode: _t.Optional[int] = None,
- hash_method: _t.Any = md5,
+ hash_method: _t.Any = None,
):
BaseCache.__init__(self, default_timeout)
self._path = cache_dir
self._threshold = threshold
- self._hash_method = hash_method
+
+ self._hash_method = self._default_hash_method
+ if hash_method is not None:
+ self._hash_method = hash_method
# Mode set by user takes precedence. If no mode has
# been given, we need to set the correct default based
@@ -148,10 +163,7 @@
exc_info=True,
)
fname_sorted = (
- fname
- for _, fname in sorted(
- exp_fname_tuples, key=lambda item: item[0] # type: ignore
- )
+ fname for _, fname in sorted(exp_fname_tuples, key=lambda item:
item[0])
)
for fname in fname_sorted:
try:
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/cachelib-0.10.2/src/cachelib/memcached.py
new/cachelib-0.13.0/src/cachelib/memcached.py
--- old/cachelib-0.10.2/src/cachelib/memcached.py 2023-01-31
20:10:03.000000000 +0100
+++ new/cachelib-0.13.0/src/cachelib/memcached.py 2024-02-11
17:03:08.000000000 +0100
@@ -9,7 +9,6 @@
class MemcachedCache(BaseCache):
-
"""A cache that uses memcached as backend.
The first argument can either be an object that resembles the API of a
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/cachelib-0.10.2/src/cachelib/mongodb.py
new/cachelib-0.13.0/src/cachelib/mongodb.py
--- old/cachelib-0.10.2/src/cachelib/mongodb.py 1970-01-01 01:00:00.000000000
+0100
+++ new/cachelib-0.13.0/src/cachelib/mongodb.py 2024-02-11 17:03:28.000000000
+0100
@@ -0,0 +1,202 @@
+import datetime
+import logging
+import typing as _t
+
+from cachelib.base import BaseCache
+from cachelib.serializers import BaseSerializer
+
+
+class MongoDbCache(BaseCache):
+ """
+ Implementation of cachelib.BaseCache that uses mongodb collection
+ as the backend.
+
+ Limitations: maximum MongoDB document size is 16mb
+
+ :param client: mongodb client or connection string
+ :param db: mongodb database name
+ :param collection: mongodb collection name
+ :param default_timeout: Set the timeout in seconds after which cache
entries
+ expire
+ :param key_prefix: A prefix that should be added to all keys.
+
+ """
+
+ serializer = BaseSerializer()
+
+ def __init__(
+ self,
+ client: _t.Any = None,
+ db: _t.Optional[str] = "cache-db",
+ collection: _t.Optional[str] = "cache-collection",
+ default_timeout: int = 300,
+ key_prefix: _t.Optional[str] = None,
+ **kwargs: _t.Any
+ ):
+ super().__init__(default_timeout)
+ try:
+ import pymongo # type: ignore
+ except ImportError:
+ logging.warning("no pymongo module found")
+
+ if client is None or isinstance(client, str):
+ client = pymongo.MongoClient(host=client)
+ self.client = client[db][collection]
+ index_info = self.client.index_information()
+ all_keys = {
+ subkey[0] for value in index_info.values() for subkey in
value["key"]
+ }
+ if "id" not in all_keys:
+ self.client.create_index("id", unique=True)
+ self.key_prefix = key_prefix or ""
+ self.collection = collection
+
+ def _utcnow(self) -> _t.Any:
+ """Return a tz-aware UTC datetime representing the current time"""
+ return datetime.datetime.utcnow().replace(tzinfo=datetime.timezone.utc)
+
+ def _expire_records(self) -> _t.Any:
+ res = self.client.delete_many({"expiration": {"$lte": self._utcnow()}})
+ return res
+
+ def get(self, key: str) -> _t.Any:
+ """
+ Get a cache item
+
+ :param key: The cache key of the item to fetch
+ :return: cache value if not expired, else None
+ """
+ self._expire_records()
+ record = self.client.find_one({"id": self.key_prefix + key})
+ value = None
+ if record:
+ value = self.serializer.loads(record["val"])
+ return value
+
+ def delete(self, key: str) -> bool:
+ """
+ Deletes an item from the cache. This is a no-op if the item doesn't
+ exist
+
+ :param key: Key of the item to delete.
+ :return: True if the key existed and was deleted
+ """
+ res = self.client.delete_one({"id": self.key_prefix + key})
+ deleted = bool(res.deleted_count > 0)
+ return deleted
+
+ def _set(
+ self,
+ key: str,
+ value: _t.Any,
+ timeout: _t.Optional[int] = None,
+ overwrite: _t.Optional[bool] = True,
+ ) -> _t.Any:
+ """
+ Store a cache item, with the option to not overwrite existing items
+
+ :param key: Cache key to use
+ :param value: a serializable object
+ :param timeout: The timeout in seconds for the cached item, to override
+ the default
+ :param overwrite: If true, overwrite any existing cache item with key.
+ If false, the new value will only be stored if no
+ non-expired cache item exists with key.
+ :return: True if the new item was stored.
+ """
+ timeout = self._normalize_timeout(timeout)
+ now = self._utcnow()
+
+ if not overwrite:
+ # fail if a non-expired item with this key
+ # already exists
+ if self.has(key):
+ return False
+
+ dump = self.serializer.dumps(value)
+ record = {"id": self.key_prefix + key, "val": dump}
+
+ if timeout > 0:
+ record["expiration"] = now + datetime.timedelta(seconds=timeout)
+ self.client.update_one({"id": self.key_prefix + key}, {"$set":
record}, True)
+ return True
+
+ def set(self, key: str, value: _t.Any, timeout: _t.Optional[int] = None)
-> _t.Any:
+ self._expire_records()
+ return self._set(key, value, timeout=timeout, overwrite=True)
+
+ def set_many(
+ self, mapping: _t.Dict[str, _t.Any], timeout: _t.Optional[int] = None
+ ) -> _t.List[_t.Any]:
+ self._expire_records()
+ from pymongo import UpdateOne
+
+ operations = []
+ now = self._utcnow()
+ timeout = self._normalize_timeout(timeout)
+ for key, val in mapping.items():
+ dump = self.serializer.dumps(val)
+
+ record = {"id": self.key_prefix + key, "val": dump}
+
+ if timeout > 0:
+ record["expiration"] = now +
datetime.timedelta(seconds=timeout)
+ operations.append(
+ UpdateOne({"id": self.key_prefix + key}, {"$set": record},
upsert=True),
+ )
+
+ result = self.client.bulk_write(operations)
+ keys = list(mapping.keys())
+ if result.bulk_api_result["nUpserted"] != len(keys):
+ query = self.client.find(
+ {"id": {"$in": [self.key_prefix + key for key in keys]}}
+ )
+ keys = []
+ for item in query:
+ keys.append(item["id"])
+ return keys
+
+ def get_many(self, *keys: str) -> _t.List[_t.Any]:
+ results = self.get_dict(*keys)
+ values = []
+ for key in keys:
+ values.append(results.get(key, None))
+ return values
+
+ def get_dict(self, *keys: str) -> _t.Dict[str, _t.Any]:
+ self._expire_records()
+ query = self.client.find(
+ {"id": {"$in": [self.key_prefix + key for key in keys]}}
+ )
+ results = dict.fromkeys(keys, None)
+ for item in query:
+ value = self.serializer.loads(item["val"])
+ results[item["id"][len(self.key_prefix) :]] = value
+ return results
+
+ def add(self, key: str, value: _t.Any, timeout: _t.Optional[int] = None)
-> _t.Any:
+ self._expire_records()
+ return self._set(key, value, timeout=timeout, overwrite=False)
+
+ def has(self, key: str) -> bool:
+ self._expire_records()
+ record = self.get(key)
+ return record is not None
+
+ def delete_many(self, *keys: str) -> _t.List[_t.Any]:
+ self._expire_records()
+ res = list(keys)
+ filter = {"id": {"$in": [self.key_prefix + key for key in keys]}}
+ result = self.client.delete_many(filter)
+
+ if result.deleted_count != len(keys):
+ existing_keys = [
+ item["id"][len(self.key_prefix) :] for item in
self.client.find(filter)
+ ]
+ res = [item for item in keys if item not in existing_keys]
+
+ return res
+
+ def clear(self) -> bool:
+ self.client.drop()
+ return True
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/cachelib-0.10.2/src/cachelib/redis.py
new/cachelib-0.13.0/src/cachelib/redis.py
--- old/cachelib-0.10.2/src/cachelib/redis.py 2023-01-31 20:10:03.000000000
+0100
+++ new/cachelib-0.13.0/src/cachelib/redis.py 2024-02-11 17:03:28.000000000
+0100
@@ -37,8 +37,8 @@
password: _t.Optional[str] = None,
db: int = 0,
default_timeout: int = 300,
- key_prefix: _t.Optional[str] = None,
- **kwargs: _t.Any
+ key_prefix: _t.Optional[_t.Union[str, _t.Callable[[], str]]] = None,
+ **kwargs: _t.Any,
):
BaseCache.__init__(self, default_timeout)
if host is None:
@@ -57,6 +57,11 @@
self._read_client = self._write_client = host
self.key_prefix = key_prefix or ""
+ def _get_prefix(self) -> str:
+ return (
+ self.key_prefix if isinstance(self.key_prefix, str) else
self.key_prefix()
+ )
+
def _normalize_timeout(self, timeout: _t.Optional[int]) -> int:
"""Normalize timeout by setting it to default of 300 if
not defined (None) or -1 if explicitly set to zero.
@@ -69,11 +74,13 @@
return timeout
def get(self, key: str) -> _t.Any:
- return self.serializer.loads(self._read_client.get(self.key_prefix +
key))
+ return self.serializer.loads(
+ self._read_client.get(f"{self._get_prefix()}{key}")
+ )
def get_many(self, *keys: str) -> _t.List[_t.Any]:
if self.key_prefix:
- prefixed_keys = [self.key_prefix + key for key in keys]
+ prefixed_keys = [f"{self._get_prefix()}{key}" for key in keys]
else:
prefixed_keys = list(keys)
return [self.serializer.loads(x) for x in
self._read_client.mget(prefixed_keys)]
@@ -82,20 +89,24 @@
timeout = self._normalize_timeout(timeout)
dump = self.serializer.dumps(value)
if timeout == -1:
- result = self._write_client.set(name=self.key_prefix + key,
value=dump)
+ result = self._write_client.set(
+ name=f"{self._get_prefix()}{key}", value=dump
+ )
else:
result = self._write_client.setex(
- name=self.key_prefix + key, value=dump, time=timeout
+ name=f"{self._get_prefix()}{key}", value=dump, time=timeout
)
return result
def add(self, key: str, value: _t.Any, timeout: _t.Optional[int] = None)
-> _t.Any:
timeout = self._normalize_timeout(timeout)
dump = self.serializer.dumps(value)
- created = self._write_client.setnx(name=self.key_prefix + key,
value=dump)
+ created = self._write_client.setnx(
+ name=f"{self._get_prefix()}{key}", value=dump
+ )
# handle case where timeout is explicitly set to zero
if created and timeout != -1:
- self._write_client.expire(name=self.key_prefix + key, time=timeout)
+ self._write_client.expire(name=f"{self._get_prefix()}{key}",
time=timeout)
return created
def set_many(
@@ -109,33 +120,32 @@
for key, value in mapping.items():
dump = self.serializer.dumps(value)
if timeout == -1:
- pipe.set(name=self.key_prefix + key, value=dump)
+ pipe.set(name=f"{self._get_prefix()}{key}", value=dump)
else:
- pipe.setex(name=self.key_prefix + key, value=dump,
time=timeout)
+ pipe.setex(name=f"{self._get_prefix()}{key}", value=dump,
time=timeout)
results = pipe.execute()
- res = zip(mapping.keys(), results) # noqa: B905
- return [k for k, was_set in res if was_set]
+ return [k for k, was_set in zip(mapping.keys(), results) if was_set]
def delete(self, key: str) -> bool:
- return bool(self._write_client.delete(self.key_prefix + key))
+ return bool(self._write_client.delete(f"{self._get_prefix()}{key}"))
def delete_many(self, *keys: str) -> _t.List[_t.Any]:
if not keys:
return []
if self.key_prefix:
- prefixed_keys = [self.key_prefix + key for key in keys]
+ prefixed_keys = [f"{self._get_prefix()}{key}" for key in keys]
else:
prefixed_keys = [k for k in keys]
self._write_client.delete(*prefixed_keys)
return [k for k in prefixed_keys if not self.has(k)]
def has(self, key: str) -> bool:
- return bool(self._read_client.exists(self.key_prefix + key))
+ return bool(self._read_client.exists(f"{self._get_prefix()}{key}"))
def clear(self) -> bool:
status = 0
if self.key_prefix:
- keys = self._read_client.keys(self.key_prefix + "*")
+ keys = self._read_client.keys(self._get_prefix() + "*")
if keys:
status = self._write_client.delete(*keys)
else:
@@ -143,7 +153,7 @@
return bool(status)
def inc(self, key: str, delta: int = 1) -> _t.Any:
- return self._write_client.incr(name=self.key_prefix + key,
amount=delta)
+ return self._write_client.incr(name=f"{self._get_prefix()}{key}",
amount=delta)
def dec(self, key: str, delta: int = 1) -> _t.Any:
- return self._write_client.incr(name=self.key_prefix + key,
amount=-delta)
+ return self._write_client.incr(name=f"{self._get_prefix()}{key}",
amount=-delta)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/cachelib-0.10.2/src/cachelib/serializers.py
new/cachelib-0.13.0/src/cachelib/serializers.py
--- old/cachelib-0.10.2/src/cachelib/serializers.py 2023-01-31
20:10:03.000000000 +0100
+++ new/cachelib-0.13.0/src/cachelib/serializers.py 2024-02-11
17:03:08.000000000 +0100
@@ -80,9 +80,7 @@
"""Default serializer for RedisCache."""
def dumps(self, value: _t.Any, protocol: int = pickle.HIGHEST_PROTOCOL) ->
bytes:
- """Dumps an object into a string for redis. By default it serializes
- integers as regular string and pickle dumps everything else.
- """
+ """Dumps an object into a string for redis, using pickle by default."""
return b"!" + pickle.dumps(value, protocol)
def loads(self, value: _t.Optional[bytes]) -> _t.Any:
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/cachelib-0.10.2/src/cachelib/simple.py
new/cachelib-0.13.0/src/cachelib/simple.py
--- old/cachelib-0.10.2/src/cachelib/simple.py 2023-01-31 20:10:03.000000000
+0100
+++ new/cachelib-0.13.0/src/cachelib/simple.py 2024-02-11 17:03:08.000000000
+0100
@@ -6,7 +6,6 @@
class SimpleCache(BaseCache):
-
"""Simple memory cache for single process environments. This class exists
mainly for the development server and is not 100% thread safe. It tries
to use as many atomic operations as possible and no locks for simplicity
@@ -40,10 +39,7 @@
def _remove_older(self) -> None:
k_ordered = (
- k
- for k, v in sorted(
- self._cache.items(), key=lambda item: item[1][0] # type:
ignore
- )
+ k for k, v in sorted(self._cache.items(), key=lambda item:
item[1][0])
)
for k in k_ordered:
self._cache.pop(k, None)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/cachelib-0.10.2/src/cachelib.egg-info/PKG-INFO
new/cachelib-0.13.0/src/cachelib.egg-info/PKG-INFO
--- old/cachelib-0.10.2/src/cachelib.egg-info/PKG-INFO 2023-01-31
20:48:07.000000000 +0100
+++ new/cachelib-0.13.0/src/cachelib.egg-info/PKG-INFO 2024-04-13
16:16:09.000000000 +0200
@@ -1,6 +1,6 @@
Metadata-Version: 2.1
Name: cachelib
-Version: 0.10.2
+Version: 0.13.0
Summary: A collection of cache libraries in the same API interface.
Home-page: https://github.com/pallets-eco/cachelib/
Maintainer: Pallets
@@ -13,13 +13,12 @@
Project-URL: Issue Tracker, https://github.com/pallets-eco/cachelib/issues/
Project-URL: Twitter, https://twitter.com/PalletsTeam
Project-URL: Chat, https://discord.gg/pallets
-Platform: UNKNOWN
Classifier: Development Status :: 5 - Production/Stable
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: BSD License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python
-Requires-Python: >=3.7
+Requires-Python: >=3.8
Description-Content-Type: text/x-rst
License-File: LICENSE.rst
@@ -63,5 +62,3 @@
- Issue Tracker: https://github.com/pallets/cachelib/issues/
- Twitter: https://twitter.com/PalletsTeam
- Chat: https://discord.gg/pallets
-
-
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/cachelib-0.10.2/src/cachelib.egg-info/SOURCES.txt
new/cachelib-0.13.0/src/cachelib.egg-info/SOURCES.txt
--- old/cachelib-0.10.2/src/cachelib.egg-info/SOURCES.txt 2023-01-31
20:48:07.000000000 +0100
+++ new/cachelib-0.13.0/src/cachelib.egg-info/SOURCES.txt 2024-04-13
16:16:09.000000000 +0200
@@ -16,7 +16,6 @@
.github/ISSUE_TEMPLATE/bug-report.md
.github/ISSUE_TEMPLATE/config.yml
.github/ISSUE_TEMPLATE/feature-request.md
-.github/workflows/lock.yaml
.github/workflows/tests.yaml
docs/Makefile
docs/base.rst
@@ -28,6 +27,7 @@
docs/license.rst
docs/make.bat
docs/memcached.rst
+docs/mongodb.rst
docs/redis.rst
docs/simple.rst
docs/uwsgi.rst
@@ -43,6 +43,7 @@
src/cachelib/dynamodb.py
src/cachelib/file.py
src/cachelib/memcached.py
+src/cachelib/mongodb.py
src/cachelib/py.typed
src/cachelib/redis.py
src/cachelib/serializers.py
@@ -61,6 +62,7 @@
tests/test_file_system_cache.py
tests/test_interface_uniformity.py
tests/test_memcached_cache.py
+tests/test_mongodb_cache.py
tests/test_redis_cache.py
tests/test_simple_cache.py
tests/test_uwsgi_cache.py
\ No newline at end of file
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/cachelib-0.10.2/tests/conftest.py
new/cachelib-0.13.0/tests/conftest.py
--- old/cachelib-0.10.2/tests/conftest.py 2023-01-31 20:10:03.000000000
+0100
+++ new/cachelib-0.13.0/tests/conftest.py 2024-02-11 17:03:08.000000000
+0100
@@ -25,7 +25,8 @@
warnings.warn(
"Pytest could not find tox 'TMPDIR' in the environment,"
" make sure the variable is set in the project tox.ini"
- " file if you are running under tox."
+ " file if you are running under tox.",
+ stacklevel=2,
)
else:
with open(script_path, mode="w") as f:
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/cachelib-0.10.2/tests/test_file_system_cache.py
new/cachelib-0.13.0/tests/test_file_system_cache.py
--- old/cachelib-0.10.2/tests/test_file_system_cache.py 2023-01-31
20:10:03.000000000 +0100
+++ new/cachelib-0.13.0/tests/test_file_system_cache.py 2024-04-13
15:51:06.000000000 +0200
@@ -42,9 +42,21 @@
super().__init__(*args, hash_method=hashlib.sha256, **kwargs)
+class CustomDefaultHashingMethodCache(FileSystemCache):
+ _default_hash_method = hashlib.sha256
+
+ def __init__(self, *args, **kwargs):
+ super().__init__(*args, **kwargs)
+
+
@pytest.fixture(
autouse=True,
- params=[FileSystemCache, CustomSerializerCache, CustomHashingMethodCache],
+ params=[
+ FileSystemCache,
+ CustomSerializerCache,
+ CustomHashingMethodCache,
+ CustomDefaultHashingMethodCache,
+ ],
)
def cache_factory(request, tmpdir):
def _factory(self, *args, **kwargs):
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/cachelib-0.10.2/tests/test_mongodb_cache.py
new/cachelib-0.13.0/tests/test_mongodb_cache.py
--- old/cachelib-0.10.2/tests/test_mongodb_cache.py 1970-01-01
01:00:00.000000000 +0100
+++ new/cachelib-0.13.0/tests/test_mongodb_cache.py 2024-02-11
17:03:28.000000000 +0100
@@ -0,0 +1,30 @@
+import pytest
+from clear import ClearTests
+from common import CommonTests
+from has import HasTests
+
+from cachelib.mongodb import MongoDbCache
+
+
[email protected](autouse=True, params=[MongoDbCache])
+def cache_factory(request):
+ def _factory(self, *args, **kwargs):
+ kwargs["db"] = "test-db"
+ kwargs["collection"] = "test-collection"
+ kwargs["key_prefix"] = "prefix"
+
+ rc = request.param(*args, **kwargs)
+ index_info = rc.client.index_information()
+ all_keys = {
+ subkey[0] for value in index_info.values() for subkey in
value["key"]
+ }
+ assert "id" in all_keys, "Failed to create index on 'id' field"
+ rc.clear()
+ return rc
+
+ if request.cls:
+ request.cls.cache_factory = _factory
+
+
+class TestMongoDbCache(CommonTests, ClearTests, HasTests):
+ pass
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/cachelib-0.10.2/tests/test_redis_cache.py
new/cachelib-0.13.0/tests/test_redis_cache.py
--- old/cachelib-0.10.2/tests/test_redis_cache.py 2023-01-31
20:10:03.000000000 +0100
+++ new/cachelib-0.13.0/tests/test_redis_cache.py 2024-02-11
17:03:28.000000000 +0100
@@ -38,6 +38,15 @@
request.cls.cache_factory = _factory
+def my_callable_key() -> str:
+ return "bacon"
+
+
@pytest.mark.usefixtures("redis_server")
class TestRedisCache(CommonTests, ClearTests, HasTests):
- pass
+ def test_callable_key(self):
+ cache = self.cache_factory()
+ assert cache.set(my_callable_key, "sausages")
+ assert cache.get(my_callable_key) == "sausages"
+ assert cache.set(lambda: "spam", "sausages")
+ assert cache.get(lambda: "spam") == "sausages"
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/cachelib-0.10.2/tox.ini new/cachelib-0.13.0/tox.ini
--- old/cachelib-0.10.2/tox.ini 2023-01-31 20:10:03.000000000 +0100
+++ new/cachelib-0.13.0/tox.ini 2024-02-11 17:03:08.000000000 +0100
@@ -1,6 +1,6 @@
[tox]
envlist =
- py{39,38,37,310}
+ py{38,39,310,311}
style
typing
docs
++++++ skip-failing-tests.patch ++++++
--- /var/tmp/diff_new_pack.IYxkv6/_old 2026-03-27 16:54:02.674844034 +0100
+++ /var/tmp/diff_new_pack.IYxkv6/_new 2026-03-27 16:54:02.682844368 +0100
@@ -7,7 +7,7 @@
--- a/setup.cfg
+++ b/setup.cfg
-@@ -34,11 +34,14 @@ python_requires = >= 3.7
+@@ -34,11 +34,14 @@ python_requires = >= 3.8
where = src
[tool:pytest]
@@ -41,4 +41,24 @@
@pytest.mark.usefixtures("redis_server", "memcached_server")
class TestInterfaceUniformity:
def test_types_have_all_base_methods(self):
+--- a/tests/test_memcached_cache.py
++++ b/tests/test_memcached_cache.py
+@@ -16,6 +16,7 @@ def cache_factory(request):
+ request.cls.cache_factory = _factory
+
+
[email protected]
+ @pytest.mark.usefixtures("memcached_server")
+ class TestMemcachedCache(CommonTests, ClearTests, HasTests):
+ pass
+--- a/tests/test_redis_cache.py
++++ b/tests/test_redis_cache.py
+@@ -42,6 +42,7 @@ def my_callable_key() -> str:
+ return "bacon"
+
+
[email protected]
+ @pytest.mark.usefixtures("redis_server")
+ class TestRedisCache(CommonTests, ClearTests, HasTests):
+ def test_callable_key(self):