Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions .github/workflows/python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,14 @@ jobs:
build:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: [3.5, 3.6, 3.7, 3.8, 3.9, "pypy3"]
python-version: [3.8, 3.9, "3.10", "3.11"]

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
Expand Down
4 changes: 2 additions & 2 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -324,9 +324,9 @@ certain pattern.
Compatibility
=============

* Python 3.5, 3.6, 3.7, 3.8, 3.9
* Python 3.8, 3.9, 3.10 & 3.11

* Django 2.2, 3.0, 3.1, 3.2
* Django 3.2, 4.1 & 4.2

Check out the `tox.ini`_ file for more up-to-date compatibility by
test coverage.
Expand Down
9 changes: 4 additions & 5 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

setup(
name="django-cache-memoize",
version="0.1.10",
version="0.2.0",
description=(
"Django utility for a memoization decorator that uses the Django "
"cache framework."
Expand All @@ -18,7 +18,7 @@
url="https://github.com/peterbe/django-cache-memoize",
packages=find_packages(where="src"),
package_dir={"": "src"},
python_requires=">=3.5",
python_requires=">=3.8",
classifiers=[
"Development Status :: 5 - Production/Stable",
"Environment :: Web Environment :: Mozilla",
Expand All @@ -27,11 +27,10 @@
"License :: OSI Approved :: Mozilla Public License 2.0 (MPL 2.0)",
"License :: OSI Approved :: MIT License",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.5",
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3 :: Only",
"Topic :: Internet :: WWW/HTTP",
],
Expand Down
1 change: 0 additions & 1 deletion src/cache_memoize/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,6 @@ def inner(*args, **kwargs):
else:
result = cache.get(cache_key, MARKER)
if result is MARKER:

# If the function all raises an exception we want to cache,
# catch it, else let it propagate.
try:
Expand Down
9 changes: 0 additions & 9 deletions tests/test_cache_memoize.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ def test_the_setup():


def test_cache_memoize():

calls_made = []

@cache_memoize(10)
Expand Down Expand Up @@ -166,7 +165,6 @@ def fun(*args, **kwargs):


def test_cache_memoize_hit_miss_callables():

hits = []
misses = []
calls_made = []
Expand Down Expand Up @@ -208,7 +206,6 @@ def runmeonce(arg):


def test_cache_memoize_refresh():

calls_made = []

@cache_memoize(10)
Expand All @@ -225,7 +222,6 @@ def runmeonce(a):


def test_cache_memoize_different_functions_same_arguments():

calls_made_1 = []
calls_made_2 = []

Expand Down Expand Up @@ -271,7 +267,6 @@ def function_3(a):


def test_invalidate():

calls_made = []

@cache_memoize(10)
Expand All @@ -291,7 +286,6 @@ def function(argument):


def test_invalidate_with_refresh():

calls_made = []

@cache_memoize(10)
Expand Down Expand Up @@ -324,7 +318,6 @@ def funky(argument):


def test_cache_memoize_custom_alias():

calls_made = []

def runmeonce(a):
Expand All @@ -345,7 +338,6 @@ def runmeonce(a):


def test_cache_memoize_works_with_custom_key_generator():

calls_made = []

def key_generator(*args):
Expand All @@ -365,7 +357,6 @@ def runmeonce(arg1, arg2):


def test_invalidate_with_custom_key_generator():

calls_made = []

def key_generator(*args):
Expand Down
37 changes: 16 additions & 21 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,23 +1,19 @@
[tox]
envlist =
lint-py39,
readme-py39,
docs-py39,
py35-django{22},
py36-django{22,31,32},
py37-django{22,31,32},
py38-django{22,31,32,40},
py39-django{22,31,32,40},
pypy3-django{22,31,32},
lint-py311,
readme-py311,
docs-py311,
py38-django{32,41,42},
py39-django{32,41,42},
py310-django{32,41,42},
py311-django{41,42},

[gh-actions]
python =
3.5: py35
3.6: py36
3.7: py37
3.8: py38
3.9: py39, lint, restlint
pypy3: pypy3
3.8: py38
3.9: py39
3.10: py310
3.11: py311, lint, restlint

[testenv]
usedevelop = true
Expand All @@ -26,27 +22,26 @@ setenv =
PYTHONPATH = {toxinidir}
deps =
-rtests/requirements.txt
django22: Django>=2.2,<3
django31: Django>=3.1,<3.2
django32: Django>=3.2,<4.0
django40: Django>=4.0,<4.1
django41: Django>=4.1,<4.2
django42: Django>=4.2,<4.3
commands =
pytest {posargs:tests}

[testenv:docs-py39]
[testenv:docs-py311]
deps =
sphinx
commands =
docs: sphinx-build -b html -d {envtmpdir}/doctrees docs {envtmpdir}/html

[testenv:readme-py39]
[testenv:readme-py311]
deps =
twine
readme_renderer[md]
commands =
python setup.py sdist
twine check dist/*

[testenv:lint-py39]
[testenv:lint-py311]
extras = dev
commands=therapist run --use-tracked-files