Skip to content

Commit d788fa4

Browse files
authored
feat: support official python/django versions (#66)
1 parent ef449fe commit d788fa4

File tree

6 files changed

+26
-41
lines changed

6 files changed

+26
-41
lines changed

.github/workflows/python.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,14 @@ jobs:
99
build:
1010
runs-on: ubuntu-latest
1111
strategy:
12+
fail-fast: false
1213
matrix:
13-
python-version: [3.5, 3.6, 3.7, 3.8, 3.9, "pypy3"]
14+
python-version: [3.8, 3.9, "3.10", "3.11"]
1415

1516
steps:
16-
- uses: actions/checkout@v2
17+
- uses: actions/checkout@v4
1718
- name: Set up Python ${{ matrix.python-version }}
18-
uses: actions/setup-python@v2
19+
uses: actions/setup-python@v4
1920
with:
2021
python-version: ${{ matrix.python-version }}
2122
- name: Install dependencies

README.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -324,9 +324,9 @@ certain pattern.
324324
Compatibility
325325
=============
326326

327-
* Python 3.5, 3.6, 3.7, 3.8, 3.9
327+
* Python 3.8, 3.9, 3.10 & 3.11
328328

329-
* Django 2.2, 3.0, 3.1, 3.2
329+
* Django 3.2, 4.1 & 4.2
330330

331331
Check out the `tox.ini`_ file for more up-to-date compatibility by
332332
test coverage.

setup.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
setup(
88
name="django-cache-memoize",
9-
version="0.1.10",
9+
version="0.2.0",
1010
description=(
1111
"Django utility for a memoization decorator that uses the Django "
1212
"cache framework."
@@ -18,7 +18,7 @@
1818
url="https://github.com/peterbe/django-cache-memoize",
1919
packages=find_packages(where="src"),
2020
package_dir={"": "src"},
21-
python_requires=">=3.5",
21+
python_requires=">=3.8",
2222
classifiers=[
2323
"Development Status :: 5 - Production/Stable",
2424
"Environment :: Web Environment :: Mozilla",
@@ -27,11 +27,10 @@
2727
"License :: OSI Approved :: Mozilla Public License 2.0 (MPL 2.0)",
2828
"License :: OSI Approved :: MIT License",
2929
"Programming Language :: Python :: 3",
30-
"Programming Language :: Python :: 3.5",
31-
"Programming Language :: Python :: 3.6",
32-
"Programming Language :: Python :: 3.7",
3330
"Programming Language :: Python :: 3.8",
3431
"Programming Language :: Python :: 3.9",
32+
"Programming Language :: Python :: 3.10",
33+
"Programming Language :: Python :: 3.11",
3534
"Programming Language :: Python :: 3 :: Only",
3635
"Topic :: Internet :: WWW/HTTP",
3736
],

src/cache_memoize/__init__.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,6 @@ def inner(*args, **kwargs):
130130
else:
131131
result = cache.get(cache_key, MARKER)
132132
if result is MARKER:
133-
134133
# If the function all raises an exception we want to cache,
135134
# catch it, else let it propagate.
136135
try:

tests/test_cache_memoize.py

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ def test_the_setup():
1818

1919

2020
def test_cache_memoize():
21-
2221
calls_made = []
2322

2423
@cache_memoize(10)
@@ -166,7 +165,6 @@ def fun(*args, **kwargs):
166165

167166

168167
def test_cache_memoize_hit_miss_callables():
169-
170168
hits = []
171169
misses = []
172170
calls_made = []
@@ -208,7 +206,6 @@ def runmeonce(arg):
208206

209207

210208
def test_cache_memoize_refresh():
211-
212209
calls_made = []
213210

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

226223

227224
def test_cache_memoize_different_functions_same_arguments():
228-
229225
calls_made_1 = []
230226
calls_made_2 = []
231227

@@ -271,7 +267,6 @@ def function_3(a):
271267

272268

273269
def test_invalidate():
274-
275270
calls_made = []
276271

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

292287

293288
def test_invalidate_with_refresh():
294-
295289
calls_made = []
296290

297291
@cache_memoize(10)
@@ -324,7 +318,6 @@ def funky(argument):
324318

325319

326320
def test_cache_memoize_custom_alias():
327-
328321
calls_made = []
329322

330323
def runmeonce(a):
@@ -345,7 +338,6 @@ def runmeonce(a):
345338

346339

347340
def test_cache_memoize_works_with_custom_key_generator():
348-
349341
calls_made = []
350342

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

366358

367359
def test_invalidate_with_custom_key_generator():
368-
369360
calls_made = []
370361

371362
def key_generator(*args):

tox.ini

Lines changed: 16 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,19 @@
11
[tox]
22
envlist =
3-
lint-py39,
4-
readme-py39,
5-
docs-py39,
6-
py35-django{22},
7-
py36-django{22,31,32},
8-
py37-django{22,31,32},
9-
py38-django{22,31,32,40},
10-
py39-django{22,31,32,40},
11-
pypy3-django{22,31,32},
3+
lint-py311,
4+
readme-py311,
5+
docs-py311,
6+
py38-django{32,41,42},
7+
py39-django{32,41,42},
8+
py310-django{32,41,42},
9+
py311-django{41,42},
1210

1311
[gh-actions]
1412
python =
15-
3.5: py35
16-
3.6: py36
17-
3.7: py37
18-
3.8: py38
19-
3.9: py39, lint, restlint
20-
pypy3: pypy3
13+
3.8: py38
14+
3.9: py39
15+
3.10: py310
16+
3.11: py311, lint, restlint
2117

2218
[testenv]
2319
usedevelop = true
@@ -26,27 +22,26 @@ setenv =
2622
PYTHONPATH = {toxinidir}
2723
deps =
2824
-rtests/requirements.txt
29-
django22: Django>=2.2,<3
30-
django31: Django>=3.1,<3.2
3125
django32: Django>=3.2,<4.0
32-
django40: Django>=4.0,<4.1
26+
django41: Django>=4.1,<4.2
27+
django42: Django>=4.2,<4.3
3328
commands =
3429
pytest {posargs:tests}
3530

36-
[testenv:docs-py39]
31+
[testenv:docs-py311]
3732
deps =
3833
sphinx
3934
commands =
4035
docs: sphinx-build -b html -d {envtmpdir}/doctrees docs {envtmpdir}/html
4136

42-
[testenv:readme-py39]
37+
[testenv:readme-py311]
4338
deps =
4439
twine
4540
readme_renderer[md]
4641
commands =
4742
python setup.py sdist
4843
twine check dist/*
4944

50-
[testenv:lint-py39]
45+
[testenv:lint-py311]
5146
extras = dev
5247
commands=therapist run --use-tracked-files

0 commit comments

Comments
 (0)