Skip to content

Commit 3f5bd2f

Browse files
authored
Update supported Python and Django versions (#141)
1 parent a83925e commit 3f5bd2f

File tree

5 files changed

+24
-20
lines changed

5 files changed

+24
-20
lines changed

.github/workflows/python.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ jobs:
77
runs-on: ubuntu-latest
88
strategy:
99
matrix:
10-
python-version: [ "3.8", "3.9", "3.10", "3.11", "3.12" ]
10+
python-version: [ "3.9", "3.10", "3.11", "3.12", "3.13" ]
1111
steps:
1212
- uses: actions/checkout@v4
1313
- name: Set up Python ${{ matrix.python-version }}

CHANGES

+4
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@ Unreleased
22
==========
33

44
* Fix similarly named models from different apps having the same cache key
5+
* Drop support for Python 3.8
6+
* Add support for Python 3.13
7+
* Drop support for end of life Django 3.2
8+
* Add support for Django 5.1
59

610
django-solo-2.3.0
711
=================

pyproject.toml

+5-5
Original file line numberDiff line numberDiff line change
@@ -10,23 +10,23 @@ maintainers = [
1010
{name = "John Hagen", email = "[email protected]"}
1111
]
1212
readme = "README.md"
13-
requires-python = ">=3.8"
13+
requires-python = ">=3.9"
1414
classifiers = [
15-
"Framework :: Django :: 3.2",
1615
"Framework :: Django :: 4.2",
1716
"Framework :: Django :: 5.0",
17+
"Framework :: Django :: 5.1",
1818
"Intended Audience :: Developers",
1919
"Operating System :: OS Independent",
2020
"Programming Language :: Python",
2121
"Programming Language :: Python :: 3",
22-
"Programming Language :: Python :: 3.8",
2322
"Programming Language :: Python :: 3.9",
2423
"Programming Language :: Python :: 3.10",
2524
"Programming Language :: Python :: 3.11",
2625
"Programming Language :: Python :: 3.12",
26+
"Programming Language :: Python :: 3.13",
2727
]
2828
dependencies = [
29-
"django>=3.2",
29+
"django>=4.2",
3030
"typing-extensions>=4.0.1; python_version < '3.11'",
3131
]
3232
license = {text = "Creative Commons Attribution 3.0 Unported"}
@@ -47,7 +47,7 @@ exclude = "solo/tests"
4747

4848
[tool.ruff]
4949
line-length = 100
50-
target-version = "py38"
50+
target-version = "py39"
5151

5252
[tool.ruff.lint]
5353
select = [

solo/models.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ def get_cache(cache_name: str) -> BaseCache:
2626
DeprecationWarning,
2727
stacklevel=2,
2828
)
29-
return caches[cache_name] # type: ignore[no-any-return] # mypy bug, unable to get a MRE
29+
return caches[cache_name]
3030

3131

3232
class SingletonModel(models.Model):
@@ -73,11 +73,11 @@ def get_solo(cls) -> Self:
7373
cache_name = getattr(settings, "SOLO_CACHE", solo_settings.SOLO_CACHE)
7474
if not cache_name:
7575
obj, _ = cls.objects.get_or_create(pk=cls.singleton_instance_id)
76-
return obj # type: ignore[return-value]
76+
return obj
7777
cache = caches[cache_name]
7878
cache_key = cls.get_cache_key()
7979
obj = cache.get(cache_key)
8080
if not obj:
8181
obj, _ = cls.objects.get_or_create(pk=cls.singleton_instance_id)
8282
obj.set_to_cache()
83-
return obj # type: ignore[return-value]
83+
return obj

tox.ini

+11-11
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,24 @@
11
# Configure which test environments are run for each Github Actions Python version.
22
[gh-actions]
33
python =
4-
3.8: py38-django{32,42}
5-
3.9: py39-django{32,42}
6-
3.10: py310-django{32,42,50}, type-check, lint
7-
3.11: py311-django{42,50}
8-
3.12: py312-django{42,50}
4+
3.9: py39-django{42}
5+
3.10: py310-django{42,50}, type-check, lint
6+
3.11: py311-django{42,50,51}
7+
3.12: py312-django{42,50,51}
8+
3.13: py313-django{42,50,51}
99

1010
[tox]
1111
envlist =
1212
type-check
1313
lint
14-
py{38,39,310}-django{32,42}
15-
py{311,312}-django{42,50}
14+
py{38,39,310}-django{42,50}
15+
py{311,312,313}-django{42,50,51}
1616

1717
[testenv]
1818
deps =
19-
django32: Django>=3.2,<4.0
2019
django42: Django>=4.2,<4.3
2120
django50: Django>=5.0,<5.1
21+
django51: Django>=5.1,<5.2
2222
commands =
2323
{envpython} {toxinidir}/manage.py test solo --settings=solo.tests.settings
2424

@@ -39,15 +39,15 @@ commands =
3939
[testenv:type-check]
4040
skip_install = true
4141
deps =
42-
mypy==1.8.0
43-
django-stubs==4.2.7
42+
mypy==1.12.0
43+
django-stubs==5.1.0
4444
commands =
4545
mypy solo
4646

4747
[testenv:lint]
4848
skip_install = true
4949
deps =
50-
ruff==0.5.0
50+
ruff==0.7.0
5151
commands =
5252
ruff format --check
5353
ruff check

0 commit comments

Comments
 (0)