Skip to content

Commit 234e9fe

Browse files
authored
0.8.0 - add support for django 5.1 (#76)
public * add support for Django 5.1 * drop support for Django 3.2 * introduce `DJANGO_CURRENTUSER_USE_UNSUPPORTED_DJANGO` environment variable to make upgrades easier internal * use pyproject's `dynamic` feature for version & description * specify dependencies in `setup.py` so we can have dynamic version depdencies
1 parent ad6e7f8 commit 234e9fe

File tree

5 files changed

+37
-11
lines changed

5 files changed

+37
-11
lines changed

README.rst

+22-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,19 @@ Install django-currentuser::
1111

1212
pip install django-currentuser
1313

14-
Add it to the middleware classes in your settings.py::
14+
Note: if there is a new Django version released that the library hasn't been
15+
upgraded to support yet, e.g.:
16+
17+
The conflict is caused by:
18+
The user requested django==5.1
19+
django-currentuser 0.8.0 depends on Django<5.1 and >=4.2
20+
21+
you can try to install it with the unsupported/untested Django version by
22+
using the `DJANGO_CURRENTUSER_USE_UNSUPPORTED_DJANGO` environment variable
23+
24+
DJANGO_CURRENTUSER_USE_UNSUPPORTED_DJANGO=1 pip install django-currentuser
25+
26+
Ade it to the middleware classes in your settings.py::
1527

1628
MIDDLEWARE = (
1729
...,
@@ -57,10 +69,19 @@ Supported Versions
5769
Release Notes
5870
-------------
5971

72+
* 0.8.0
73+
74+
* add support for Django 5.1
75+
* drop support for Django 3.2
76+
* introduce `DJANGO_CURRENTUSER_USE_UNSUPPORTED_DJANGO` environment variable
77+
to make upgrades easier
78+
6079
* 0.7.0
80+
6181
* add support for Django 5.0
6282
* add support for Python 3.12
6383
* drop support for Django 4.0 and 4.1
84+
6485
* 0.6.1
6586

6687
* remove project transfer warning from README in order not to scare people away from the project

django_currentuser/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__version__ = '0.7.0'
1+
__version__ = '0.8.0'

pyproject.toml

+5-6
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,14 @@ build-backend = "setuptools.build_meta"
77

88
[project]
99
name = "django-currentuser"
10-
version = "0.7.0"
10+
dynamic = ["version", "readme", "dependencies"]
1111
authors = [
1212
{ name="Peter Zsoldos", email="[email protected]" },
1313
]
1414
maintainers = [
1515
{ name="Peter Zsoldos", email="[email protected]" },
1616
]
1717
description = "Conveniently store reference to request user on thread/db level."
18-
readme = "README.rst"
1918
requires-python = ">=3.8"
2019
classifiers = [
2120
'Development Status :: 4 - Beta',
@@ -29,12 +28,9 @@ classifiers = [
2928
'Programming Language :: Python :: 3.11',
3029
'Programming Language :: Python :: 3.12',
3130
'Framework :: Django',
32-
'Framework :: Django :: 3.2',
3331
'Framework :: Django :: 4.2',
3432
'Framework :: Django :: 5.0',
35-
]
36-
dependencies = [
37-
'Django>=3.2, < 5.1, !=4.0, !=4.1'
33+
'Framework :: Django :: 5.1',
3834
]
3935

4036
[project.urls]
@@ -44,3 +40,6 @@ dependencies = [
4440
[tool.setuptools]
4541
packages = ["django_currentuser"]
4642

43+
[tool.setuptools.dynamic]
44+
version = {attr = "django_currentuser.__version__"}
45+
readme = {file = ["README.rst"]}

setup.py

+7-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
#!/usr/bin/env python
22
# -*- coding: utf-8 -*-
33
from setuptools import setup
4+
import os
5+
6+
use_unsupported_django = os.environ.get('DJANGO_CURRENTUSER_USE_UNSUPPORTED_DJANGO', '0') == '1'
7+
8+
dependencies = ['Django'] if use_unsupported_django else ["Django>=4.2, < 5.2"]
9+
410

511
if __name__ == "__main__":
6-
setup()
12+
setup(install_requires=dependencies)

tox.ini

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
# See README.rst supported versions
22
[tox]
33
envlist =
4-
py{38,39,310}-django32,
54
py{38,39,310,311,312}-django42,
65
py{310,311,312}-django50,
6+
py{310,311,312}-django51,
77
requires =
88
tox >= 4.6.3
99
setuptools >= 61.0.0
@@ -18,9 +18,9 @@ setenv =
1818
DJANGO_SETTINGS_MODULE = settings
1919
PIP_INDEX_URL = https://pypi.python.org/simple/
2020
deps =
21-
django32: Django>=3.2,<3.3
2221
django42: Django>=4.2,<4.3
2322
django50: Django>=5.0,<5.1
23+
django51: Django>=5.1,<5.2
2424
py38,py39,py310,py311: flake8==3.8.4
2525
py312: flake8==5.0
2626
# TODO: duplicated from pyproject.toml

0 commit comments

Comments
 (0)